Skip to content

Commit

Permalink
Merge pull request #80 from cyberious/LintUpdate
Browse files Browse the repository at this point in the history
Update Lint to default to Puppet Approved criteria
  • Loading branch information
tphoney committed May 1, 2015
2 parents bfd54ba + c8af494 commit 30baec5
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lib/puppetlabs_spec_helper/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,21 @@ def revision(scm, target, ref)
FileUtils.rm_rf("pkg/")
end

desc "Check puppet manifests with puppet-lint"
task :lint do
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.relative = true
PuppetLint.configuration.disable_class_inherits_from_params_class
PuppetLint.configuration.ignore_paths ||= []
PuppetLint.configuration.ignore_paths << "spec/fixtures/**/*.pp"
PuppetLint.configuration.ignore_paths << "pkg/**/*.pp"
PuppetLint.configuration.ignore_paths << "vendor/**/*.pp"
require 'puppet-lint/tasks/puppet-lint'
# Must clear as it will not override the existing puppet-lint rake task since we require to import for
# the PuppetLint::RakeTask
Rake::Task[:lint].clear
# Relative is not able to be set within the context of PuppetLint::RakeTask
PuppetLint.configuration.relative = true
PuppetLint::RakeTask.new(:lint) do |config|
config.fail_on_warnings = true
config.disable_checks = [
'80chars',
'class_inherits_from_params_class',
'class_parameter_defaults',
'documentation',
'single_quote_string_with_variables']
config.ignore_paths = ["tests/**/*.pp", "vendor/**/*.pp","examples/**/*.pp" "spec/**/*.pp", "pkg/**/*.pp"]
end

require 'puppet-syntax/tasks/puppet-syntax'
Expand Down

0 comments on commit 30baec5

Please sign in to comment.