diff --git a/lib/puppetlabs_spec_helper/rake_tasks.rb b/lib/puppetlabs_spec_helper/rake_tasks.rb index 61b470ef..db15bea9 100644 --- a/lib/puppetlabs_spec_helper/rake_tasks.rb +++ b/lib/puppetlabs_spec_helper/rake_tasks.rb @@ -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'