Using VS Code with PDK -- how can I manually run puppet-lint?

77 views
Skip to first unread message

Dan Mahoney

unread,
Dec 4, 2022, 6:31:18 AM12/4/22
to Puppet Users
Hey there all,

I apologize if this is off-topic.  If it is, please do let me know where better to ask.  I tried joining the puppet-vscode slack but it apparently only works if I have a puppet.com email address.

I'm on a mac, using Visual Studio Code with the PDK installed via homebrew.  The version of puppet-lint included with the PDK runs WAY more tests than any previous version of puppet-lint.

So, here are my questions:

1) Obviously the vscode plugin is running some version of puppet-lint behind the scenes, but it's unclear as to how I can run that manually in a terminal (perhaps with --fix).  When I installed pdk, it put it in /opt/puppetlabs/pdk/bin/pdk, but didn't do anything like that for puppet-lint.

2) Is there an easy way to grab those extra tests for a system that doesn't have them?  It looks to be like 20 different ruby gems, all dumped into /opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems

ls |grep lint | grep check
puppet-lint-absolute_classname-check-3.0.1
puppet-lint-anchor-check-1.0.1
puppet-lint-classes_and_types_beginning_with_digits-check-1.0.0
puppet-lint-file_ensure-check-1.0.0
puppet-lint-leading_zero-check-1.0.0
puppet-lint-legacy_facts-check-1.0.4
puppet-lint-lookup_in_parameter-check-1.0.0
puppet-lint-manifest_whitespace-check-0.1.17
puppet-lint-optional_default-check-1.0.0
puppet-lint-params_empty_string-check-1.0.0
puppet-lint-strict_indent-check-2.0.8
puppet-lint-top_scope_facts-check-1.0.1
puppet-lint-topscope-variable-check-1.0.1
puppet-lint-trailing_comma-check-0.4.2
puppet-lint-unquoted_string-check-2.1.0
puppet-lint-version_comparison-check-1.0.0




Dan Mahoney

unread,
Dec 5, 2022, 1:08:51 AM12/5/22
to Puppet Users
It turns out the answer to my second question is:

gem install voxpupuli-puppet-lint-plugins

...which seems to be a meta package that installs most of the nonstandard plugins which were then adopted by pdk.

I'm not sure how we can get those added to official puppet-lint so this step isn't necessary.

Martin Alfke

unread,
Dec 5, 2022, 7:51:50 AM12/5/22
to puppet...@googlegroups.com
PDK allows you to also run rake tasks

pdk bundle exec rake -T

Gives you an overview on available rake tasks.


-- 
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f029a449-27e1-42a3-a512-660f5d864eb8n%40googlegroups.com.

Dan Mahoney

unread,
Jan 10, 2023, 8:43:58 PM1/10/23
to puppet...@googlegroups.com
There is not a way to just run puppet-lint on a file from that.

You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/lH9UiV2bnfw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/F6189B0A-A32D-4D09-A9E1-D13A420D7505%40gmail.com.
Reply all
Reply to author
Forward
0 new messages