Re: [Puppet Users] puppet-lint & Syntax
Taking a stab at this... The puppet parser will always be the authoritative source for one's puppet code validation since that is what will be parsing the code via agent or server. It will introduce any number of bugs and inconsistencies and delay to have puppet-lint keep up with what puppet does anyway. However! You do not need to check this all manually every time you commit. There are tools which wrap these commands that you can set up to do this automatically. You can use puppet-git hooks to have all these checks performed right before a git commit is applied. Even better, you can set this up on the server side so that people are incapable of pushing risible crud to your main git repository. https://github.com/drwahl/puppet-git-hooks Under the hood, PDK uses puppet and puppet-lint and gives you the chance to add specification testing. I have this set up in our gitlab instance to run "pdk validate" and "pdk test unit" on every module we've run through "pdk convert". (You can likely have this one in a pre-commit hook too, haven't done that here.) We had some training/implementation sort of workshops and people were able to get some very basic tests done in their first time using PDK which was pleasant. https://puppet.com/docs/pdk/1.x/pdk_install.html On Tue, Feb 20, 2018 at 10:51:07PM +0100, Albert Shih wrote: > 20/02/2018 à 14:01:23+0100, Maria Elena a écrit > > Hi Albert, > > maybe cause puppet-lint checks only style (http://puppet-lint.com/). > > Regards. > > You're perfectly right. But in fact I'm not very good in english, so I will > rephrase... > > Can puppet-lint check also the syntax ? So we don't need to launch two > thing > > puppet parser validate > > and > > puppet-lint > > that would be much easier. > > Regards. > > JAS > > > Hi everyone, > > > > I'm wonder why puppet-lint don't show any syntax error. > > > > For example I just delete a "," at the end of a line and > > > > [root@io manifests]$ puppet-lint init.pp > > [root@io manifests]$ puppet parser validate init.pp Error: Could not > > parse > > for environment production: Syntax error at 'Boolean' (file: /home/jas/ > > Travaux/puppet/modules/apache/manifests/init.pp, line: 19, column: 3) > > [root@io manifests]$ > > > > puppet-lint seem to be a very powerfull tool. I don't understand why he > > cannot complain when something very simple like a missing comma cannot > > be > > detected. > > > -- > Albert SHIH > xmpp: j...@obspm.fr > Heure local/Local time: > Tue Feb 20 22:49:11 CET 2018 > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/20180220215107.GC1284%40io.chezmoi.fr. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20180220221751.txygrxov4g3ye56z%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] puppet-lint & Syntax
20/02/2018 à 14:01:23+0100, Maria Elena a écrit > Hi Albert, > maybe cause puppet-lint checks only style (http://puppet-lint.com/). > Regards. You're perfectly right. But in fact I'm not very good in english, so I will rephrase... Can puppet-lint check also the syntax ? So we don't need to launch two thing puppet parser validate and puppet-lint that would be much easier. Regards. JAS > Hi everyone, > > I'm wonder why puppet-lint don't show any syntax error. > > For example I just delete a "," at the end of a line and > > [root@io manifests]$ puppet-lint init.pp > [root@io manifests]$ puppet parser validate init.pp Error: Could not parse > for environment production: Syntax error at 'Boolean' (file: /home/jas/ > Travaux/puppet/modules/apache/manifests/init.pp, line: 19, column: 3) > [root@io manifests]$ > > puppet-lint seem to be a very powerfull tool. I don't understand why he > cannot complain when something very simple like a missing comma cannot be > detected. > -- Albert SHIH xmpp: j...@obspm.fr Heure local/Local time: Tue Feb 20 22:49:11 CET 2018 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20180220215107.GC1284%40io.chezmoi.fr. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] puppet-lint & Syntax
Hi Albert, maybe cause puppet-lint checks only style (http://puppet-lint.com/). Regards. M.E. On Tue, Feb 20, 2018 at 1:53 PM, Albert Shih wrote: > Hi everyone, > > I'm wonder why puppet-lint don't show any syntax error. > > For example I just delete a "," at the end of a line and > > [root@io manifests]$ puppet-lint init.pp > [root@io manifests]$ puppet parser validate init.pp Error: Could not > parse for environment production: Syntax error at 'Boolean' (file: > /home/jas/Travaux/puppet/modules/apache/manifests/init.pp, line: 19, > column: 3) > [root@io manifests]$ > > puppet-lint seem to be a very powerfull tool. I don't understand why he > cannot complain when something very simple like a missing comma cannot be > detected. > > Regards. > -- > Albert SHIH > Heure local/Local time: > Tue Feb 20 13:49:31 CET 2018 > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/puppet-users/20180220125301.GJ5491%40io.chezmoi.fr. > For more options, visit https://groups.google.com/d/optout. > -- PGP Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x34977A00 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAJ%3DTY9eeyXJfg2Qg-i2a%2BBhuNBY0-%2BhGhtgtUePGAAinkfZHzg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] puppet-lint & Syntax
Le 20/02/2018 à 14:00:04+0100, Martin Alfke a écrit Hi, > > some lint checks are not available in lint core, but are within a lint plugin. > In your case check: > https://github.com/voxpupuli/puppet-lint-trailing_comma-check.git > > Complete list can be found on voxpupuli: > https://voxpupuli.org/plugins/#puppet-lint Thanks. But well the comma was just a example. The point is puppet-lint are (IMHO) very powerfull tool, why he cannot integrate the «puppet parser» feature ? Like rubocop does for ruby ? Regards. -- Albert SHIH xmpp: j...@obspm.fr Heure local/Local time: Tue Feb 20 14:11:38 CET 2018 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20180220131313.GK5491%40io.chezmoi.fr. For more options, visit https://groups.google.com/d/optout.
Re: [Puppet Users] puppet-lint & Syntax
Hi Albert, some lint checks are not available in lint core, but are within a lint plugin. In your case check: https://github.com/voxpupuli/puppet-lint-trailing_comma-check.git Complete list can be found on voxpupuli: https://voxpupuli.org/plugins/#puppet-lint Best, Martin > On 20. Feb 2018, at 13:53, Albert Shih wrote: > > Hi everyone, > > I'm wonder why puppet-lint don't show any syntax error. > > For example I just delete a "," at the end of a line and > > [root@io manifests]$ puppet-lint init.pp > [root@io manifests]$ puppet parser validate init.pp Error: Could not parse > for environment production: Syntax error at 'Boolean' (file: > /home/jas/Travaux/puppet/modules/apache/manifests/init.pp, line: 19, column: > 3) > [root@io manifests]$ > > puppet-lint seem to be a very powerfull tool. I don't understand why he > cannot complain when something very simple like a missing comma cannot be > detected. > > Regards. > -- > Albert SHIH > Heure local/Local time: > Tue Feb 20 13:49:31 CET 2018 > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/20180220125301.GJ5491%40io.chezmoi.fr. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3AFFFB60-C79E-4F02-9501-20EFD62CAE20%40gmail.com. For more options, visit https://groups.google.com/d/optout.
[Puppet Users] puppet-lint & Syntax
Hi everyone, I'm wonder why puppet-lint don't show any syntax error. For example I just delete a "," at the end of a line and [root@io manifests]$ puppet-lint init.pp [root@io manifests]$ puppet parser validate init.pp Error: Could not parse for environment production: Syntax error at 'Boolean' (file: /home/jas/Travaux/puppet/modules/apache/manifests/init.pp, line: 19, column: 3) [root@io manifests]$ puppet-lint seem to be a very powerfull tool. I don't understand why he cannot complain when something very simple like a missing comma cannot be detected. Regards. -- Albert SHIH Heure local/Local time: Tue Feb 20 13:49:31 CET 2018 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20180220125301.GJ5491%40io.chezmoi.fr. For more options, visit https://groups.google.com/d/optout.