So some of you may be aware that Tim Sharpe from GitHub wrote a Puppet linting tool: $ gem install puppet-lint $ puppet-lint mymanifest.pp Source: https://github.com/rodjek/puppet-lint The linting tool checks Puppet code for "best practice" based on the Puppet Labs Style Guide: http://docs.puppetlabs.com/guides/style_guide.html A lot of us have been using puppet-lint (and puppet parser validate) to ensure our code is synoptically correct and as "best practice" as possible. We''re also aware that there are some strange and odd things in the Puppet language and whilst we can''t fix all them right now we''d like to find a way to highlight items and syntax that is sub-optimal for you via linting. So what can you do to help? Well firstly help us identify any syntax, language constructions, structures etc that have caused issues for you or that when used result in errors or issues. You can let us know about these in three ways: * Submit patches and additions to the linting tool. Patches in the form of failing tests are especially welcome if you aren''t comfortable adding new tests yourself. * Email me or the list with tickets containing issues like this. * Send me or the list snippets of Puppet code that cause issues and the output/issue they result in. We''ll also look at tracking as many of these as possible and where relevant update the Style Guide with them too. Cheers James -- James Turnbull Puppet Labs 1-503-734-8571 To schedule a meeting with me: http://tungle.me/jamtur01 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
I am also very interested in this to enable Geppetto to also provide the same feedback. One difficulty I have faced is to find good samples that should trigger different kinds of warnings and errors. I have collected some in Geppetto''s tests, and I keep adding more over time. Biggest difficulty however are unclear language semantics ;) or issues like the ''hyphen in variable name''. Anyway... It may be of value to set up a shared repository at github with samples that contains problems for the tools (lint, geppetto, or the puppet runtime) to process and where the expected outcome is perhaps described in comments (or some other simple mechanism). The various tool projects can then use this for their unit tests + naturally learn about tips and tricks. It should be really easy for anyone to contribute a sample documented with expected outcome. I think it is also of value to include examples that result in errors/warnings at runtime - i.e. not so much a "lint" issue, but various real problems and how the are reported. This for the same purpose; unit test that the tools find these as expected and report problems in a good way. I can see my self contributing to such a joint effort. What do you think? Regards - henrik On 2011-19-12 21:00, James Turnbull wrote:> So some of you may be aware that Tim Sharpe from GitHub wrote a Puppet > linting tool: > > $ gem install puppet-lint > $ puppet-lint mymanifest.pp > > Source: https://github.com/rodjek/puppet-lint > > The linting tool checks Puppet code for "best practice" based on the > Puppet Labs Style Guide: > > http://docs.puppetlabs.com/guides/style_guide.html > > A lot of us have been using puppet-lint (and puppet parser validate) to > ensure our code is synoptically correct and as "best practice" as > possible. > > We''re also aware that there are some strange and odd things in the > Puppet language and whilst we can''t fix all them right now we''d like to > find a way to highlight items and syntax that is sub-optimal for you via > linting. > > So what can you do to help? Well firstly help us identify any syntax, > language constructions, structures etc that have caused issues for you > or that when used result in errors or issues. You can let us know about > these in three ways: > > * Submit patches and additions to the linting tool. Patches in the form > of failing tests are especially welcome if you aren''t comfortable adding > new tests yourself. > * Email me or the list with tickets containing issues like this. > * Send me or the list snippets of Puppet code that cause issues and the > output/issue they result in. > > We''ll also look at tracking as many of these as possible and where > relevant update the Style Guide with them too. > > Cheers > > James >-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
Is there a minimum version of ruby or puppet for it to work? I am open to running this on my entire puppet tree (close to 53 modules and growing). puppet-lint /etc/puppet/manifests /usr/lib/ruby/gems/1.8/gems/puppet-lint-0.1.7/bin/../lib/puppet-lint/plugin.rb:43: warning: parenthesize argument(s) /usr/lib/ruby/gems/1.8/gems/puppet-lint-0.1.7/bin/../lib/puppet-lint.rb:28:in `read'': Is a directory - /etc/puppet/mE from /usr/lib/ruby/gems/1.8/gems/puppet-lint-0.1.7/bin/../lib/puppet-lint.rb:28:in `file='' from /usr/lib/ruby/gems/1.8/gems/puppet-lint-0.1.7/bin/puppet-lint:51 from /usr/bin/puppet-lint:19:in `load'' from /usr/bin/puppet-lint:19 On Mon, Dec 19, 2011 at 4:11 PM, Henrik Lindberg < henrik.lindberg@cloudsmith.com> wrote:> I am also very interested in this to enable Geppetto to also provide the > same feedback. One difficulty I have faced is to find good samples that > should trigger different kinds of warnings and errors. I have collected > some in Geppetto''s tests, and I keep adding more over time. > > Biggest difficulty however are unclear language semantics ;) or issues > like the ''hyphen in variable name''. Anyway... > > It may be of value to set up a shared repository at github with samples > that contains problems for the tools (lint, geppetto, or the puppet > runtime) to process and where the expected outcome is perhaps described in > comments (or some other simple mechanism). The various tool projects can > then use this for their unit tests + naturally learn about tips and tricks. > It should be really easy for anyone to contribute a sample documented with > expected outcome. > > I think it is also of value to include examples that result in > errors/warnings at runtime - i.e. not so much a "lint" issue, but various > real problems and how the are reported. This for the same purpose; unit > test that the tools find these as expected and report problems in a good > way. > > I can see my self contributing to such a joint effort. > > What do you think? > > Regards > - henrik > > > On 2011-19-12 21:00, James Turnbull wrote: > >> So some of you may be aware that Tim Sharpe from GitHub wrote a Puppet >> linting tool: >> >> $ gem install puppet-lint >> $ puppet-lint mymanifest.pp >> >> Source: https://github.com/rodjek/**puppet-lint<https://github.com/rodjek/puppet-lint> >> >> The linting tool checks Puppet code for "best practice" based on the >> Puppet Labs Style Guide: >> >> http://docs.puppetlabs.com/**guides/style_guide.html<http://docs.puppetlabs.com/guides/style_guide.html> >> >> A lot of us have been using puppet-lint (and puppet parser validate) to >> ensure our code is synoptically correct and as "best practice" as >> possible. >> >> We''re also aware that there are some strange and odd things in the >> Puppet language and whilst we can''t fix all them right now we''d like to >> find a way to highlight items and syntax that is sub-optimal for you via >> linting. >> >> So what can you do to help? Well firstly help us identify any syntax, >> language constructions, structures etc that have caused issues for you >> or that when used result in errors or issues. You can let us know about >> these in three ways: >> >> * Submit patches and additions to the linting tool. Patches in the form >> of failing tests are especially welcome if you aren''t comfortable adding >> new tests yourself. >> * Email me or the list with tickets containing issues like this. >> * Send me or the list snippets of Puppet code that cause issues and the >> output/issue they result in. >> >> We''ll also look at tracking as many of these as possible and where >> relevant update the Style Guide with them too. >> >> Cheers >> >> James >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To post to this group, send email to puppet-dev@googlegroups.com. > To unsubscribe from this group, send email to puppet-dev+unsubscribe@** > googlegroups.com <puppet-dev%2Bunsubscribe@googlegroups.com>. > For more options, visit this group at http://groups.google.com/** > group/puppet-dev?hl=en <http://groups.google.com/group/puppet-dev?hl=en>. > >-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
Walter Heck
2011-Dec-20 15:21 UTC
Re: [Puppet Users] Re: [Puppet-dev] Re: When the lint accumulates...
On 2011-19-12 21:00, James Turnbull wrote:>> >>> So what can you do to help? Well firstly help us identify any syntax, >>> language constructions, structures etc that have caused issues for you >>> or that when used result in errors or issues. You can let us know about >>> these in three ways >>> >> 1) When I run puppet-lint manifests/*.pp, it would be nice to have thefilenames output. Right now it just outputs all errors for all files in one big list, which doesn''t tell me which errror belongs to which file. 2) I''d like to define the errorlevel (eg. --errorlevel=error) looks nice so far, wish we could have this in geppetto soon :) cheers, -- Walter Heck -- follow @walterheck on twitter to see what I''m up to! -- Check out my new startup: Server Monitoring as a Service @ http://tribily.com Follow @tribily on Twitter and/or ''Like'' our Facebook page at http://www.facebook.com/tribily -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
it''d be very great if the various best-practice definitions in the puppet universe would match ;-) Have fun, David On Mon, 19 Dec 2011 22:11:53 +0100, Henrik Lindberg <henrik.lindberg@cloudsmith.com> wrote:> I am also very interested in this to enable Geppetto to also provide the> same feedback. One difficulty I have faced is to find good samples that > should trigger different kinds of warnings and errors. I have collected > some in Geppetto''s tests, and I keep adding more over time. > > Biggest difficulty however are unclear language semantics ;) or issues > like the ''hyphen in variable name''. Anyway... > > It may be of value to set up a shared repository at github with samples > that contains problems for the tools (lint, geppetto, or the puppet > runtime) to process and where the expected outcome is perhaps described > in comments (or some other simple mechanism). The various tool projects > can then use this for their unit tests + naturally learn about tips and > tricks. It should be really easy for anyone to contribute a sample > documented with expected outcome. > > I think it is also of value to include examples that result in > errors/warnings at runtime - i.e. not so much a "lint" issue, but > various real problems and how the are reported. This for the same > purpose; unit test that the tools find these as expected and report > problems in a good way. > > I can see my self contributing to such a joint effort. > > What do you think? > > Regards > - henrik > > On 2011-19-12 21:00, James Turnbull wrote: >> So some of you may be aware that Tim Sharpe from GitHub wrote a Puppet >> linting tool: >> >> $ gem install puppet-lint >> $ puppet-lint mymanifest.pp >> >> Source: https://github.com/rodjek/puppet-lint >> >> The linting tool checks Puppet code for "best practice" based on the >> Puppet Labs Style Guide: >> >> http://docs.puppetlabs.com/guides/style_guide.html >> >> A lot of us have been using puppet-lint (and puppet parser validate) to >> ensure our code is synoptically correct and as "best practice" as >> possible. >> >> We''re also aware that there are some strange and odd things in the >> Puppet language and whilst we can''t fix all them right now we''d like to >> find a way to highlight items and syntax that is sub-optimal for youvia>> linting. >> >> So what can you do to help? Well firstly help us identify any syntax, >> language constructions, structures etc that have caused issues for you >> or that when used result in errors or issues. You can let us know about >> these in three ways: >> >> * Submit patches and additions to the linting tool. Patches in the form >> of failing tests are especially welcome if you aren''t comfortableadding>> new tests yourself. >> * Email me or the list with tickets containing issues like this. >> * Send me or the list snippets of Puppet code that cause issues and the >> output/issue they result in. >> >> We''ll also look at tracking as many of these as possible and where >> relevant update the Style Guide with them too. >> >> Cheers >> >> James >>-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
James Turnbull
2011-Dec-20 18:05 UTC
Re: [Puppet Users] Re: Re: When the lint accumulates...
Walter Heck wrote:> > > On 2011-19-12 21:00, James Turnbull wrote: > > So what can you do to help? Well firstly help us identify > any syntax, > language constructions, structures etc that have caused > issues for you > or that when used result in errors or issues. You can let us > know about > these in three ways > > 1) When I run puppet-lint manifests/*.pp, it would be nice to have the > filenames output. Right now it just outputs all errors for all files in > one big list, which doesn''t tell me which errror belongs to which file.There''s a patch for this already: https://github.com/rodjek/puppet-lint/pull/38.> > 2) I''d like to define the errorlevel (eg. --errorlevel=error)I''ve added a ticket for this also: https://github.com/rodjek/puppet-lint/issues/45 Regards James Turnbull -- James Turnbull Puppet Labs 1-503-734-8571 To schedule a meeting with me: http://tungle.me/jamtur01 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
James Turnbull
2011-Dec-20 18:07 UTC
Re: [Puppet Users] Re: Re: When the lint accumulates...
Christopher Johnston wrote:> Is there a minimum version of ruby or puppet for it to work? I am open > to running this on my entire puppet tree (close to 53 modules and > growing). > > puppet-lint /etc/puppet/manifests > /usr/lib/ruby/gems/1.8/gems/puppet-lint-0.1.7/bin/../lib/puppet-lint/plugin.rb:43: > warning: parenthesize argument(s) > /usr/lib/ruby/gems/1.8/gems/puppet-lint-0.1.7/bin/../lib/puppet-lint.rb:28:in > `read'': Is a directory - /etc/puppet/mE > from > /usr/lib/ruby/gems/1.8/gems/puppet-lint-0.1.7/bin/../lib/puppet-lint.rb:28:in > `file='' > from /usr/lib/ruby/gems/1.8/gems/puppet-lint-0.1.7/bin/puppet-lint:51 > from /usr/bin/puppet-lint:19:in `load'' > from /usr/bin/puppet-lint:19 >Christopher You''re trying to read a directory - it needs a file. $ puppet-lint /path/to/file.pp I usually grep all my files in /etc/puppet/manifests or modules and pipe all the .pp files through puppet-lint. Regards James Turnbull -- James Turnbull Puppet Labs 1-503-734-8571 To schedule a meeting with me: http://tungle.me/jamtur01 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
Henrik Lindberg
2011-Dec-20 21:52 UTC
Re: [Puppet Users] Re: [Puppet-dev] Re: When the lint accumulates...
On 2011-20-12 16:21, Walter Heck wrote:> looks nice so far, wish we could have this in geppetto soon :) > > cheers, > > -- > Walter HeckJust a quick note regarding Geppetto in this respect, and to let you know what the plans are (I am not trying to hijack this thread :)... I follow the lint project and read the all the issues that are logged there, as well as looking at reported puppet bugs, and what people have problems with/questions on this mailinglist/group. In geppetto I have added "Potential Problems" preferences and started implementing additional "lint checks". The ambition is to add every check that is semantic in nature. Each of the checks are configurable (ignore, warning, error), and they are set to warning by default. The first couple of such checks will be available in the 2.1.2 release, which is almost ready. Also plan to add support for the formatting related "lints", but this is delayed due to deficiencies in the underlying formatter that is used. Waiting for an improved formatter framework to be available. When that is in place, it is possible to control it in a more fine grained way, and thus, rather than complaining that the formatting is off, you can simply format everything using the policy (or tweak it if you don''t want to stick to the party-line). Regards - henrik -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.