Hi Sajith,

May be we can run the Ruby script you wrote at the maven build phase to
validate YAML files, using the exec-plugin. Another way is to write a Maven
plugin to validate the given YAML files (using ex: SnakeYAML?).


Regards,
Chamila de Alwis
Committer and PMC Member - Apache Stratos
Software Engineer | WSO2 | +94772207163
Blog: code.chamiladealwis.com



On Sun, Jan 17, 2016 at 3:18 AM, Pubudu Fernando <pubu...@wso2.com> wrote:

> Hi,
>
> I make use of [1] in Atom for catching and fixing syntax errors in Puppet
> modules. Works in the terminal too. Source code is available on Github.
> Maybe this can be adapted for use, if incorporating validation to the
> project itself?
>
> [1] - https://atom.io/packages/linter-puppet-lint
>
> *Pubudu Fernando*
> Software Engineering Intern
> WSO2 Inc.
> mobile: +94 77 888 2543
> blog: http://blog.pubudu.xyz
>
>
> On Sun, Jan 17, 2016 at 2:26 AM, Sajith Kariyawasam <saj...@wso2.com>
> wrote:
>
>> well, ideally we should validate all the puppet modules too (*.pp files)
>> for syntax errors, at the time of packaging the modules.
>>
>> On Sun, Jan 17, 2016 at 2:24 AM, Sajith Kariyawasam <saj...@wso2.com>
>> wrote:
>>
>>> Hi Devs,
>>>
>>> While implementing puppet modules in [1] I came across with syntax
>>> errors (using tabs, missing semicolons etc) in yaml files and which was
>>> detected only at the puppet runtime.
>>> True that some editors do syntax validation, but there could be
>>> situations developers use simple editors. IMO its good if we can provide
>>> yaml validation into the project itself, which would
>>> make sure there are no yaml syntax errors. For now, I wrote a simple
>>> ruby script[2] to validate this and were able to find one issue in a yaml
>>> file :)
>>> May be we could incorporate this into the maven build file? WDYT?
>>>
>>> [1] https://github.com/wso2/puppet-modules
>>> [2]
>>> =================================
>>> begin
>>>   require 'yaml'
>>>
>>>   Dir.glob('**/*.yaml') do |rb_file|
>>>     YAML.load_file("#{rb_file}")
>>>   end
>>>
>>> rescue => e
>>>   puts "Error during processing: #{$!}"
>>> end
>>> =================================
>>>
>>> Thanks,
>>> Sajith
>>>
>>> --
>>> Sajith Kariyawasam
>>> *Committer and PMC member, Apache Stratos, *
>>> *WSO2 Inc.; http://wso2.com <http://wso2.com>*
>>> *Mobile: 0772269575*
>>>
>>
>>
>>
>> --
>> Sajith Kariyawasam
>> *Committer and PMC member, Apache Stratos, *
>> *WSO2 Inc.; http://wso2.com <http://wso2.com>*
>> *Mobile: 0772269575*
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to