24 lines
600 B
Ruby
24 lines
600 B
Ruby
|
require 'puppetlabs_spec_helper/rake_tasks'
|
||
|
|
||
|
defaults = [:validate, :spec]
|
||
|
begin
|
||
|
if Gem::Specification::find_by_name('metadata-json-lint')
|
||
|
defaults = defaults.insert(0, :metadata_lint)
|
||
|
end
|
||
|
if Gem::Specification::find_by_name('puppet-lint')
|
||
|
require 'puppet-lint/tasks/puppet-lint'
|
||
|
exclude_paths = [
|
||
|
'bundle/**/*',
|
||
|
'pkg/**/*',
|
||
|
'vendor/**/*',
|
||
|
'spec/**/*'
|
||
|
]
|
||
|
Rake::Task[:lint].clear
|
||
|
PuppetLint::RakeTask.new :lint do |config|
|
||
|
config.ignore_paths = exclude_paths
|
||
|
end
|
||
|
defaults = defaults.insert(-2, :lint)
|
||
|
end
|
||
|
end
|
||
|
task :test => defaults
|