-
Notifications
You must be signed in to change notification settings - Fork 145
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
Update Lint to default to Puppet Approved criteria #80
Conversation
PuppetLint.configuration.ignore_paths << "spec/fixtures/**/*.pp" | ||
PuppetLint.configuration.ignore_paths << "pkg/**/*.pp" | ||
require 'puppet-lint/tasks/puppet-lint' | ||
Rake::Task[:lint].clear |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I don't believe that you need to clear the :lint
task here, as this would be the only :lint
defined at this point in time.
The reason I had to do it in my module Rakefile
was because I was overriding this task. Once the ignore_paths
have been set, they cannot be changed. As mentioned, only the first :lint
task will be the one run by Rake, so if you wish to change ignore_paths
, then you have to ensure that there is one task.
For reference, my module uses this code:
# necessary to ensure default :lint doesn't exist, else ignore_paths won't work
Rake::Task[:lint].clear
PuppetLint.configuration.relative = true
PuppetLint.configuration.disable_class_inherits_from_params_class
PuppetLint::RakeTask.new :lint do |config|
config.ignore_paths = ['contrib/**/*.pp', 'tests/**/*.pp', 'spec/**/*.pp', 'pkg/**/*.pp']
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If notice that we are not just creating the rake task but using the PuppetLint::RakeTask class which upon import will define a lint Rake task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, you've removed task :lint
, and replaced it with PuppetLint::RakeTask.new(:lint)
, which is fine (and the same thing my example does).
My point is that there are no tasks defined prior to calling Rake::Task[:lint].clear
, making that line unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require 'puppet-lint/tasks/puppet-lint' creates the task by default. Since we have to require it prior to creating the Task via PuppetLint::RakeTask.new you have to clear it.
The minimum version of puppet-lint needs setting to >= 1.1.0 in the gemspec, as older versions don't have this ability IIRC. (And if 1.1.1 comes out before this is merged, I'd suggest changing the above items and setting it to >= 1.1.1 instead.) |
@domcleal so as I understand it, these are fixed but not released yet and don't know when they will be released? |
@cyberious yep |
This has went quiet, it also needs a rebase. |
Update Lint to default to Puppet Approved criteria
No description provided.