forked from voxpupuli/puppet-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
62 lines (53 loc) · 1.36 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require 'puppetlabs_spec_helper/rake_tasks'
require 'rubocop/rake_task'
require 'puppet-strings/tasks'
RuboCop::RakeTask.new
exclude_paths = [
'pkg/**/*',
'vendor/**/*',
'spec/**/*',
'examples/**/*'
]
# Make sure we don't have the default rake task floating around
Rake::Task['lint'].clear
PuppetLint.configuration.relative = true
PuppetLint::RakeTask.new(:lint) do |l|
l.disable_checks = %w(80chars class_inherits_from_params_class)
l.ignore_paths = exclude_paths
l.fail_on_warnings = true
l.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
end
PuppetSyntax.exclude_paths = exclude_paths
namespace :travis do
desc 'Syntax check travis.yml'
task :lint do
# warnings are currently non-fatal due to suspected problems with
# validation of matrix::include
#sh "travis lint --exit-code" do |ok, res|
sh 'travis lint --skip-completion-check' do |ok, res|
unless ok
# exit without verbose rake error message
exit res.exitstatus
end
end
end
end
sh_scripts = %w(
templates/jenkins-slave-run.erb
)
desc 'Syntax check shellscripts'
task :shellcheck do
sh "shellcheck #{sh_scripts.join(' ')}" do |ok, res|
unless ok
# exit without verbose rake error message
exit res.exitstatus
end
end
end
default_tasks = [
:lint,
:validate,
:parallel_spec,
:rubocop
]
task :default => default_tasks