From fb188ba2733dcec7349c3c2bdca3812fc16f1f0d Mon Sep 17 00:00:00 2001 From: tphoney Date: Wed, 29 Aug 2018 17:21:12 +0100 Subject: [PATCH] (feat) add puppet lint fix task --- lib/puppetlabs_spec_helper/rake_tasks.rb | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/puppetlabs_spec_helper/rake_tasks.rb b/lib/puppetlabs_spec_helper/rake_tasks.rb index 876a7647..394631c1 100644 --- a/lib/puppetlabs_spec_helper/rake_tasks.rb +++ b/lib/puppetlabs_spec_helper/rake_tasks.rb @@ -131,10 +131,36 @@ 140chars class_inherits_from_params_class class_parameter_defaults + disable_autoloader_layout documentation single_quote_string_with_variables ] config.ignore_paths = [ + '.vendor/**/*.pp', + 'bundle/**/*.pp', + 'pkg/**/*.pp', + 'spec/**/*.pp', + 'tests/**/*.pp', + 'types/**/*.pp', + 'vendor/**/*.pp', + ] +end + +desc 'Run puppet-lint and fix issues automatically' +PuppetLint::RakeTask.new(:lint_fix) do |config| + config.fail_on_warnings = true + config.fix = true + config.disable_checks = %w[ + 80chars + 140chars + class_inherits_from_params_class + class_parameter_defaults + disable_autoloader_layout + documentation + single_quote_string_with_variables + ] + config.ignore_paths = [ + '.vendor/**/*.pp', 'bundle/**/*.pp', 'pkg/**/*.pp', 'spec/**/*.pp',