forked from anycable/anycable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
49 lines (40 loc) · 1.08 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
# frozen_string_literal: true
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
begin
require "rubocop/rake_task"
RuboCop::RakeTask.new
RuboCop::RakeTask.new("rubocop:md") do |task|
task.options << %w[-c .rubocop-md.yml]
end
rescue LoadError
task(:rubocop) {}
task("rubocop:md") {}
end
task :steep do
# Steep doesn't provide Rake integration yet,
# but can do that ourselves
require "steep"
require "steep/cli"
Steep::CLI.new(argv: ["check", "--severity-level=error"], stdout: $stdout, stderr: $stderr, stdin: $stdin).run.tap do |exit_code|
exit(exit_code) unless exit_code.zero?
end
end
namespace :steep do
task :stats do
sh "bundle exec steep stats --log-level=fatal --format=table"
end
end
namespace :spec do
desc "Run RSpec with RBS runtime tester enabled"
task :rbs do
rspec_args = ARGV.join.split("--", 2).last
sh <<~COMMAND
RBS_TEST_LOGLEVEL=error \
RBS_TEST_TARGET="AnyCable::*" \
rspec -rrbs/test/setup \
#{rspec_args}
COMMAND
end
end
task default: %w[rubocop rubocop:md steep spec spec:rbs]