steep 1.9.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/steep/drivers/annotations.rb +1 -1
- data/lib/steep/interface/builder.rb +5 -2
- data/lib/steep/project/dsl.rb +9 -1
- data/lib/steep/project/target.rb +3 -1
- data/lib/steep/server/type_check_controller.rb +1 -1
- data/lib/steep/services/signature_service.rb +12 -8
- data/lib/steep/services/type_check_service.rb +1 -1
- data/lib/steep/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 522d134347810d1fbb030d139f616077fcc197aabe079bf14453305c9c9562bd
|
4
|
+
data.tar.gz: bd6a1a97a815c02ba20160d6bc1bd2166c1a02cdee3901c2a84fca2fe1b22d0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254fb6ef3b682ea7866e2892755e183bcd8ed797f4209faf999f40cdcb140a67083c73684ba80273cbf2e563650a2213114c474a2e0d3e50cc6d0cdc5d05caf0
|
7
|
+
data.tar.gz: b5daeab25121a44e5e9ad4a353de77115f7f626c0f5ac9342c1fe0ac061eabf75cbf3fef26a3b651d0b4849a0c05d5c1eafe9027f72294af0974f7b051f9eb71
|
data/CHANGELOG.md
CHANGED
@@ -21,7 +21,7 @@ module Steep
|
|
21
21
|
|
22
22
|
project.targets.each do |target|
|
23
23
|
Steep.logger.tagged "target=#{target.name}" do
|
24
|
-
service = Services::SignatureService.load_from(target.new_env_loader())
|
24
|
+
service = Services::SignatureService.load_from(target.new_env_loader(), implicitly_returns_nil: target.implicitly_returns_nil)
|
25
25
|
|
26
26
|
sigs = loader.load_changes(target.signature_pattern, changes: {})
|
27
27
|
service.update(sigs)
|
@@ -54,13 +54,14 @@ module Steep
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
attr_reader :factory, :object_shape_cache, :union_shape_cache, :singleton_shape_cache
|
57
|
+
attr_reader :factory, :object_shape_cache, :union_shape_cache, :singleton_shape_cache, :implicitly_returns_nil
|
58
58
|
|
59
|
-
def initialize(factory)
|
59
|
+
def initialize(factory, implicitly_returns_nil:)
|
60
60
|
@factory = factory
|
61
61
|
@object_shape_cache = {}
|
62
62
|
@union_shape_cache = {}
|
63
63
|
@singleton_shape_cache = {}
|
64
|
+
@implicitly_returns_nil = implicitly_returns_nil
|
64
65
|
end
|
65
66
|
|
66
67
|
def shape(type, config)
|
@@ -826,6 +827,8 @@ module Steep
|
|
826
827
|
end
|
827
828
|
|
828
829
|
def add_implicitly_returns_nil(annotations, method_type)
|
830
|
+
return method_type unless implicitly_returns_nil
|
831
|
+
|
829
832
|
if annotations.find { _1.string == "implicitly-returns-nil" }
|
830
833
|
return_type = method_type.type.return_type
|
831
834
|
method_type = method_type.with(
|
data/lib/steep/project/dsl.rb
CHANGED
@@ -119,6 +119,7 @@ module Steep
|
|
119
119
|
attr_reader :project
|
120
120
|
attr_reader :unreferenced
|
121
121
|
attr_reader :groups
|
122
|
+
attr_reader :implicitly_returns_nil
|
122
123
|
|
123
124
|
def initialize(name, project:)
|
124
125
|
@name = name
|
@@ -127,6 +128,7 @@ module Steep
|
|
127
128
|
@project = project
|
128
129
|
@collection_config_path = collection_config_path
|
129
130
|
@unreferenced = false
|
131
|
+
@implicitly_returns_nil = false
|
130
132
|
@groups = []
|
131
133
|
end
|
132
134
|
|
@@ -144,6 +146,7 @@ module Steep
|
|
144
146
|
@project = other.project
|
145
147
|
@collection_config_path = other.collection_config_path
|
146
148
|
@unreferenced = other.unreferenced
|
149
|
+
@implicitly_returns_nil = other.implicitly_returns_nil
|
147
150
|
@groups = other.groups.dup
|
148
151
|
end
|
149
152
|
|
@@ -151,6 +154,10 @@ module Steep
|
|
151
154
|
@unreferenced = value
|
152
155
|
end
|
153
156
|
|
157
|
+
def implicitly_returns_nil!(value = true)
|
158
|
+
@implicitly_returns_nil = value
|
159
|
+
end
|
160
|
+
|
154
161
|
def configure_code_diagnostics(hash = nil)
|
155
162
|
if hash
|
156
163
|
code_diagnostics_config.merge!(hash)
|
@@ -245,7 +252,8 @@ module Steep
|
|
245
252
|
options: dsl.library_configured? ? dsl.to_library_options : nil,
|
246
253
|
code_diagnostics_config: dsl.code_diagnostics_config,
|
247
254
|
project: project,
|
248
|
-
unreferenced: dsl.unreferenced
|
255
|
+
unreferenced: dsl.unreferenced,
|
256
|
+
implicitly_returns_nil: dsl.implicitly_returns_nil
|
249
257
|
)
|
250
258
|
|
251
259
|
dsl.groups.each do
|
data/lib/steep/project/target.rb
CHANGED
@@ -10,8 +10,9 @@ module Steep
|
|
10
10
|
attr_reader :project
|
11
11
|
attr_reader :unreferenced
|
12
12
|
attr_reader :groups
|
13
|
+
attr_reader :implicitly_returns_nil
|
13
14
|
|
14
|
-
def initialize(name:, options:, source_pattern:, signature_pattern:, code_diagnostics_config:, project:, unreferenced:)
|
15
|
+
def initialize(name:, options:, source_pattern:, signature_pattern:, code_diagnostics_config:, project:, unreferenced:, implicitly_returns_nil:)
|
15
16
|
@name = name
|
16
17
|
@target_options = options
|
17
18
|
@source_pattern = source_pattern
|
@@ -20,6 +21,7 @@ module Steep
|
|
20
21
|
@project = project
|
21
22
|
@unreferenced = unreferenced
|
22
23
|
@groups = []
|
24
|
+
@implicitly_returns_nil = implicitly_returns_nil
|
23
25
|
end
|
24
26
|
|
25
27
|
def options
|
@@ -185,7 +185,7 @@ module Steep
|
|
185
185
|
loader = Services::FileLoader.new(base_dir: project.base_dir)
|
186
186
|
|
187
187
|
project.targets.each do |target|
|
188
|
-
signature_service = Services::SignatureService.load_from(target.new_env_loader())
|
188
|
+
signature_service = Services::SignatureService.load_from(target.new_env_loader(), implicitly_returns_nil: target.implicitly_returns_nil)
|
189
189
|
files.add_library_path(target, *signature_service.env_rbs_paths.to_a)
|
190
190
|
end
|
191
191
|
|
@@ -48,17 +48,18 @@ module Steep
|
|
48
48
|
end
|
49
49
|
|
50
50
|
class LoadedStatus
|
51
|
-
attr_reader :files, :builder
|
51
|
+
attr_reader :files, :builder, :implicitly_returns_nil
|
52
52
|
|
53
|
-
def initialize(files:, builder:)
|
53
|
+
def initialize(files:, builder:, implicitly_returns_nil:)
|
54
54
|
@files = files
|
55
55
|
@builder = builder
|
56
|
+
@implicitly_returns_nil = implicitly_returns_nil
|
56
57
|
end
|
57
58
|
|
58
59
|
def subtyping
|
59
60
|
@subtyping ||= begin
|
60
61
|
factory = AST::Types::Factory.new(builder: builder)
|
61
|
-
interface_builder = Interface::Builder.new(factory)
|
62
|
+
interface_builder = Interface::Builder.new(factory, implicitly_returns_nil: implicitly_returns_nil)
|
62
63
|
Subtyping::Check.new(builder: interface_builder)
|
63
64
|
end
|
64
65
|
end
|
@@ -77,14 +78,17 @@ module Steep
|
|
77
78
|
|
78
79
|
FileStatus = _ = Struct.new(:path, :content, :signature, keyword_init: true)
|
79
80
|
|
80
|
-
|
81
|
+
attr_reader :implicitly_returns_nil
|
82
|
+
|
83
|
+
def initialize(env:, implicitly_returns_nil:)
|
81
84
|
builder = RBS::DefinitionBuilder.new(env: env)
|
82
|
-
@status = LoadedStatus.new(builder: builder, files: {})
|
85
|
+
@status = LoadedStatus.new(builder: builder, files: {}, implicitly_returns_nil: implicitly_returns_nil)
|
86
|
+
@implicitly_returns_nil = implicitly_returns_nil
|
83
87
|
end
|
84
88
|
|
85
|
-
def self.load_from(loader)
|
89
|
+
def self.load_from(loader, implicitly_returns_nil:)
|
86
90
|
env = RBS::Environment.from_loader(loader).resolve_type_names
|
87
|
-
new(env: env)
|
91
|
+
new(env: env, implicitly_returns_nil: implicitly_returns_nil)
|
88
92
|
end
|
89
93
|
|
90
94
|
def env_rbs_paths
|
@@ -222,7 +226,7 @@ module Steep
|
|
222
226
|
)
|
223
227
|
when RBS::DefinitionBuilder::AncestorBuilder
|
224
228
|
builder2 = update_builder(ancestor_builder: result, paths: paths)
|
225
|
-
LoadedStatus.new(builder: builder2, files: files)
|
229
|
+
LoadedStatus.new(builder: builder2, files: files, implicitly_returns_nil: implicitly_returns_nil)
|
226
230
|
end
|
227
231
|
end
|
228
232
|
end
|
@@ -82,7 +82,7 @@ module Steep
|
|
82
82
|
@source_files = {}
|
83
83
|
@signature_services = project.targets.each.with_object({}) do |target, hash| #$ Hash[Symbol, SignatureService]
|
84
84
|
loader = Project::Target.construct_env_loader(options: target.options, project: project)
|
85
|
-
hash[target.name] = SignatureService.load_from(loader)
|
85
|
+
hash[target.name] = SignatureService.load_from(loader, implicitly_returns_nil: target.implicitly_returns_nil)
|
86
86
|
end
|
87
87
|
@signature_validation_diagnostics = project.targets.each.with_object({}) do |target, hash| #$ Hash[Symbol, Hash[Pathname, Array[Diagnostic::Signature::Base]]]
|
88
88
|
hash[target.name] = {}
|
data/lib/steep/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|