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: [email protected] > 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 [email protected]. > 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 [email protected]. 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.
