-
-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathRakefile
More file actions
41 lines (33 loc) · 1.03 KB
/
Rakefile
File metadata and controls
41 lines (33 loc) · 1.03 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
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rake/testtask'
if ENV['BUNDLE_GEMFILE'] == File.expand_path('Gemfile') || ENV['BUNDLE_GEMFILE'].empty? || ENV['BUNDLE_GEMFILE'].nil?
ENV['BUNDLE_GEMFILE'] = File.expand_path('Gemfile')
end
Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.libs << 'lib'
file_list = ENV['BUNDLE_GEMFILE'] == File.expand_path('Gemfile') ? FileList['test/**/*_test.rb'] : FileList['test/dependencies/test_dependencies.rb']
t.test_files = file_list
end
begin
require 'steep'
require 'rbs'
rescue LoadError
puts 'Steep or RBS is not installed. Skipping type check tasks.'
end
desc 'Run Steep type checking'
task :steep do
puts 'Running Steep type check...'
result = system('bundle', 'exec', 'steep', 'check')
exit(1) unless result
end
desc 'Run RBS validation'
task :rbs do
puts 'Validating RBS signatures...'
result = system('bundle', 'exec', 'rbs', 'validate')
exit(1) unless result
end
desc 'Run all type checks'
task typecheck: [:rbs, :steep]
task default: :test