Skip to content

Conversation

nmaludy
Copy link
Contributor

@nmaludy nmaludy commented Jan 21, 2021

Currently the spec helper configures PuppetLint in such a way that it's not easy to add extra directories or disable checks for a local module. Basically, you have to completely redefine the Rake task exactly how puppetlabs_spec_helper does it today, which is not idea.

Instead, this changes over to using the PuppetLint.configuration class to set the global options, this way things like ignore_paths can be appended to easily in a spec_helper_local.rb like so:

PuppetLint.configuration.ignore_paths << 'modules/**/*'

@nmaludy nmaludy requested review from a team as code owners January 21, 2021 16:43
@nmaludy nmaludy force-pushed the feature/puppet-lint-config branch from 59c9482 to a4bed8a Compare January 21, 2021 18:44
@codecov-io
Copy link

codecov-io commented Jan 21, 2021

Codecov Report

Merging #330 (a4bed8a) into main (cbad6f4) will increase coverage by 0.33%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #330      +/-   ##
==========================================
+ Coverage   43.28%   43.61%   +0.33%     
==========================================
  Files          11       11              
  Lines         841      846       +5     
==========================================
+ Hits          364      369       +5     
  Misses        477      477              
Impacted Files Coverage Δ
lib/puppetlabs_spec_helper/rake_tasks.rb 42.62% <100.00%> (+1.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update caa3191...a4bed8a. Read the comment docs.

@tphoney tphoney self-assigned this Jan 25, 2021
Copy link
Contributor

@tphoney tphoney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix 👍

@tphoney tphoney merged commit 7579a28 into puppetlabs:main Jan 25, 2021
# spec_helper.rb in an individual module
PuppetLint.configuration.relative = true
PuppetLint::RakeTask.new(:lint) do |config|
config.fail_on_warnings = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting was lost in the refactor. I opened #347 to fix the regression.

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 this pull request may close these issues.

4 participants