forked from daenney/pupa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
41 lines (37 loc) · 1.07 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'pathname'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
# This is needed until https://github.com/rodjek/puppet-lint/commit/efb19675 gets released
# Need to add the bootstrap/ directory to the exclude paths
Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|
config.pattern = 'dist/**/*.pp'
config.disable_checks = ['documentation', '140chars']
config.with_filename = true
config.fail_on_warnings = true
config.log_format = '%{filename} - %{message}'
config.with_context = true
config.fix = false
config.show_ignored = false
config.relative = true
end
task(:lint_output) { puts '---> lint'}
Rake::Task[:lint].enhance [:lint_output]
desc "Run specs for every module in dist/"
task :dist_spec do
dirs = Pathname.new('dist').children.select { |c| c.directory? }
dirs.each do |mod|
Dir.chdir(mod) do
if File.directory?('spec')
puts "---> spec: #{mod}"
system "rake spec"
end
end
end
end
desc "Run syntax, lint and spec tests"
task :test => [
:syntax,
:lint,
:dist_spec,
]