-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathSteepfile
More file actions
71 lines (51 loc) · 1.54 KB
/
Steepfile
File metadata and controls
71 lines (51 loc) · 1.54 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
68
69
70
71
require "fileutils"
D = Steep::Diagnostic
FileUtils.mkpath("tmp")
tmp_rbs_dir = Pathname("tmp/rbs-sig")
# The DSL is executed in the main process and worker processes, and the file operations introduce a race condition.
# This line ensures the operations are executed only in the main process.
if caller.none? {|c| c =~ /\/worker_process\.rb:/ }
tmp_rbs_dir.delete if tmp_rbs_dir.exist?
definition = Bundler::Definition.build(Pathname("Gemfile"), Pathname("Gemfile.lock"), nil)
rbs_dep = definition.dependencies.find {|dep| dep.name == "rbs" }
if (source = rbs_dep&.source).is_a?(Bundler::Source::Path)
tmp_rbs_dir.make_symlink(Pathname.pwd + source.path + "sig")
end
end
target :app do
collection_config "rbs_collection.steep.yaml"
check "lib"
ignore "lib/steep/shims"
signature "sig"
ignore_signature "sig/test"
implicitly_returns_nil!
configure_code_diagnostics(D::Ruby.strict) do |hash|
end
if tmp_rbs_dir.directory?
signature tmp_rbs_dir.to_s
else
library "rbs"
end
end
target :test do
collection_config "rbs_collection.steep.yaml"
unreferenced!
implicitly_returns_nil!
check "test"
signature "sig/test"
configure_code_diagnostics(D::Ruby.lenient)
unless tmp_rbs_dir.directory?
library "rbs"
end
end
target :bin do
unreferenced!
implicitly_returns_nil!
collection_config "rbs_collection.steep.yaml"
check "bin/generate-diagnostics-docs.rb"
signature "tmp/rbs-inline/bin"
configure_code_diagnostics(D::Ruby.lenient)
unless tmp_rbs_dir.directory?
library "rbs"
end
end