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

Update Lint to default to Puppet Approved criteria #80

Merged
merged 1 commit into from
May 1, 2015
Merged

Update Lint to default to Puppet Approved criteria #80

merged 1 commit into from
May 1, 2015

Conversation

cyberious
Copy link
Contributor

No description provided.

PuppetLint.configuration.ignore_paths << "spec/fixtures/**/*.pp"
PuppetLint.configuration.ignore_paths << "pkg/**/*.pp"
require 'puppet-lint/tasks/puppet-lint'
Rake::Task[:lint].clear
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@domcleal
Copy link
Contributor

domcleal commented Jan 2, 2015

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 domcleal mentioned this pull request Jan 2, 2015
@cyberious
Copy link
Contributor Author

@domcleal so as I understand it, these are fixed but not released yet and don't know when they will be released?

@domcleal
Copy link
Contributor

domcleal commented Jan 5, 2015

@cyberious yep

@tphoney
Copy link
Contributor

tphoney commented Apr 21, 2015

This has went quiet, it also needs a rebase.

@cyberious
Copy link
Contributor Author

@domcleal 4 months later still no Puppet-lint 1.1.1, @tphoney rebased

tphoney added a commit that referenced this pull request May 1, 2015
Update Lint to default to Puppet Approved criteria
@tphoney tphoney merged commit 30baec5 into puppetlabs:master May 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants