steep 1.9.1 → 1.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 522d134347810d1fbb030d139f616077fcc197aabe079bf14453305c9c9562bd
4
- data.tar.gz: bd6a1a97a815c02ba20160d6bc1bd2166c1a02cdee3901c2a84fca2fe1b22d0b
3
+ metadata.gz: 02b4d30c83adaf9c3784371edd9f014f772273cec3ea72e9befeb3d882a897c6
4
+ data.tar.gz: 1146ee79d9b908d96f3079de416ba2d10b43e8b2a32ee440d4a2b7519a29558c
5
5
  SHA512:
6
- metadata.gz: 254fb6ef3b682ea7866e2892755e183bcd8ed797f4209faf999f40cdcb140a67083c73684ba80273cbf2e563650a2213114c474a2e0d3e50cc6d0cdc5d05caf0
7
- data.tar.gz: b5daeab25121a44e5e9ad4a353de77115f7f626c0f5ac9342c1fe0ac061eabf75cbf3fef26a3b651d0b4849a0c05d5c1eafe9027f72294af0974f7b051f9eb71
6
+ metadata.gz: 23ab3d323a5395ab7fe9ac37c98c657c780a949637ff4126ea2b0c320f27031fba615239eeaeaa028409cbf9b22dc1016c4299c31a545b387bec61785321a3fa
7
+ data.tar.gz: 6e94877bc417d187f49f7f8dc105058835785146ad4172d7d98751e790ea05b42f191db588a516fb0151949f68664a16c5ddb2a6220915613cc98f1be824ab0f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.9.3 (2024-12-26)
4
+
5
+ ### Miscellaneous
6
+
7
+ * Steep 1.9.1 ([#1398](https://github.com/soutaro/steep/pull/1398))
8
+ * Update rbs ([#1443](https://github.com/soutaro/steep/pull/1443))
9
+
10
+ ## 1.9.2 (2024-12-16)
11
+
12
+ ### Type checker core
13
+
14
+ * Attach type assertion to keyword args ([#1410](https://github.com/soutaro/steep/pull/1410))
15
+
16
+ ### Miscellaneous
17
+
18
+ * deps: Add uri gem to dependencies list ([#1402](https://github.com/soutaro/steep/pull/1402))
19
+
3
20
  ## 1.9.1 (2024-12-09)
4
21
 
5
22
  ### Type checker core
data/Steepfile CHANGED
@@ -1,3 +1,5 @@
1
+ require "fileutils"
2
+
1
3
  D = Steep::Diagnostic
2
4
 
3
5
  FileUtils.mkpath("tmp")
@@ -23,6 +25,8 @@ target :app do
23
25
  signature "sig"
24
26
  ignore_signature "sig/test"
25
27
 
28
+ implicitly_returns_nil!
29
+
26
30
  configure_code_diagnostics(D::Ruby.strict) do |hash|
27
31
  end
28
32
 
@@ -37,6 +41,7 @@ target :test do
37
41
  collection_config "rbs_collection.steep.yaml"
38
42
 
39
43
  unreferenced!
44
+ implicitly_returns_nil!
40
45
 
41
46
  check "test"
42
47
  signature "sig/test"
@@ -52,6 +57,7 @@ end
52
57
 
53
58
  target :bin do
54
59
  unreferenced!
60
+ implicitly_returns_nil!
55
61
 
56
62
  collection_config "rbs_collection.steep.yaml"
57
63
 
@@ -104,7 +104,7 @@ module Steep
104
104
  name = match[:name] or raise
105
105
  type = parse_type(match, location: location)
106
106
 
107
- AST::Annotation::ConstType.new(name: TypeName(name), type: type, location: location)
107
+ AST::Annotation::ConstType.new(name: RBS::TypeName.parse(name), type: type, location: location)
108
108
  end
109
109
 
110
110
  when keyword_subject_type("ivar", IVAR_NAME)
@@ -184,7 +184,7 @@ module Steep
184
184
  when /@implements\s+(?<name>#{CONST_NAME})#{TYPE_PARAMS}$/
185
185
  Regexp.last_match.yield_self do |match|
186
186
  match or raise
187
- type_name = TypeName(match[:name] || raise)
187
+ type_name = RBS::TypeName.parse(match[:name] || raise)
188
188
  params = match[:params]&.yield_self {|params| params.split(/,/).map {|param| param.strip.to_sym } } || []
189
189
 
190
190
  name = AST::Annotation::Implements::Module.new(name: type_name, args: params)
@@ -6,7 +6,7 @@ module Steep
6
6
  attr_reader :arity
7
7
 
8
8
  def initialize(module_name, arity: 0)
9
- @module_name = TypeName(module_name)
9
+ @module_name = RBS::TypeName.parse(module_name)
10
10
  @arity = arity
11
11
  end
12
12
 
@@ -786,7 +786,7 @@ module Steep
786
786
  RBS::BuiltinNames::Symbol.name,
787
787
  RBS::BuiltinNames::TrueClass.name,
788
788
  RBS::BuiltinNames::FalseClass.name,
789
- TypeName("::NilClass")
789
+ RBS::TypeName.parse("::NilClass")
790
790
  # Value based type-case works on literal types which is available for String, Integer, Symbol, TrueClass, FalseClass, and NilClass
791
791
  return method_type.with(
792
792
  type: method_type.type.with(
@@ -828,7 +828,7 @@ module Steep
828
828
 
829
829
  def add_implicitly_returns_nil(annotations, method_type)
830
830
  return method_type unless implicitly_returns_nil
831
-
831
+
832
832
  if annotations.find { _1.string == "implicitly-returns-nil" }
833
833
  return_type = method_type.type.return_type
834
834
  method_type = method_type.with(
@@ -62,7 +62,7 @@ module Steep
62
62
  end
63
63
 
64
64
  def to_s
65
- buf = ""
65
+ buf = +""
66
66
 
67
67
  if unchecked
68
68
  buf << "unchecked "
@@ -28,12 +28,12 @@ module Steep
28
28
  type_name, method_name = string.split(/#/, 2)
29
29
  type_name or raise
30
30
  method_name or raise
31
- InstanceMethodName.new(type_name: TypeName(type_name), method_name: method_name.to_sym)
31
+ InstanceMethodName.new(type_name: RBS::TypeName.parse(type_name), method_name: method_name.to_sym)
32
32
  when /\./
33
33
  type_name, method_name = string.split(/\./, 2)
34
34
  type_name or raise
35
35
  method_name or raise
36
- SingletonMethodName.new(type_name: TypeName(type_name), method_name: method_name.to_sym)
36
+ SingletonMethodName.new(type_name: RBS::TypeName.parse(type_name), method_name: method_name.to_sym)
37
37
  else
38
38
  raise "Unexpected method name: #{string}"
39
39
  end
@@ -361,7 +361,7 @@ module Steep
361
361
  "#{name}"
362
362
  else
363
363
  ps = params.each.map do |param|
364
- s = ""
364
+ s = +""
365
365
  if param.unchecked?
366
366
  s << "unchecked "
367
367
  end
data/lib/steep/source.rb CHANGED
@@ -496,6 +496,14 @@ module Steep
496
496
  # Skip
497
497
  when :def, :defs
498
498
  # Skip
499
+ when :kwargs
500
+ # skip
501
+ when :pair
502
+ key, value = node.children
503
+ key = insert_type_node(key, comments.except(last_line))
504
+ value = insert_type_node(value, comments)
505
+ node = node.updated(nil, [key, value])
506
+ return adjust_location(node)
499
507
  when :masgn
500
508
  lhs, rhs = node.children
501
509
  node = node.updated(nil, [lhs, insert_type_node(rhs, comments)])
@@ -1385,10 +1385,10 @@ module Steep
1385
1385
  add_typing(node, type: AST::Builtin::Float.instance_type)
1386
1386
 
1387
1387
  when :rational
1388
- add_typing(node, type: AST::Types::Name::Instance.new(name: TypeName("::Rational"), args: []))
1388
+ add_typing(node, type: AST::Types::Name::Instance.new(name: RBS::TypeName.parse("::Rational"), args: []))
1389
1389
 
1390
1390
  when :complex
1391
- add_typing(node, type: AST::Types::Name::Instance.new(name: TypeName("::Complex"), args: []))
1391
+ add_typing(node, type: AST::Types::Name::Instance.new(name: RBS::TypeName.parse("::Complex"), args: []))
1392
1392
 
1393
1393
  when :nil
1394
1394
  add_typing(node, type: AST::Builtin.nil_type)
data/lib/steep/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Steep
2
- VERSION = "1.9.1"
2
+ VERSION = "1.9.3"
3
3
  end
data/steep.gemspec CHANGED
@@ -42,7 +42,7 @@ Gem::Specification.new do |spec|
42
42
  spec.add_runtime_dependency "rainbow", ">= 2.2.2", "< 4.0"
43
43
  spec.add_runtime_dependency "listen", "~> 3.0"
44
44
  spec.add_runtime_dependency "language_server-protocol", ">= 3.15", "< 4.0"
45
- spec.add_runtime_dependency "rbs", "~> 3.7.0"
45
+ spec.add_runtime_dependency "rbs", "~> 3.8"
46
46
  spec.add_runtime_dependency "concurrent-ruby", ">= 1.1.10"
47
47
  spec.add_runtime_dependency "terminal-table", ">= 2", "< 4"
48
48
  spec.add_runtime_dependency "securerandom", ">= 0.1"
@@ -51,4 +51,5 @@ Gem::Specification.new do |spec|
51
51
  spec.add_runtime_dependency "fileutils", ">= 1.1.0"
52
52
  spec.add_runtime_dependency "strscan", ">= 1.0.0"
53
53
  spec.add_runtime_dependency "csv", ">= 3.0.9"
54
+ spec.add_runtime_dependency "uri", ">= 0.12.0"
54
55
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-09 00:00:00.000000000 Z
10
+ date: 2024-12-26 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: parser
@@ -98,14 +97,14 @@ dependencies:
98
97
  requirements:
99
98
  - - "~>"
100
99
  - !ruby/object:Gem::Version
101
- version: 3.7.0
100
+ version: '3.8'
102
101
  type: :runtime
103
102
  prerelease: false
104
103
  version_requirements: !ruby/object:Gem::Requirement
105
104
  requirements:
106
105
  - - "~>"
107
106
  - !ruby/object:Gem::Version
108
- version: 3.7.0
107
+ version: '3.8'
109
108
  - !ruby/object:Gem::Dependency
110
109
  name: concurrent-ruby
111
110
  requirement: !ruby/object:Gem::Requirement
@@ -224,6 +223,20 @@ dependencies:
224
223
  - - ">="
225
224
  - !ruby/object:Gem::Version
226
225
  version: 3.0.9
226
+ - !ruby/object:Gem::Dependency
227
+ name: uri
228
+ requirement: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - ">="
231
+ - !ruby/object:Gem::Version
232
+ version: 0.12.0
233
+ type: :runtime
234
+ prerelease: false
235
+ version_requirements: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ version: 0.12.0
227
240
  description: Gradual Typing for Ruby
228
241
  email:
229
242
  - matsumoto@soutaro.com
@@ -401,7 +414,6 @@ metadata:
401
414
  homepage_uri: https://github.com/soutaro/steep
402
415
  source_code_uri: https://github.com/soutaro/steep
403
416
  changelog_uri: https://github.com/soutaro/steep/blob/master/CHANGELOG.md
404
- post_install_message:
405
417
  rdoc_options: []
406
418
  require_paths:
407
419
  - lib
@@ -416,8 +428,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
416
428
  - !ruby/object:Gem::Version
417
429
  version: '0'
418
430
  requirements: []
419
- rubygems_version: 3.5.22
420
- signing_key:
431
+ rubygems_version: 3.6.2
421
432
  specification_version: 4
422
433
  summary: Gradual Typing for Ruby
423
434
  test_files: []