puppetlabs / puppet-lint

Check that your Puppet manifests conform to the style guide

Home Page:https://puppetlabs.github.io/puppet-lint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for plugin configurations

dploeger opened this issue · comments

Use Case

We made a check plugin, which detects roles and profiles based on the prefix "(profile|role)::", which is used at our site. Additionally, it checks for role features, which is a concept developed by us as well.

In the current form, this check most probably can't be used by users outside of our organisation, because the check can either be enabled or disabled but not configured any further.

Describe the Solution You Would Like

A check plugin should be able to add options to the main puppet-lint cli application which will be available in the plugin code so it can be easily configured and adapted by the puppet lint user to their needs.

Describe Alternatives You've Considered

As an alternative a user could clone the check plugin and adapt the source code to their needs, which isn't quite sustainable in the long term and contradicts the community approach of open source software.

You're right that this isn't very flexible, but you can use configuration. For example, https://github.com/voxpupuli/puppet-lint-param-docs#documentation-styles is implemented. So this is effectively the whole handling: https://github.com/voxpupuli/puppet-lint-param-docs/blob/a90a1f703fd13c185945b196275b0b2bd48d3201/lib/puppet-lint/plugins/check_parameter_documentation.rb#L3-L4 Then you can set it via the Rakefile (https://github.com/puppetlabs/puppet-lint#testing-with-puppet-lint-as-a-rake-task).

It would be nice if in the plugin you could declare there is an option with some metadata like a description, possibly some validation and (optionally) expose it as a CLI option.

Thanks. That is a nice approach until something else is implemented.