-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
67 lines (55 loc) · 1.76 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
63
64
65
66
67
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'cucumber'
require 'cucumber/rake/task'
require 'rubocop/rake_task'
require 'bundler/audit/task'
require 'yard'
require 'yardstick/rake/measurement'
require 'pathname'
require 'license_finder'
require 'English'
RSpec::Core::RakeTask.new(:spec) do |task|
# task.rspec_opts = '--warnings'
end
Cucumber::Rake::Task.new(:features) do |task|
task.cucumber_opts = '--publish-quiet'
end
RuboCop::RakeTask.new(:rubocop) do |task|
rubocop_report_pathname =
Pathname(Rake.application.original_dir).join('tmp', 'rubocop.txt')
rubocop_report_pathname.dirname.mkpath
task.options =
%w[
--display-cop-names
--extra-details
--display-style-guide
--fail-level error
--format progress
--format simple
--out
].push(rubocop_report_pathname.to_s)
end
Bundler::Audit::Task.new
desc 'Check dependency licenses'
task :license_finder do
puts `license_finder --quiet --format text`
abort('LicenseFinder failed') unless $CHILD_STATUS.success?
end
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb']
t.stats_options = ['--list-undoc']
end
Yardstick::Rake::Measurement.new(:yardstick_measure) do |measurement|
measurement.output = 'tmp/yard_coverage.txt'
end
desc 'Show which specified gems are outdated'
task 'bundle:outdated' do
bundle_outdated_report_pathname =
Pathname(Rake.application.original_dir).join('tmp', 'bundle_outdated.txt')
bundle_outdated_report_pathname.dirname.mkpath
# TODO: Should consider re-writing this without using `tee`.
sh("bundle outdated --only-explicit | tee #{bundle_outdated_report_pathname}")
end
task default: %i[spec features rubocop yard yardstick_measure bundle:audit license_finder]