-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathRakefile
More file actions
50 lines (41 loc) · 1.29 KB
/
Copy pathRakefile
File metadata and controls
50 lines (41 loc) · 1.29 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
# 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]
namespace :typecheck do
desc 'Run Steep type checking against examples'
task :examples do
puts 'Running Steep type check for examples...'
result = system('bundle', 'exec', 'steep', 'check', '--steepfile=examples/Steepfile')
exit(1) unless result
end
end
task default: :test