Skip to content

Commit 46b49c5

Browse files
authored
Merge pull request #2129 from ruby/dependabot/bundler/steep/multi-f10d3bcaf6
Bump rbs and steep in /steep
2 parents 797eafe + 974136e commit 46b49c5

File tree

17 files changed

+63
-51
lines changed

17 files changed

+63
-51
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ group :minitest do
4949
end
5050

5151
group :typecheck_test do
52-
gem "steep", "~> 1.8.0.pre", require: false
52+
gem "steep", require: false
5353
end

Gemfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@ GEM
4242
drb (2.2.1)
4343
ffi (1.17.0)
4444
ffi (1.17.0-x86_64-darwin)
45-
fileutils (1.7.2)
45+
fileutils (1.7.3)
4646
goodcheck (3.1.0)
4747
marcel (>= 1.0, < 2.0)
4848
psych (>= 3.1, < 5.0)
4949
rainbow (>= 3.0, < 4.0)
5050
strong_json (>= 1.1, < 2.2)
5151
i18n (1.14.6)
5252
concurrent-ruby (~> 1.0)
53-
json (2.8.2)
53+
json (2.9.0)
5454
json-schema (5.0.0)
5555
addressable (~> 2.8)
5656
language_server-protocol (3.17.0.3)
5757
listen (3.9.0)
5858
rb-fsevent (~> 0.10, >= 0.10.3)
5959
rb-inotify (~> 0.9, >= 0.9.10)
60-
logger (1.6.1)
60+
logger (1.6.2)
6161
marcel (1.0.4)
6262
memory_profiler (1.0.2)
63-
minitest (5.25.1)
63+
minitest (5.25.4)
6464
mutex_m (0.3.0)
6565
net-protocol (0.2.2)
6666
timeout
@@ -123,7 +123,7 @@ GEM
123123
ruby-progressbar (1.13.0)
124124
securerandom (0.4.0)
125125
stackprof (0.2.26)
126-
steep (1.8.3)
126+
steep (1.9.1)
127127
activesupport (>= 5.1)
128128
concurrent-ruby (>= 1.1.10)
129129
csv (>= 3.0.9)
@@ -134,7 +134,7 @@ GEM
134134
logger (>= 1.3.0)
135135
parser (>= 3.1)
136136
rainbow (>= 2.2.2, < 4.0)
137-
rbs (~> 3.6.0)
137+
rbs (~> 3.7.0)
138138
securerandom (>= 0.1)
139139
strscan (>= 1.0.0)
140140
terminal-table (>= 2, < 4)
@@ -185,7 +185,7 @@ DEPENDENCIES
185185
rubocop-on-rbs
186186
rubocop-rubycw
187187
stackprof
188-
steep (~> 1.8.0.pre)
188+
steep
189189
tempfile
190190
test-unit
191191

lib/rbs/annotate/rdoc_source.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def load
3131
end
3232

3333
def find_class(typename)
34-
classes = []
34+
classes = [] #: Array[::RDoc::ClassModule]
3535

3636
@stores.each do |store|
3737
if klass = store.find_class_or_module(typename.relative!.to_s)

lib/rbs/cli.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,11 @@ def run_prototype(args, options)
554554
when "rbi", "rb"
555555
run_prototype_file(format, args)
556556
when "runtime"
557-
require_libs = []
558-
relative_libs = []
557+
require_libs = [] #: Array[String]
558+
relative_libs = [] #: Array[String]
559559
merge = false
560560
todo = false
561-
owners_included = []
561+
owners_included = [] #: Array[Symbol]
562562
outline = false
563563
autoload = false
564564

@@ -591,7 +591,7 @@ def run_prototype(args, options)
591591
todo = true
592592
end
593593
opts.on("--method-owner CLASS", "Generate method prototypes if the owner of the method is [CLASS]") do |klass|
594-
owners_included << klass
594+
owners_included << klass.to_sym
595595
end
596596
opts.on("--outline", "Generates only module/class/constant declaration (no method definition)") do
597597
outline = true
@@ -615,9 +615,9 @@ def autoload(name, path)
615615
::Module.prepend(hook)
616616
::Kernel.prepend(hook)
617617

618-
arguments = []
618+
arguments = [] #: Array[[Module, interned]]
619619
TracePoint.new(:call) do |tp|
620-
base = tp.self.kind_of?(Module) ? tp.self : Kernel
620+
base = tp.self.kind_of?(Module) ? tp.self : Kernel #: Module
621621
name = (tp.binding or raise).local_variable_get(:name)
622622
arguments << [base, name]
623623
end.enable(target: hook.instance_method(:autoload), &block)
@@ -979,7 +979,7 @@ def run_annotate(args, options)
979979
end
980980

981981
def test_opt options
982-
opts = []
982+
opts = [] #: Array[String]
983983

984984
opts.push(*options.repos.map {|dir| "--repo #{Shellwords.escape(dir)}"})
985985
opts.push(*options.dirs.map {|dir| "-I #{Shellwords.escape(dir)}"})
@@ -1056,7 +1056,7 @@ def run_collection(args, options)
10561056
require 'bundler'
10571057

10581058
opts = collection_options(args)
1059-
params = {}
1059+
params = {} #: Hash[Symbol, untyped]
10601060
opts.order args.drop(1), into: params
10611061
config_path = options.config_path or raise
10621062
lock_path = Collection::Config.to_lockfile_path(config_path)

lib/rbs/cli/diff.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def initialize(argv:, library_options:, stdout: $stdout, stderr: $stderr)
1111
# @type var type_name: String?
1212
type_name = nil
1313
library_options = library_options
14-
before_path = []
15-
after_path = []
14+
before_path = [] #: Array[String]
15+
after_path = [] #: Array[String]
1616
detail = false
1717

1818
opt = OptionParser.new do |o|

lib/rbs/collection/config.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ def sources
7272
end
7373

7474
def gems
75-
@data['gems'] ||= []
75+
@data['gems'] ||= (
76+
[] #: Array[gem_entry]
77+
)
7678
end
7779
end
7880
end

lib/rbs/definition_builder/ancestor_builder.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def one_instance_ancestors(type_name)
209209
super_args = super_class.args
210210
else
211211
super_name = BuiltinNames::Object.name
212-
super_args = []
212+
super_args = [] #: Array[Types::t]
213213
end
214214

215215
super_name = env.normalize_module_name(super_name)
@@ -525,7 +525,7 @@ def singleton_ancestors(type_name, building_ancestors: [])
525525

526526
one_ancestors = one_singleton_ancestors(type_name)
527527

528-
ancestors = []
528+
ancestors = [] #: Array[Definition::Ancestor::t]
529529

530530
case super_class = one_ancestors.super_class
531531
when Definition::Ancestor::Instance
@@ -581,7 +581,7 @@ def interface_ancestors(type_name, building_ancestors: [])
581581
building_ancestors.push self_ancestor
582582

583583
one_ancestors = one_interface_ancestors(type_name)
584-
ancestors = []
584+
ancestors = [] #: Array[Definition::Ancestor::t]
585585

586586
included_interfaces = one_ancestors.included_interfaces or raise
587587
included_interfaces.each do |a|

lib/rbs/environment_loader.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Library < Struct.new(:name, :version, keyword_init: true)
2626
DEFAULT_CORE_ROOT = Pathname(_ = __dir__) + "../../core"
2727

2828
def self.gem_sig_path(name, version)
29-
requirements = []
29+
requirements = [] #: Array[String]
3030
requirements << version if version
3131
spec = Gem::Specification.find_by_name(name, *requirements)
3232
path = Pathname(spec.gem_dir) + "sig"

lib/rbs/parser_aux.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def self.buffer(source)
7070
untyped
7171
true
7272
false
73-
).each_with_object({}) do |keyword, hash|
74-
hash[keyword] = nil
73+
).each_with_object({}) do |keyword, hash| #$ Hash[String, bot]
74+
hash[keyword] = _ = nil
7575
end
7676
end
7777
end

lib/rbs/prototype/rb.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def decls
7575
def parse(string)
7676
# @type var comments: Hash[Integer, AST::Comment]
7777
comments = Ripper.lex(string).yield_self do |tokens|
78-
code_lines = {}
79-
tokens.each.with_object({}) do |token, hash|
78+
code_lines = {} #: Hash[Integer, bool]
79+
tokens.each.with_object({}) do |token, hash| #$ Hash[Integer, AST::Comment]
8080
case token[1]
8181
when :on_sp, :on_ignored_nl
8282
# skip
@@ -643,11 +643,11 @@ def literal_to_type(node)
643643
children = list.children
644644
children.pop
645645
else
646-
children = []
646+
children = [] #: Array[untyped]
647647
end
648648

649-
key_types = []
650-
value_types = []
649+
key_types = [] #: Array[Types::t]
650+
value_types = [] #: Array[Types::t]
651651
children.each_slice(2) do |k, v|
652652
if k
653653
key_types << literal_to_type(k)
@@ -659,7 +659,10 @@ def literal_to_type(node)
659659
end
660660

661661
if !key_types.empty? && key_types.all? { |t| t.is_a?(Types::Literal) }
662-
fields = key_types.map { |t| t.literal }.zip(value_types).to_h
662+
fields = key_types.map {|t|
663+
t.is_a?(Types::Literal) or raise
664+
t.literal
665+
}.zip(value_types).to_h #: Hash[Types::Literal::literal, Types::t]
663666
Types::Record.new(fields: fields, location: nil)
664667
else
665668
key_type = types_to_union_type(key_types)

0 commit comments

Comments
 (0)