-
Notifications
You must be signed in to change notification settings - Fork 8
/
Rakefile
39 lines (33 loc) · 862 Bytes
/
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
#!/usr/bin/env rake
require 'foodcritic'
require 'rubocop/rake_task'
require 'rspec/core/rake_task'
desc 'Run all lints'
task :lint => %w(foodcritic rubocop spec)
task :default => :lint
desc 'Run Rubocop Lint Task'
RuboCop::RakeTask.new
desc 'Run Foodcritic Lint Task'
task :foodcritic do
puts 'Running Foodcritic Lint..'
FoodCritic::Rake::LintTask.new do |fc|
fc.options = {
:fail_tags => ['any'],
:tags => %w(
~FC085
)
}
end
end
desc 'Run Knife Cookbook Test Task'
task :knife do
puts 'Running Knife Check..'
current_dir = File.expand_path(File.dirname(__FILE__))
cookbook_dir = File.dirname(current_dir)
cookbook_name = File.basename(current_dir)
sh "bundle exec knife cookbook test -o #{cookbook_dir} #{cookbook_name}"
end
desc 'Run Chef Spec Test'
task :spec do
RSpec::Core::RakeTask.new(:spec)
end