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

Allow puppet-lint fail_on_warnings to be explicitly disabled #514

Closed
nabertrand opened this issue May 11, 2023 · 0 comments · Fixed by #515
Closed

Allow puppet-lint fail_on_warnings to be explicitly disabled #514

nabertrand opened this issue May 11, 2023 · 0 comments · Fixed by #515

Comments

@nabertrand
Copy link
Contributor

<% if @configs['linter_fail_on_warnings'] -%>
PuppetLint.configuration.fail_on_warnings = true
<% end -%>

There doesn't seem to be a way to trivially disable puppet-lint fail_on_warnings in the lint rake task as the default is true via https://github.com/puppetlabs/puppetlabs_spec_helper/blob/01886e8fb8c9470e74ffde39445732ce06209125/lib/puppetlabs_spec_helper/rake_tasks.rb#L156 and the template only supports setting to true. Perhaps this fragment could be changed to something like this?

<% if @configs.include?('linter_fail_on_warnings') -%>
<% if @configs['linter_fail_on_warnings'] -%> 
PuppetLint.configuration.fail_on_warnings = true 
<% else -%>
PuppetLint.configuration.fail_on_warnings = false
<% end -%>
<% end -%> 

This would also match the description of the setting:

linter_fail_on_warnings A boolean indicating if the linter should exit non-zero on warnings as well as failures. Does affect .puppet-lint.rc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant