Puppet-lint ignores ignore_paths option

I am using https://github.com/garethr/puppet-module-skeleton as a skeleton of a Puppet module. For a specific module, I am using a puppet with a rail. The relevant sections in my Rakefile are as follows:

require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.relative = true
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
PuppetLint.configuration.fail_on_warnings = true

# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
# http://puppet-lint.com/checks/class_parameter_defaults/
PuppetLint.configuration.send('disable_class_parameter_defaults')
# http://puppet-lint.com/checks/class_inherits_from_params_class/
PuppetLint.configuration.send('disable_class_inherits_from_params_class')

exclude_paths = [
  "pkg/**/*",
  "vendor/**/*",
  "spec/**/*",
]
PuppetLint.configuration.ignore_paths = exclude_paths

      

On startup, bundle exec rake lint

I get the expected output from the doll lint, except that the doll lint checks files such as vendor/bundle

and spec/fixtures/modules

. Except that this is not intended, it conflicts with the last six lines of the above Rakefile snippet. What's wrong?

+3


source to share


1 answer


How you tied it is currently broken

Fixed in this commit: https://github.com/rodjek/puppet-lint/commit/0f2e2db90d5a14382eafbdfebff74048a487372f

However, this was done after the release 1.1.0

So you can use direct Github link in bundler (or wait for next version)



source "http://rubygems.org"

group :test do
  gem "puppet-lint", :git => 'https://github.com/rodjek/puppet-lint.git'
end

      

Or use the workaround you posted:

Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|
  config.disable_checks = [ 
    '80chars',
    'class_parameter_defaults',
    'class_inherits_from_params_class'
  ]
  config.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
  config.fail_on_warnings = true
  #config.relative = true

  config.ignore_paths = exclude_paths
end

      

+1


source







All Articles