-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
46 lines (38 loc) · 925 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
40
41
42
43
44
45
46
# frozen_string_literal: true
require 'bundler/setup'
task default: [:list]
desc 'Lists all the tasks.'
task :list do
puts "Tasks: \n- #{Rake::Task.tasks.join("\n- ")}"
end
desc 'Clean some generated files'
task :clean do
%w[
Berksfile.lock
.bundle
.cache
coverage
Gemfile.lock
.kitchen
metadata.json
vendor
].each { |f| FileUtils.rm_rf(Dir.glob(f)) }
end
desc 'Run ChefSpec/Rspec unit tests'
task :unit do
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:unit) do |t|
t.rspec_opts = '--color --format progress'
t.pattern = 'spec/*_spec.rb'
end
end
namespace :style do
require 'rubocop/rake_task'
desc 'Run Ruby style checks using rubocop'
RuboCop::RakeTask.new(:ruby)
require 'foodcritic'
desc 'Run Chef style checks using foodcritic'
FoodCritic::Rake::LintTask.new(:chef)
end
desc 'Run all style checks'
task style: %w[style:chef style:ruby]