So i can't add another option to "`puppet.bat pars...
# puppet-enterprise
g
So i can't add another option to "`puppet.bat parser validate --strict=warning "$file` " to show deprecated code in the actual .pp files themselves, irrespective of the overall module?
s
Correct.
parser validate
just checks whether the source files can pass through the parser. It can catch syntax issues like missing commas or unbalanced braces. Deprecation warnings happen in a later stage of the pipeline, in the evaluator. So, a tool beyond
parser validate
, like puppet lint or a unit test, is required to test for deprecation warnings.
c
I think puppet-lint is your lightest “lift” here.
g
Ok, and not even "pdk validate" can find deprecated code? I've tried to install puppet-lint with gem but every time i end up in ruby dependency hell. It just won't install...
c
Try: /opt/puppetlabs/puppet/bin/gem install puppet-lint When you say “PDK validate”, you're essentially saying “PDK: check if “puppet parser validate” runs against this code”. All you're doing with validate is to validate “this is parseable code” puppet-lint is the additional “does this code fit the style guide, is it formatted correctly, does it have all the t’s crossed and the i’s dotted? What platform are you on for development?
g
With respect to these tests, i have a windows laptop... When i look at code one file at a time, VS code + the puppet plugin works well, but it doesn't scale well when i want to get a "full body scan" of the code... 🙂
c
Yeah, it's unfortunate, but by all appearances Windows is a second class citizen when it comes to development for a UNIX-based automation platform. Neither here nor there, I haven't so much as even seen a Windows machine in over 20 years. I'm remembering something…that PDK may actually have puppet-lint “baked in”. Some of the other long-timers (or employees) might have better info than I do pre-coffee from my cell phone. Let me look into something and I'll get back to you. Are you using VSCode and the Puppet plugin?
It appears this is a highly pertinent thread: https://github.com/OpenVoxProject/planning/discussions/75
g
I ended up installing puppet-lint using gem, and it's really great, especially in combo with a Rakefile that could in the future run validations as well. Just now we are mainly looking at deprecated code though... As simple as: $ rake lint | grep legacy
c
You can also puppet lint foo.pp or *.pp