2015-11-30 11:23:28 +00:00
|
|
|
require 'puppetlabs_spec_helper/rake_tasks'
|
|
|
|
require 'puppet-lint/tasks/puppet-lint'
|
2017-07-11 08:52:30 +00:00
|
|
|
|
|
|
|
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
|
|
|
|
PuppetLint.configuration.fail_on_warnings = true
|
|
|
|
PuppetLint.configuration.send('relative')
|
|
|
|
PuppetLint.configuration.send('disable_140chars')
|
|
|
|
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
|
|
|
PuppetLint.configuration.send('disable_documentation')
|
|
|
|
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
|
|
|
|
|
|
|
|
exclude_paths = %w(
|
|
|
|
pkg/**/*
|
|
|
|
vendor/**/*
|
|
|
|
.vendor/**/*
|
|
|
|
spec/**/*
|
|
|
|
)
|
|
|
|
PuppetLint.configuration.ignore_paths = exclude_paths
|
|
|
|
PuppetSyntax.exclude_paths = exclude_paths
|
2015-11-30 11:23:28 +00:00
|
|
|
|
|
|
|
desc "Validate manifests, templates, and ruby files"
|
|
|
|
task :validate do
|
|
|
|
Dir['manifests/**/*.pp'].each do |manifest|
|
|
|
|
sh "puppet parser validate --noop #{manifest}"
|
|
|
|
end
|
|
|
|
Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file|
|
|
|
|
sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/
|
|
|
|
end
|
|
|
|
Dir['templates/**/*.erb'].each do |template|
|
|
|
|
sh "erb -P -x -T '-' #{template} | ruby -c"
|
|
|
|
end
|
|
|
|
end
|