Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for plugin configurations #44

Open
dploeger opened this issue Jun 3, 2022 · 2 comments
Open

Support for plugin configurations #44

dploeger opened this issue Jun 3, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@dploeger
Copy link

dploeger commented Jun 3, 2022

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.

@dploeger dploeger added the enhancement New feature or request label Jun 3, 2022
@ekohl
Copy link

ekohl commented Jun 8, 2022

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.

@dploeger
Copy link
Author

dploeger commented Jun 8, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants