-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRakefile
More file actions
57 lines (46 loc) · 1.39 KB
/
Copy pathRakefile
File metadata and controls
57 lines (46 loc) · 1.39 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
# frozen_string_literal: true
require "bundler/gem_tasks"
# Override release task to skip gem push (handled by GitHub Actions with attestations)
Rake::Task["release"].clear
desc "Build gem and create tag (gem push handled by CI)"
task release: %w[build release:guard_clean release:source_control_push]
require "standard/rake"
require "rubocop/rake_task"
RuboCop::RakeTask.new(:rubocop)
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
end
begin
require "steep/rake_task"
Steep::RakeTask.new
rescue LoadError
# Steep is not available on JRuby
end
require "yard"
YARD::Rake::YardocTask.new(:yard)
require "yardstick/rake/verify"
Yardstick::Rake::Verify.new(:yardstick) do |verify|
verify.threshold = 100
verify.require_exact_threshold = true
verify.path = Rake::FileList.new("lib/**/*.rb")
end
desc "Run linters"
task lint: %i[rubocop standard]
desc "Run mutation testing"
task :mutant do
ENV["MUTANT"] = "1"
sh "bundle", "exec", "mutant", "run"
end
desc "Run adapter benchmark (pass options after --, e.g. rake benchmark -- --quick)"
task :benchmark do
separator = ARGV.index("--")
args = separator ? ARGV[(separator + 1)..] : []
ruby "benchmark.rb", *args
exit
end
desc "Run the default task"
default_tasks = %i[test lint mutant yardstick]
default_tasks << :steep if Rake::Task.task_defined?(:steep)
task default: default_tasks