-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
67 lines (54 loc) · 1.57 KB
/
Rakefile
File metadata and controls
67 lines (54 loc) · 1.57 KB
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
require "bundler/setup"
require "bundler/gem_tasks"
desc "Run all tests"
task :test do
sh "bin/test"
end
desc "Run Rails tests"
task :rails_test do
sh "bin/rails_test"
end
desc "Run code coverage"
task :coverage do
ENV["COVERAGE"] = "1"
Rake::Task["test"].invoke
Rake::Task["rails_test"].invoke
end
# Add RubyCritic task with badge generation
begin
require "rubycritic_small_badge"
require "rubycritic/rake_task"
RubyCriticSmallBadge.configure do |config|
config.minimum_score = 90
end
RubyCritic::RakeTask.new do |task|
# Exclude generator template files from analysis as they aren't valid Ruby
task.paths = FileList["lib/**/*.rb"].exclude("lib/generators/**/templates/**/*.rb")
task.options = %(--custom-format RubyCriticSmallBadge::Report
--minimum-score #{RubyCriticSmallBadge.config.minimum_score}
--coverage-path coverage/.resultset.json
--no-browser)
end
desc "Run tests with coverage and then RubyCritic"
task rubycritic_with_coverage: [:coverage, :rubycritic]
rescue LoadError
desc "Run RubyCritic (not available)"
task :rubycritic do
puts "RubyCritic is not available"
end
end
desc "Generate RBS from inline annotations"
task :rbs do
sh "bundle exec rbs-inline --output lib/"
end
desc "Run Steep type check on library"
task steep: :rbs do
sh "bundle exec steep check --group=lib"
end
desc "Run Steep type check on RBS test files"
task :steep_tests do
sh "bundle exec steep check --group=rbs_tests"
end
desc "Run all Steep type checks"
task steep_all: [:steep, :steep_tests]
task default: [:test, :rails_test]