diff --git a/Gemfile.lock b/Gemfile.lock index 3d6804f9e..753f7bc7f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,8 +51,8 @@ GEM racc (1.7.3) rainbow (3.1.1) rake (13.2.1) - rbi (0.1.10) - prism (>= 0.18.0, < 0.25) + rbi (0.1.11) + prism (>= 0.18.0, < 0.27) sorbet-runtime (>= 0.5.9204) regexp_parser (2.9.0) reline (0.5.0) @@ -88,14 +88,14 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sorbet (0.5.11346) - sorbet-static (= 0.5.11346) - sorbet-runtime (0.5.11346) - sorbet-static (0.5.11346-universal-darwin) - sorbet-static (0.5.11346-x86_64-linux) - sorbet-static-and-runtime (0.5.11346) - sorbet (= 0.5.11346) - sorbet-runtime (= 0.5.11346) + sorbet (0.5.11352) + sorbet-static (= 0.5.11352) + sorbet-runtime (0.5.11352) + sorbet-static (0.5.11352-universal-darwin) + sorbet-static (0.5.11352-x86_64-linux) + sorbet-static-and-runtime (0.5.11352) + sorbet (= 0.5.11352) + sorbet-runtime (= 0.5.11352) spoom (1.3.0) erubi (>= 1.10.0) prism (>= 0.19.0) @@ -104,7 +104,7 @@ GEM stringio (3.1.0) syntax_tree (6.2.0) prettier_print (>= 1.2.0) - tapioca (0.13.2) + tapioca (0.13.3) bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) diff --git a/sorbet/rbi/gems/json@2.7.1.rbi b/sorbet/rbi/gems/json@2.7.2.rbi similarity index 94% rename from sorbet/rbi/gems/json@2.7.1.rbi rename to sorbet/rbi/gems/json@2.7.2.rbi index e22ce040e..3ef0f88c7 100644 --- a/sorbet/rbi/gems/json@2.7.1.rbi +++ b/sorbet/rbi/gems/json@2.7.2.rbi @@ -6,7 +6,7 @@ # Extends any Class to include _json_creatable?_ method. # -# source://json//lib/json/common.rb#689 +# source://json//lib/json/common.rb#690 class Class < ::Module # Returns true if this class can be used to create an instance # from a serialised JSON string. The class has to implement a class @@ -15,7 +15,7 @@ class Class < ::Module # # @return [Boolean] # - # source://json//lib/json/common.rb#694 + # source://json//lib/json/common.rb#695 def json_creatable?; end end @@ -630,7 +630,7 @@ module JSON # Output: # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} # - # source://json//lib/json/common.rb#614 + # source://json//lib/json/common.rb#615 def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end # :call-seq: @@ -647,13 +647,13 @@ module JSON # # Raises SystemStackError (stack level too deep): # JSON.fast_generate(a) # - # source://json//lib/json/common.rb#328 + # source://json//lib/json/common.rb#329 def fast_generate(obj, opts = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. # - # source://json//lib/json/common.rb#328 + # source://json//lib/json/common.rb#329 def fast_unparse(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -692,7 +692,7 @@ module JSON # # Raises JSON::NestingError (nesting of 100 is too deep): # JSON.generate(a) # - # source://json//lib/json/common.rb#299 + # source://json//lib/json/common.rb#300 def generate(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -823,7 +823,7 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json//lib/json/common.rb#540 + # source://json//lib/json/common.rb#541 def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # :call-seq: @@ -834,7 +834,7 @@ module JSON # # See method #parse. # - # source://json//lib/json/common.rb#248 + # source://json//lib/json/common.rb#249 def load_file(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -845,10 +845,10 @@ module JSON # # See method #parse! # - # source://json//lib/json/common.rb#259 + # source://json//lib/json/common.rb#260 def load_file!(filespec, opts = T.unsafe(nil)); end - # source://json//lib/json/common.rb#642 + # source://json//lib/json/common.rb#643 def merge_dump_options(opts, strict: T.unsafe(nil)); end # :call-seq: @@ -899,7 +899,7 @@ module JSON # # Raises JSON::ParserError (783: unexpected token at ''): # JSON.parse('') # - # source://json//lib/json/common.rb#218 + # source://json//lib/json/common.rb#219 def parse(source, opts = T.unsafe(nil)); end # :call-seq: @@ -914,7 +914,7 @@ module JSON # which disables checking for nesting depth. # - Option +allow_nan+, if not provided, defaults to +true+. # - # source://json//lib/json/common.rb#233 + # source://json//lib/json/common.rb#234 def parse!(source, opts = T.unsafe(nil)); end # :call-seq: @@ -947,28 +947,28 @@ module JSON # } # } # - # source://json//lib/json/common.rb#373 + # source://json//lib/json/common.rb#374 def pretty_generate(obj, opts = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. # - # source://json//lib/json/common.rb#373 + # source://json//lib/json/common.rb#374 def pretty_unparse(obj, opts = T.unsafe(nil)); end # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_ # - # source://json//lib/json/common.rb#558 + # source://json//lib/json/common.rb#559 def recurse_proc(result, &proc); end - # source://json//lib/json/common.rb#540 + # source://json//lib/json/common.rb#541 def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and # later delete them. # - # source://json//lib/json/common.rb#299 + # source://json//lib/json/common.rb#300 def unparse(obj, opts = T.unsafe(nil)); end class << self @@ -984,26 +984,26 @@ module JSON # ruby = [0, 1, nil] # JSON[ruby] # => '[0,1,null]' # - # source://json//lib/json/common.rb#21 + # source://json//lib/json/common.rb#22 def [](object, opts = T.unsafe(nil)); end - # source://json//lib/json/common.rb#84 + # source://json//lib/json/common.rb#85 def create_fast_state; end # Returns the current create identifier. # See also JSON.create_id=. # - # source://json//lib/json/common.rb#129 + # source://json//lib/json/common.rb#130 def create_id; end # Sets create identifier, which is used to decide if the _json_create_ # hook of a class should be called; initial value is +json_class+: # JSON.create_id # => 'json_class' # - # source://json//lib/json/common.rb#123 + # source://json//lib/json/common.rb#124 def create_id=(new_value); end - # source://json//lib/json/common.rb#94 + # source://json//lib/json/common.rb#95 def create_pretty_state; end # Return the constant located at _path_. The format of _path_ has to be @@ -1011,7 +1011,7 @@ module JSON # level (absolute namespace path?). If there doesn't exist a constant at # the given path, an ArgumentError is raised. # - # source://json//lib/json/common.rb#45 + # source://json//lib/json/common.rb#46 def deep_const_get(path); end # :call-seq: @@ -1042,7 +1042,7 @@ module JSON # Output: # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} # - # source://json//lib/json/common.rb#614 + # source://json//lib/json/common.rb#615 def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end # Sets or returns the default options for the JSON.dump method. @@ -1050,7 +1050,7 @@ module JSON # opts = JSON.dump_default_options # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false} # - # source://json//lib/json/common.rb#579 + # source://json//lib/json/common.rb#580 def dump_default_options; end # Sets or returns the default options for the JSON.dump method. @@ -1058,7 +1058,7 @@ module JSON # opts = JSON.dump_default_options # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false} # - # source://json//lib/json/common.rb#579 + # source://json//lib/json/common.rb#580 def dump_default_options=(_arg0); end # :call-seq: @@ -1075,13 +1075,13 @@ module JSON # # Raises SystemStackError (stack level too deep): # JSON.fast_generate(a) # - # source://json//lib/json/common.rb#328 + # source://json//lib/json/common.rb#329 def fast_generate(obj, opts = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. # - # source://json//lib/json/common.rb#328 + # source://json//lib/json/common.rb#329 def fast_unparse(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -1120,24 +1120,24 @@ module JSON # # Raises JSON::NestingError (nesting of 100 is too deep): # JSON.generate(a) # - # source://json//lib/json/common.rb#299 + # source://json//lib/json/common.rb#300 def generate(obj, opts = T.unsafe(nil)); end # Returns the JSON generator module that is used by JSON. This is # either JSON::Ext::Generator or JSON::Pure::Generator: # JSON.generator # => JSON::Ext::Generator # - # source://json//lib/json/common.rb#106 + # source://json//lib/json/common.rb#107 def generator; end # Set the module _generator_ to be used by JSON. # - # source://json//lib/json/common.rb#61 + # source://json//lib/json/common.rb#62 def generator=(generator); end # Encodes string using String.encode. # - # source://json//lib/json/common.rb#638 + # source://json//lib/json/common.rb#639 def iconv(to, from, string); end # :call-seq: @@ -1268,7 +1268,7 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json//lib/json/common.rb#540 + # source://json//lib/json/common.rb#541 def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # Sets or returns default options for the JSON.load method. @@ -1276,7 +1276,7 @@ module JSON # opts = JSON.load_default_options # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true} # - # source://json//lib/json/common.rb#403 + # source://json//lib/json/common.rb#404 def load_default_options; end # Sets or returns default options for the JSON.load method. @@ -1284,7 +1284,7 @@ module JSON # opts = JSON.load_default_options # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true} # - # source://json//lib/json/common.rb#403 + # source://json//lib/json/common.rb#404 def load_default_options=(_arg0); end # :call-seq: @@ -1295,7 +1295,7 @@ module JSON # # See method #parse. # - # source://json//lib/json/common.rb#248 + # source://json//lib/json/common.rb#249 def load_file(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -1306,7 +1306,7 @@ module JSON # # See method #parse! # - # source://json//lib/json/common.rb#259 + # source://json//lib/json/common.rb#260 def load_file!(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -1357,7 +1357,7 @@ module JSON # # Raises JSON::ParserError (783: unexpected token at ''): # JSON.parse('') # - # source://json//lib/json/common.rb#218 + # source://json//lib/json/common.rb#219 def parse(source, opts = T.unsafe(nil)); end # :call-seq: @@ -1372,19 +1372,19 @@ module JSON # which disables checking for nesting depth. # - Option +allow_nan+, if not provided, defaults to +true+. # - # source://json//lib/json/common.rb#233 + # source://json//lib/json/common.rb#234 def parse!(source, opts = T.unsafe(nil)); end # Returns the JSON parser class that is used by JSON. This is either # JSON::Ext::Parser or JSON::Pure::Parser: # JSON.parser # => JSON::Ext::Parser # - # source://json//lib/json/common.rb#32 + # source://json//lib/json/common.rb#33 def parser; end # Set the JSON parser class _parser_ to be used by JSON. # - # source://json//lib/json/common.rb#35 + # source://json//lib/json/common.rb#36 def parser=(parser); end # :call-seq: @@ -1417,123 +1417,123 @@ module JSON # } # } # - # source://json//lib/json/common.rb#373 + # source://json//lib/json/common.rb#374 def pretty_generate(obj, opts = T.unsafe(nil)); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and later delete them. # - # source://json//lib/json/common.rb#373 + # source://json//lib/json/common.rb#374 def pretty_unparse(obj, opts = T.unsafe(nil)); end # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_ # - # source://json//lib/json/common.rb#558 + # source://json//lib/json/common.rb#559 def recurse_proc(result, &proc); end - # source://json//lib/json/common.rb#540 + # source://json//lib/json/common.rb#541 def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # Sets or Returns the JSON generator state class that is used by JSON. This is # either JSON::Ext::Generator::State or JSON::Pure::Generator::State: # JSON.state # => JSON::Ext::Generator::State # - # source://json//lib/json/common.rb#111 + # source://json//lib/json/common.rb#112 def state; end # Sets or Returns the JSON generator state class that is used by JSON. This is # either JSON::Ext::Generator::State or JSON::Pure::Generator::State: # JSON.state # => JSON::Ext::Generator::State # - # source://json//lib/json/common.rb#111 + # source://json//lib/json/common.rb#112 def state=(_arg0); end # :stopdoc: # I want to deprecate these later, so I'll first be silent about them, and # later delete them. # - # source://json//lib/json/common.rb#299 + # source://json//lib/json/common.rb#300 def unparse(obj, opts = T.unsafe(nil)); end private - # source://json//lib/json/common.rb#642 + # source://json//lib/json/common.rb#643 def merge_dump_options(opts, strict: T.unsafe(nil)); end end end -# source://json//lib/json/common.rb#117 +# source://json//lib/json/common.rb#118 JSON::CREATE_ID_TLS_KEY = T.let(T.unsafe(nil), String) -# source://json//lib/json/common.rb#114 +# source://json//lib/json/common.rb#115 JSON::DEFAULT_CREATE_ID = T.let(T.unsafe(nil), String) -# source://json//lib/json/generic_object.rb#5 +# source://json//lib/json/generic_object.rb#9 class JSON::GenericObject < ::OpenStruct - # source://json//lib/json/generic_object.rb#63 + # source://json//lib/json/generic_object.rb#67 def as_json(*_arg0); end - # source://json//lib/json/generic_object.rb#47 + # source://json//lib/json/generic_object.rb#51 def to_hash; end - # source://json//lib/json/generic_object.rb#67 + # source://json//lib/json/generic_object.rb#71 def to_json(*a); end - # source://json//lib/json/generic_object.rb#59 + # source://json//lib/json/generic_object.rb#63 def |(other); end class << self - # source://json//lib/json/generic_object.rb#41 + # source://json//lib/json/generic_object.rb#45 def dump(obj, *args); end - # source://json//lib/json/generic_object.rb#21 + # source://json//lib/json/generic_object.rb#25 def from_hash(object); end # Sets the attribute json_creatable # # @param value the value to set the attribute json_creatable to. # - # source://json//lib/json/generic_object.rb#13 + # source://json//lib/json/generic_object.rb#17 def json_creatable=(_arg0); end # @return [Boolean] # - # source://json//lib/json/generic_object.rb#9 + # source://json//lib/json/generic_object.rb#13 def json_creatable?; end - # source://json//lib/json/generic_object.rb#15 + # source://json//lib/json/generic_object.rb#19 def json_create(data); end - # source://json//lib/json/generic_object.rb#36 + # source://json//lib/json/generic_object.rb#40 def load(source, proc = T.unsafe(nil), opts = T.unsafe(nil)); end end end # The base exception for JSON errors. # -# source://json//lib/json/common.rb#140 +# source://json//lib/json/common.rb#141 class JSON::JSONError < ::StandardError class << self - # source://json//lib/json/common.rb#141 + # source://json//lib/json/common.rb#142 def wrap(exception); end end end -# source://json//lib/json/common.rb#6 +# source://json//lib/json/common.rb#7 JSON::NOT_SET = T.let(T.unsafe(nil), Object) -# source://json//lib/json/common.rb#38 +# source://json//lib/json/common.rb#39 JSON::Parser = JSON::Ext::Parser -# source://json//lib/json/common.rb#76 +# source://json//lib/json/common.rb#77 JSON::State = JSON::Ext::Generator::State # For backwards compatibility # -# source://json//lib/json/common.rb#162 +# source://json//lib/json/common.rb#163 JSON::UnparserError = JSON::GeneratorError -# source://json//lib/json/common.rb#652 +# source://json//lib/json/common.rb#653 module Kernel private @@ -1544,18 +1544,18 @@ module Kernel # The _opts_ argument is passed through to generate/parse respectively. See # generate and parse for their documentation. # - # source://json//lib/json/common.rb#679 + # source://json//lib/json/common.rb#680 def JSON(object, *args); end # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in # one line. # - # source://json//lib/json/common.rb#657 + # source://json//lib/json/common.rb#658 def j(*objs); end # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with # indentation and over many lines. # - # source://json//lib/json/common.rb#666 + # source://json//lib/json/common.rb#667 def jj(*objs); end end diff --git a/sorbet/rbi/gems/mocha@2.1.0.rbi b/sorbet/rbi/gems/mocha@2.2.0.rbi similarity index 95% rename from sorbet/rbi/gems/mocha@2.1.0.rbi rename to sorbet/rbi/gems/mocha@2.2.0.rbi index 702e0fc36..513b1ce56 100644 --- a/sorbet/rbi/gems/mocha@2.1.0.rbi +++ b/sorbet/rbi/gems/mocha@2.2.0.rbi @@ -37,7 +37,7 @@ class Minitest::Test < ::Minitest::Runnable include ::Mocha::ParameterMatchers include ::Mocha::Hooks include ::Mocha::API - include ::Mocha::Integration::MiniTest::Adapter + include ::Mocha::Integration::Minitest::Adapter end # source://mocha//lib/mocha/version.rb#1 @@ -66,7 +66,7 @@ module Mocha end end -# Methods added to +Test::Unit::TestCase+, +MiniTest::Unit::TestCase+ or equivalent. +# Methods added to +Test::Unit::TestCase+, +Minitest::Unit::TestCase+ or equivalent. # The mock creation methods are {#mock}, {#stub} and {#stub_everything}, all of which return a #{Mock} # which can be further modified by {Mock#responds_like} and {Mock#responds_like_instance_of} methods, # both of which return a {Mock}, too, and can therefore, be chained to the original creation methods. @@ -100,7 +100,7 @@ module Mocha::API # # @example Using expected_methods_vs_return_values Hash to setup expectations. # def test_motor_starts_and_stops - # motor = mock('motor', :start => true, :stop => true) + # motor = mock('motor', start: true, stop: true) # assert motor.start # assert motor.stop # # an error will be raised unless both Motor#start and Motor#stop have been called @@ -115,7 +115,8 @@ module Mocha::API # Builds a new sequence which can be used to constrain the order in which expectations can occur. # - # Specify that an expected invocation must occur within a named {Sequence} by using {Expectation#in_sequence}. + # Specify that an expected invocation must occur within a named {Sequence} by calling {Expectation#in_sequence} + # on each expectation or by passing a block within which all expectations should be constrained by the {Sequence}. # # @example Ensure methods on egg are invoked in correct order. # breakfast = sequence('breakfast') @@ -135,10 +136,19 @@ module Mocha::API # # task_one.execute # task_two.execute + # @example Ensure methods on egg are invoked in the correct order using a block. + # egg = mock('egg') + # sequence('breakfast') do + # egg.expects(:crack) + # egg.expects(:fry) + # egg.expects(:eat) + # end + # @param name [String] name of sequence # @return [Sequence] a new sequence # @see Expectation#in_sequence + # @yield optional block within which expectations should be constrained by the sequence # - # source://mocha//lib/mocha/api.rb#159 + # source://mocha//lib/mocha/api.rb#170 def sequence(name); end # Builds a new state machine which can be used to constrain the order in which expectations can occur. @@ -161,19 +171,20 @@ module Mocha::API # radio.expects(:select_channel).with('BBC World Service').when(power.is('on')) # radio.expects(:adjust_volume).with(-5).when(power.is('on')) # radio.expects(:switch_off).then(power.is('off')) + # @param name [String] name of state machine # @return [StateMachine] a new state machine # @see Expectation#then # @see Expectation#when # @see StateMachine # - # source://mocha//lib/mocha/api.rb#188 + # source://mocha//lib/mocha/api.rb#207 def states(name); end # Builds a new mock object # # @example Using stubbed_methods_vs_return_values Hash to setup stubbed methods. # def test_motor_starts_and_stops - # motor = stub('motor', :start => true, :stop => true) + # motor = stub('motor', start: true, stop: true) # assert motor.start # assert motor.stop # # an error will not be raised even if either Motor#start or Motor#stop has not been called @@ -190,7 +201,7 @@ module Mocha::API # # @example Ignore invocations of irrelevant methods. # def test_motor_stops - # motor = stub_everything('motor', :stop => true) + # motor = stub_everything('motor', stop: true) # assert_nil motor.irrelevant_method_1 # => no error raised # assert_nil motor.irrelevant_method_2 # => no error raised # assert motor.stop @@ -873,16 +884,16 @@ class Mocha::Deprecation end end -# source://mocha//lib/mocha/detection/mini_test.rb#2 +# source://mocha//lib/mocha/detection/minitest.rb#2 module Mocha::Detection; end -# source://mocha//lib/mocha/detection/mini_test.rb#3 -module Mocha::Detection::MiniTest +# source://mocha//lib/mocha/detection/minitest.rb#3 +module Mocha::Detection::Minitest class << self - # source://mocha//lib/mocha/detection/mini_test.rb#4 + # source://mocha//lib/mocha/detection/minitest.rb#4 def testcase; end - # source://mocha//lib/mocha/detection/mini_test.rb#12 + # source://mocha//lib/mocha/detection/minitest.rb#12 def version; end end end @@ -1010,7 +1021,7 @@ class Mocha::Expectation # @private # - # source://mocha//lib/mocha/expectation.rb#698 + # source://mocha//lib/mocha/expectation.rb#704 def definition_location; end # @private @@ -1046,40 +1057,40 @@ class Mocha::Expectation # @private # - # source://mocha//lib/mocha/expectation.rb#674 + # source://mocha//lib/mocha/expectation.rb#680 def inspect; end # @private # @return [Boolean] # - # source://mocha//lib/mocha/expectation.rb#646 + # source://mocha//lib/mocha/expectation.rb#652 def invocations_allowed?; end # @private # - # source://mocha//lib/mocha/expectation.rb#656 + # source://mocha//lib/mocha/expectation.rb#662 def invoke(invocation); end # @private # @return [Boolean] # - # source://mocha//lib/mocha/expectation.rb#641 - def match?(invocation); end + # source://mocha//lib/mocha/expectation.rb#646 + def match?(invocation, ignoring_order: T.unsafe(nil)); end # @private # @return [Boolean] # - # source://mocha//lib/mocha/expectation.rb#636 + # source://mocha//lib/mocha/expectation.rb#641 def matches_method?(method_name); end # @private # - # source://mocha//lib/mocha/expectation.rb#691 + # source://mocha//lib/mocha/expectation.rb#697 def method_signature; end # @private # - # source://mocha//lib/mocha/expectation.rb#681 + # source://mocha//lib/mocha/expectation.rb#687 def mocha_inspect; end # Modifies expectation so that when the expected method is called, it yields multiple times per invocation with the specified +parameter_groups+. @@ -1146,6 +1157,11 @@ class Mocha::Expectation # source://mocha//lib/mocha/expectation.rb#97 def once; end + # @private + # + # source://mocha//lib/mocha/expectation.rb#636 + def ordering_constraints_not_allowing_invocation_now; end + # @private # # source://mocha//lib/mocha/expectation.rb#626 @@ -1153,6 +1169,10 @@ class Mocha::Expectation # Modifies expectation so that when the expected method is called, it raises the specified +exception+ with the specified +message+ i.e. calls +Kernel#raise(exception, message)+. # + # @example Raise specified exception if expected method is invoked. + # object = stub() + # object.stubs(:expected_method).raises(Exception, 'message') + # object.expected_method # => raises exception of class Exception and with message 'message' # @example Raise custom exception with extra constructor parameters by passing in an instance of the exception. # object = stub() # object.stubs(:expected_method).raises(MyException.new('message', 1, 2, 3)) @@ -1162,10 +1182,6 @@ class Mocha::Expectation # object.stubs(:expected_method).raises(Exception1).then.raises(Exception2) # object.expected_method # => raises exception of class Exception1 # object.expected_method # => raises exception of class Exception2 - # @example Raise specified exception if expected method is invoked. - # object = stub() - # object.stubs(:expected_method).raises(Exception, 'message') - # object.expected_method # => raises exception of class Exception and with message 'message' # @example Raise an exception on first invocation of expected method and then return values on subsequent invocations. # object = stub() # object.stubs(:expected_method).raises(Exception).then.returns(2, 3) @@ -1225,7 +1241,7 @@ class Mocha::Expectation # @private # @return [Boolean] # - # source://mocha//lib/mocha/expectation.rb#651 + # source://mocha//lib/mocha/expectation.rb#657 def satisfied?; end # @example Using {#then} as syntactic sugar when specifying values to be returned and exceptions to be raised on consecutive invocations of the expected method. @@ -1254,14 +1270,14 @@ class Mocha::Expectation # Modifies expectation so that when the expected method is called, it throws the specified +tag+ with the specific return value +object+ i.e. calls +Kernel#throw(tag, object)+. # - # @example Throw tag with return value +object+ c.f. +Kernel#throw+. - # object = stub() - # object.stubs(:expected_method).throws(:done, 'result') - # object.expected_method # => throws tag :done and causes catch block to return 'result' # @example Throw tag when expected method is invoked. # object = stub() # object.stubs(:expected_method).throws(:done) # object.expected_method # => throws tag :done + # @example Throw tag with return value +object+ c.f. +Kernel#throw+. + # object = stub() + # object.stubs(:expected_method).throws(:done, 'result') + # object.expected_method # => throws tag :done and causes catch block to return 'result' # @example Throw different tags on consecutive invocations of the expected method. # object = stub() # object.stubs(:expected_method).throws(:done).then.throws(:continue) @@ -1339,13 +1355,13 @@ class Mocha::Expectation # @private # @return [Boolean] # - # source://mocha//lib/mocha/expectation.rb#669 + # source://mocha//lib/mocha/expectation.rb#675 def used?; end # @private # @return [Boolean] # - # source://mocha//lib/mocha/expectation.rb#663 + # source://mocha//lib/mocha/expectation.rb#669 def verified?(assertion_counter = T.unsafe(nil)); end # Constrains the expectation to occur only when the +state_machine+ is in the state specified by +state_predicate+. @@ -1527,9 +1543,9 @@ class Mocha::ExpectationError < ::Exception; end # # This class should only be used by authors of test libraries and not by typical "users" of Mocha. # -# For example, it is used by +Mocha::Integration::MiniTest::Adapter+ in order to have Mocha raise a +MiniTest::Assertion+ which can then be sensibly handled by +MiniTest::Unit::TestCase+. +# For example, it is used by +Mocha::Integration::Minitest::Adapter+ in order to have Mocha raise a +Minitest::Assertion+ which can then be sensibly handled by +Minitest::Unit::TestCase+. # -# @see Mocha::Integration::MiniTest::Adapter +# @see Mocha::Integration::Minitest::Adapter # # source://mocha//lib/mocha/expectation_error_factory.rb#12 class Mocha::ExpectationErrorFactory @@ -1567,7 +1583,7 @@ class Mocha::ExpectationList # source://mocha//lib/mocha/expectation_list.rb#3 def initialize(expectations = T.unsafe(nil)); end - # source://mocha//lib/mocha/expectation_list.rb#48 + # source://mocha//lib/mocha/expectation_list.rb#52 def +(other); end # source://mocha//lib/mocha/expectation_list.rb#7 @@ -1575,18 +1591,21 @@ class Mocha::ExpectationList # @return [Boolean] # - # source://mocha//lib/mocha/expectation_list.rb#44 + # source://mocha//lib/mocha/expectation_list.rb#48 def any?; end - # source://mocha//lib/mocha/expectation_list.rb#40 + # source://mocha//lib/mocha/expectation_list.rb#44 def length; end # source://mocha//lib/mocha/expectation_list.rb#20 - def match(invocation); end + def match(invocation, ignoring_order: T.unsafe(nil)); end - # source://mocha//lib/mocha/expectation_list.rb#24 + # source://mocha//lib/mocha/expectation_list.rb#28 def match_allowing_invocation(invocation); end + # source://mocha//lib/mocha/expectation_list.rb#24 + def match_but_out_of_order(invocation); end + # @return [Boolean] # # source://mocha//lib/mocha/expectation_list.rb#16 @@ -1595,21 +1614,21 @@ class Mocha::ExpectationList # source://mocha//lib/mocha/expectation_list.rb#12 def remove_all_matching_method(method_name); end - # source://mocha//lib/mocha/expectation_list.rb#32 + # source://mocha//lib/mocha/expectation_list.rb#36 def to_a; end - # source://mocha//lib/mocha/expectation_list.rb#36 + # source://mocha//lib/mocha/expectation_list.rb#40 def to_set; end # @return [Boolean] # - # source://mocha//lib/mocha/expectation_list.rb#28 + # source://mocha//lib/mocha/expectation_list.rb#32 def verified?(assertion_counter = T.unsafe(nil)); end private - # source://mocha//lib/mocha/expectation_list.rb#54 - def matching_expectations(invocation); end + # source://mocha//lib/mocha/expectation_list.rb#58 + def matching_expectations(invocation, ignoring_order: T.unsafe(nil)); end end # Integration hooks for test library authors. @@ -1618,12 +1637,12 @@ end # # This module is provided as part of the +Mocha::API+ module and is therefore part of the public API, but should only be used by authors of test libraries and not by typical "users" of Mocha. # -# Integration with Test::Unit and MiniTest are provided as part of Mocha, because they are (or were once) part of the Ruby standard library. Integration with other test libraries is not provided as *part* of Mocha, but is supported by means of the methods in this module. +# Integration with Test::Unit and Minitest are provided as part of Mocha, because they are (or were once) part of the Ruby standard library. Integration with other test libraries is not provided as *part* of Mocha, but is supported by means of the methods in this module. # # See the code in the +Adapter+ modules for examples of how to use the methods in this module. +Mocha::ExpectationErrorFactory+ may be used if you want +Mocha+ to raise a different type of exception. # # @see Mocha::Integration::TestUnit::Adapter -# @see Mocha::Integration::MiniTest::Adapter +# @see Mocha::Integration::Minitest::Adapter # @see Mocha::ExpectationErrorFactory # @see Mocha::API # @@ -1641,7 +1660,13 @@ module Mocha::Hooks # This method should be called after each individual test has finished (including after any "teardown" code). # # source://mocha//lib/mocha/hooks.rb#38 - def mocha_teardown; end + def mocha_teardown(origin = T.unsafe(nil)); end + + # Returns a string representing the unit test name, to be included in some Mocha + # to help track down potential bugs. + # + # source://mocha//lib/mocha/hooks.rb#44 + def mocha_test_name; end # Verifies that all mock expectations have been met (only for use by authors of test libraries). # @@ -1752,55 +1777,60 @@ class Mocha::Integration::AssertionCounter def increment; end end -# source://mocha//lib/mocha/integration/mini_test/adapter.rb#7 -module Mocha::Integration::MiniTest +# source://mocha//lib/mocha/integration/minitest/adapter.rb#7 +module Mocha::Integration::Minitest class << self - # source://mocha//lib/mocha/integration/mini_test.rb#8 + # source://mocha//lib/mocha/integration/minitest.rb#8 def activate; end end end -# Integrates Mocha into recent versions of MiniTest. +# Integrates Mocha into recent versions of Minitest. # # See the source code for an example of how to integrate Mocha into a test library. # -# source://mocha//lib/mocha/integration/mini_test/adapter.rb#11 -module Mocha::Integration::MiniTest::Adapter +# source://mocha//lib/mocha/integration/minitest/adapter.rb#11 +module Mocha::Integration::Minitest::Adapter include ::Mocha::ParameterMatchers include ::Mocha::Hooks include ::Mocha::API # @private # - # source://mocha//lib/mocha/integration/mini_test/adapter.rb#45 + # source://mocha//lib/mocha/integration/minitest/adapter.rb#45 def after_teardown; end # @private # - # source://mocha//lib/mocha/integration/mini_test/adapter.rb#30 + # source://mocha//lib/mocha/integration/minitest/adapter.rb#30 def before_setup; end # @private # - # source://mocha//lib/mocha/integration/mini_test/adapter.rb#36 + # source://mocha//lib/mocha/integration/minitest/adapter.rb#36 def before_teardown; end + # @private + # + # source://mocha//lib/mocha/integration/minitest/adapter.rb#51 + def mocha_test_name; end + class << self # @private # @return [Boolean] # - # source://mocha//lib/mocha/integration/mini_test/adapter.rb#15 - def applicable_to?(mini_test_version); end + # source://mocha//lib/mocha/integration/minitest/adapter.rb#15 + def applicable_to?(minitest_version); end # @private # - # source://mocha//lib/mocha/integration/mini_test/adapter.rb#20 + # source://mocha//lib/mocha/integration/minitest/adapter.rb#20 def description; end # @private # @private # - # source://mocha//lib/mocha/integration/mini_test/adapter.rb#25 + # source://mocha//lib/mocha/integration/minitest/adapter.rb#25 def included(_mod); end end end @@ -1955,12 +1985,12 @@ class Mocha::Mock # @private # @return [Mock] a new instance of Mock # - # source://mocha//lib/mocha/mock.rb#273 + # source://mocha//lib/mocha/mock.rb#275 def initialize(mockery, name = T.unsafe(nil), receiver = T.unsafe(nil)); end # @private # - # source://mocha//lib/mocha/mock.rb#297 + # source://mocha//lib/mocha/mock.rb#299 def __expectations__; end # Adds an expectation that the specified method must be called exactly once with any parameters. @@ -1980,7 +2010,7 @@ class Mocha::Mock # object.expected_method # => error raised when expected method invoked second time # @example Setup multiple expectations using +expected_methods_vs_return_values+. # object = mock() - # object.expects(:expected_method_one => :result_one, :expected_method_two => :result_two) + # object.expects(expected_method_one: :result_one, expected_method_two: :result_two) # # # is exactly equivalent to # @@ -1997,7 +2027,7 @@ class Mocha::Mock # @private # # source://mocha//lib/mocha/mock.rb#346 - def __expire__; end + def __expire__(origin); end def __singleton_class__; end @@ -2011,7 +2041,7 @@ class Mocha::Mock # # no error raised # @example Setup multiple expectations using +stubbed_methods_vs_return_values+. # object = mock() - # object.stubs(:stubbed_method_one => :result_one, :stubbed_method_two => :result_two) + # object.stubs(stubbed_method_one: :result_one, stubbed_method_two: :result_two) # # # is exactly equivalent to # @@ -2022,7 +2052,7 @@ class Mocha::Mock # @overload stubs # @return [Expectation] last-built expectation which can be further modified by methods on {Expectation}. # - # source://mocha//lib/mocha/mock.rb#148 + # source://mocha//lib/mocha/mock.rb#149 def __stubs__(method_name_or_hash, backtrace = T.unsafe(nil)); end # @private @@ -2033,7 +2063,7 @@ class Mocha::Mock # @private # - # source://mocha//lib/mocha/mock.rb#307 + # source://mocha//lib/mocha/mock.rb#309 def all_expectations; end # @private @@ -2049,7 +2079,7 @@ class Mocha::Mock # @private # - # source://mocha//lib/mocha/mock.rb#285 + # source://mocha//lib/mocha/mock.rb#287 def everything_stubbed; end # Adds an expectation that the specified method must be called exactly once with any parameters. @@ -2069,7 +2099,7 @@ class Mocha::Mock # object.expected_method # => error raised when expected method invoked second time # @example Setup multiple expectations using +expected_methods_vs_return_values+. # object = mock() - # object.expects(:expected_method_one => :result_one, :expected_method_two => :result_two) + # object.expects(expected_method_one: :result_one, expected_method_two: :result_two) # # # is exactly equivalent to # @@ -2095,7 +2125,7 @@ class Mocha::Mock # @private # - # source://mocha//lib/mocha/mock.rb#313 + # source://mocha//lib/mocha/mock.rb#314 def method_missing(symbol, *arguments, **_arg2, &block); end # @private @@ -2150,7 +2180,7 @@ class Mocha::Mock # @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained. # @see #responds_like_instance_of # - # source://mocha//lib/mocha/mock.rb#235 + # source://mocha//lib/mocha/mock.rb#237 def quacks_like(responder); end # Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds publicly. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+. @@ -2181,7 +2211,7 @@ class Mocha::Mock # @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained. # @see #responds_like # - # source://mocha//lib/mocha/mock.rb#268 + # source://mocha//lib/mocha/mock.rb#270 def quacks_like_instance_of(responder_class); end # Constrains the {Mock} instance so that it can only expect or stub methods to which +responder+ responds publicly. The constraint is only applied at method invocation time. @@ -2231,7 +2261,7 @@ class Mocha::Mock # @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained. # @see #responds_like_instance_of # - # source://mocha//lib/mocha/mock.rb#235 + # source://mocha//lib/mocha/mock.rb#237 def responds_like(responder); end # Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds publicly. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+. @@ -2262,12 +2292,12 @@ class Mocha::Mock # @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained. # @see #responds_like # - # source://mocha//lib/mocha/mock.rb#268 + # source://mocha//lib/mocha/mock.rb#270 def responds_like_instance_of(responder_class); end # @private # - # source://mocha//lib/mocha/mock.rb#302 + # source://mocha//lib/mocha/mock.rb#304 def stub_everything; end # Adds an expectation that the specified method may be called any number of times with any parameters. @@ -2280,7 +2310,7 @@ class Mocha::Mock # # no error raised # @example Setup multiple expectations using +stubbed_methods_vs_return_values+. # object = mock() - # object.stubs(:stubbed_method_one => :result_one, :stubbed_method_two => :result_two) + # object.stubs(stubbed_method_one: :result_one, stubbed_method_two: :result_two) # # # is exactly equivalent to # @@ -2291,7 +2321,7 @@ class Mocha::Mock # @overload stubs # @return [Expectation] last-built expectation which can be further modified by methods on {Expectation}. # - # source://mocha//lib/mocha/mock.rb#148 + # source://mocha//lib/mocha/mock.rb#149 def stubs(method_name_or_hash, backtrace = T.unsafe(nil)); end # Removes the specified stubbed methods (added by calls to {#expects} or {#stubs}) and all expectations associated with them. @@ -2311,17 +2341,17 @@ class Mocha::Mock # multiplier.unstub(:triple) # @param method_names [Array] names of methods to unstub. # - # source://mocha//lib/mocha/mock.rb#180 + # source://mocha//lib/mocha/mock.rb#182 def unstub(*method_names); end private # @raise [StubbingError] # - # source://mocha//lib/mocha/mock.rb#389 + # source://mocha//lib/mocha/mock.rb#393 def check_expiry; end - # source://mocha//lib/mocha/mock.rb#383 + # source://mocha//lib/mocha/mock.rb#387 def check_responder_responds_to(symbol); end # source://mocha//lib/mocha/mock.rb#372 @@ -2336,17 +2366,17 @@ end # source://mocha//lib/mocha/mockery.rb#13 class Mocha::Mockery - # source://mocha//lib/mocha/mockery.rb#134 + # source://mocha//lib/mocha/mockery.rb#138 def logger; end # Sets the attribute logger # # @param value the value to set the attribute logger to. # - # source://mocha//lib/mocha/mockery.rb#132 + # source://mocha//lib/mocha/mockery.rb#136 def logger=(_arg0); end - # source://mocha//lib/mocha/mockery.rb#112 + # source://mocha//lib/mocha/mockery.rb#116 def mocha_inspect; end # source://mocha//lib/mocha/mockery.rb#66 @@ -2364,9 +2394,12 @@ class Mocha::Mockery # source://mocha//lib/mocha/mockery.rb#74 def new_state_machine(name); end - # source://mocha//lib/mocha/mockery.rb#120 + # source://mocha//lib/mocha/mockery.rb#124 def on_stubbing(object, method); end + # source://mocha//lib/mocha/mockery.rb#112 + def sequences; end + # source://mocha//lib/mocha/mockery.rb#108 def state_machines; end @@ -2374,7 +2407,7 @@ class Mocha::Mockery def stubba; end # source://mocha//lib/mocha/mockery.rb#94 - def teardown; end + def teardown(origin = T.unsafe(nil)); end # source://mocha//lib/mocha/mockery.rb#62 def unnamed_mock; end @@ -2384,27 +2417,27 @@ class Mocha::Mockery private - # source://mocha//lib/mocha/mockery.rb#161 + # source://mocha//lib/mocha/mockery.rb#165 def add_mock(mock); end - # source://mocha//lib/mocha/mockery.rb#166 + # source://mocha//lib/mocha/mockery.rb#170 def add_state_machine(state_machine); end # @raise [StubbingError] # - # source://mocha//lib/mocha/mockery.rb#140 + # source://mocha//lib/mocha/mockery.rb#144 def check(action, description, signature_proc, backtrace = T.unsafe(nil)); end - # source://mocha//lib/mocha/mockery.rb#149 + # source://mocha//lib/mocha/mockery.rb#153 def expectations; end - # source://mocha//lib/mocha/mockery.rb#171 + # source://mocha//lib/mocha/mockery.rb#175 def reset; end - # source://mocha//lib/mocha/mockery.rb#157 + # source://mocha//lib/mocha/mockery.rb#161 def satisfied_expectations; end - # source://mocha//lib/mocha/mockery.rb#153 + # source://mocha//lib/mocha/mockery.rb#157 def unsatisfied_expectations; end class << self @@ -2415,7 +2448,7 @@ class Mocha::Mockery def setup; end # source://mocha//lib/mocha/mockery.rb#51 - def teardown; end + def teardown(origin = T.unsafe(nil)); end # source://mocha//lib/mocha/mockery.rb#47 def verify(*args); end @@ -2477,7 +2510,7 @@ module Mocha::ObjectMethods # assert_equal true, product.save # @example Setting up multiple expectations on a non-mock object. # product = Product.new - # product.expects(:valid? => true, :save => true) + # product.expects(valid?: true, save: true) # # # exactly equivalent to # @@ -2528,7 +2561,7 @@ module Mocha::ObjectMethods # assert_equal true, product.save # @example Setting up multiple stubbed methods on a non-mock object. # product = Product.new - # product.stubs(:valid? => true, :save => true) + # product.stubs(valid?: true, save: true) # # # exactly equivalent to # @@ -2840,7 +2873,7 @@ module Mocha::ParameterMatchers # @example Actual parameter includes item which matches nested matcher. # object = mock() # object.expects(:method_1).with(includes(has_key(:key))) - # object.method_1(['foo', 'bar', {:key => 'baz'}]) + # object.method_1(['foo', 'bar', {key: 'baz'}]) # # no error raised # @example Actual parameter does not include item matching nested matcher. # object.method_1(['foo', 'bar', {:other_key => 'baz'}]) @@ -2856,10 +2889,10 @@ module Mocha::ParameterMatchers # @example Actual parameter is a Hash including the given key. # object = mock() # object.expects(:method_1).with(includes(:bar)) - # object.method_1({:foo => 1, :bar => 2}) + # object.method_1({foo: 1, bar: 2}) # # no error raised # @example Actual parameter is a Hash without the given key. - # object.method_1({:foo => 1, :baz => 2}) + # object.method_1({foo: 1, baz: 2}) # # error raised, because hash does not include key 'bar' # @example Actual parameter is a Hash with a key matching the given matcher. # object = mock() @@ -2985,8 +3018,6 @@ module Mocha::ParameterMatchers # source://mocha//lib/mocha/parameter_matchers/regexp_matches.rb#24 def regexp_matches(regexp); end - # Matches any object that responds to +message+ with +result+. To put it another way, it tests the quack, not the duck. - # # @example Actual parameter responds with "FOO" when :upcase is invoked. # object = mock() # object.expects(:method_1).with(responds_with(:upcase, "FOO")) @@ -2997,13 +3028,18 @@ module Mocha::ParameterMatchers # object.expects(:method_1).with(responds_with(:upcase, "BAR")) # object.method_1("foo") # # error raised, because "foo".upcase != "BAR" - # @param message [Symbol] method to invoke. - # @param result [Object] expected result of sending +message+. + # @example Actual parameter responds with "FOO" when :upcase is invoked and "oof" when :reverse is invoked. + # object = mock() + # object.expects(:method_1).with(responds_with(upcase: "FOO", reverse: "oof")) + # object.method_1("foo") + # # no error raised, because "foo".upcase == "FOO" and "foo".reverse == "oof" + # @overload responds_with + # @overload responds_with # @return [RespondsWith] parameter matcher. # @see Expectation#with # - # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#25 - def responds_with(message, result); end + # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#37 + def responds_with(*options); end # Matches any YAML that represents the specified +object+ # @@ -3121,12 +3157,12 @@ class Mocha::ParameterMatchers::Base # @example Alternative ways to combine matchers with a logical AND. # object = mock() # object.expects(:run).with(all_of(has_key(:foo), has_key(:bar))) - # object.run(:foo => 'foovalue', :bar => 'barvalue') + # object.run(foo: 'foovalue', bar: 'barvalue') # # # is exactly equivalent to # # object.expects(:run).with(has_key(:foo) & has_key(:bar)) - # object.run(:foo => 'foovalue', :bar => 'barvalue) + # object.run(foo: 'foovalue', bar: 'barvalue) # @param other [Base] parameter matcher. # @return [AllOf] parameter matcher. # @see Expectation#with @@ -3148,12 +3184,12 @@ class Mocha::ParameterMatchers::Base # @example Alternative ways to combine matchers with a logical OR. # object = mock() # object.expects(:run).with(any_of(has_key(:foo), has_key(:bar))) - # object.run(:foo => 'foovalue') + # object.run(foo: 'foovalue') # # # is exactly equivalent to # # object.expects(:run).with(has_key(:foo) | has_key(:bar)) - # object.run(:foo => 'foovalue') + # object.run(foo: 'foovalue') # @example Using an explicit {Equals} matcher in combination with {#|}. # object.expects(:run).with(equals(1) | equals(2)) # object.run(1) # passes @@ -3537,23 +3573,23 @@ end # Parameter matcher which matches if actual parameter returns expected result when specified method is invoked. # -# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#30 +# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#57 class Mocha::ParameterMatchers::RespondsWith < ::Mocha::ParameterMatchers::Base # @private # @return [RespondsWith] a new instance of RespondsWith # - # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#32 + # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#59 def initialize(message, result); end # @private # @return [Boolean] # - # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#38 + # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#65 def matches?(available_parameters); end # @private # - # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#44 + # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#71 def mocha_inspect; end end diff --git a/sorbet/rbi/gems/rbi@0.1.9.rbi b/sorbet/rbi/gems/rbi@0.1.11.rbi similarity index 90% rename from sorbet/rbi/gems/rbi@0.1.9.rbi rename to sorbet/rbi/gems/rbi@0.1.11.rbi index 2dc769936..71b0e6847 100644 --- a/sorbet/rbi/gems/rbi@0.1.9.rbi +++ b/sorbet/rbi/gems/rbi@0.1.11.rbi @@ -7,13 +7,13 @@ # source://rbi//lib/rbi/loc.rb#4 module RBI; end -# source://rbi//lib/rbi/model.rb#968 +# source://rbi//lib/rbi/model.rb#1041 class RBI::Arg < ::RBI::Node - # source://rbi//lib/rbi/model.rb#980 + # source://rbi//lib/rbi/model.rb#1053 sig { params(value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(value, loc: T.unsafe(nil)); end - # source://rbi//lib/rbi/model.rb#986 + # source://rbi//lib/rbi/model.rb#1059 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -21,11 +21,11 @@ class RBI::Arg < ::RBI::Node sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#991 + # source://rbi//lib/rbi/model.rb#1064 sig { returns(::String) } def to_s; end - # source://rbi//lib/rbi/model.rb#972 + # source://rbi//lib/rbi/model.rb#1045 sig { returns(::String) } def value; end end @@ -197,9 +197,9 @@ class RBI::BlankLine < ::RBI::Comment def accept_printer(v); end end -# source://rbi//lib/rbi/model.rb#741 +# source://rbi//lib/rbi/model.rb#814 class RBI::BlockParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#752 + # source://rbi//lib/rbi/model.rb#825 sig do params( name: ::String, @@ -210,7 +210,7 @@ class RBI::BlockParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#763 + # source://rbi//lib/rbi/model.rb#836 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -222,7 +222,7 @@ class RBI::BlockParam < ::RBI::Param sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#758 + # source://rbi//lib/rbi/model.rb#831 sig { override.returns(::String) } def to_s; end end @@ -379,11 +379,11 @@ class RBI::Const < ::RBI::NodeWithComments def value; end end -# source://rbi//lib/rbi/model.rb#816 +# source://rbi//lib/rbi/model.rb#889 class RBI::Extend < ::RBI::Mixin include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#828 + # source://rbi//lib/rbi/model.rb#901 sig do params( name: ::String, @@ -403,7 +403,7 @@ class RBI::Extend < ::RBI::Mixin sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#834 + # source://rbi//lib/rbi/model.rb#907 sig { override.returns(::String) } def to_s; end end @@ -568,11 +568,11 @@ end # Sorbet's misc. # -# source://rbi//lib/rbi/model.rb#1294 +# source://rbi//lib/rbi/model.rb#1372 class RBI::Helper < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1308 + # source://rbi//lib/rbi/model.rb#1386 sig do params( name: ::String, @@ -595,20 +595,20 @@ class RBI::Helper < ::RBI::NodeWithComments sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1298 + # source://rbi//lib/rbi/model.rb#1376 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/model.rb#1315 + # source://rbi//lib/rbi/model.rb#1393 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#793 +# source://rbi//lib/rbi/model.rb#866 class RBI::Include < ::RBI::Mixin include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#805 + # source://rbi//lib/rbi/model.rb#878 sig do params( name: ::String, @@ -628,7 +628,7 @@ class RBI::Include < ::RBI::Mixin sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#811 + # source://rbi//lib/rbi/model.rb#884 sig { override.returns(::String) } def to_s; end end @@ -668,7 +668,7 @@ class RBI::Index < ::RBI::Visitor end end -# A Node that can be refered to by a unique ID inside an index +# A Node that can be referred to by a unique ID inside an index # # @abstract Subclasses must implement the `abstract` methods below. # @@ -688,13 +688,13 @@ module RBI::Indexable def index_ids; end end -# source://rbi//lib/rbi/model.rb#996 +# source://rbi//lib/rbi/model.rb#1069 class RBI::KwArg < ::RBI::Arg - # source://rbi//lib/rbi/model.rb#1009 + # source://rbi//lib/rbi/model.rb#1082 sig { params(keyword: ::String, value: ::String, loc: T.nilable(::RBI::Loc)).void } def initialize(keyword, value, loc: T.unsafe(nil)); end - # source://rbi//lib/rbi/model.rb#1015 + # source://rbi//lib/rbi/model.rb#1088 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -702,18 +702,18 @@ class RBI::KwArg < ::RBI::Arg sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#1000 + # source://rbi//lib/rbi/model.rb#1073 sig { returns(::String) } def keyword; end - # source://rbi//lib/rbi/model.rb#1020 + # source://rbi//lib/rbi/model.rb#1093 sig { returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#682 +# source://rbi//lib/rbi/model.rb#755 class RBI::KwOptParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#697 + # source://rbi//lib/rbi/model.rb#770 sig do params( name: ::String, @@ -725,7 +725,7 @@ class RBI::KwOptParam < ::RBI::Param end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#709 + # source://rbi//lib/rbi/model.rb#782 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -737,18 +737,18 @@ class RBI::KwOptParam < ::RBI::Param sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#704 + # source://rbi//lib/rbi/model.rb#777 sig { override.returns(::String) } def to_s; end - # source://rbi//lib/rbi/model.rb#686 + # source://rbi//lib/rbi/model.rb#759 sig { returns(::String) } def value; end end -# source://rbi//lib/rbi/model.rb#655 +# source://rbi//lib/rbi/model.rb#728 class RBI::KwParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#666 + # source://rbi//lib/rbi/model.rb#739 sig do params( name: ::String, @@ -759,7 +759,7 @@ class RBI::KwParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#677 + # source://rbi//lib/rbi/model.rb#750 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -771,14 +771,14 @@ class RBI::KwParam < ::RBI::Param sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#672 + # source://rbi//lib/rbi/model.rb#745 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#714 +# source://rbi//lib/rbi/model.rb#787 class RBI::KwRestParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#725 + # source://rbi//lib/rbi/model.rb#798 sig do params( name: ::String, @@ -789,7 +789,7 @@ class RBI::KwRestParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#736 + # source://rbi//lib/rbi/model.rb#809 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -801,7 +801,7 @@ class RBI::KwRestParam < ::RBI::Param sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#731 + # source://rbi//lib/rbi/model.rb#804 sig { override.returns(::String) } def to_s; end end @@ -907,11 +907,55 @@ class RBI::Method < ::RBI::NodeWithComments sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end + # source://rbi//lib/rbi/model.rb#568 + sig { params(name: ::String).void } + def add_block_param(name); end + + # source://rbi//lib/rbi/model.rb#558 + sig { params(name: ::String, default_value: ::String).void } + def add_kw_opt_param(name, default_value); end + + # source://rbi//lib/rbi/model.rb#553 + sig { params(name: ::String).void } + def add_kw_param(name); end + + # source://rbi//lib/rbi/model.rb#563 + sig { params(name: ::String).void } + def add_kw_rest_param(name); end + + # source://rbi//lib/rbi/model.rb#543 + sig { params(name: ::String, default_value: ::String).void } + def add_opt_param(name, default_value); end + + # source://rbi//lib/rbi/model.rb#538 + sig { params(name: ::String).void } + def add_param(name); end + + # source://rbi//lib/rbi/model.rb#548 + sig { params(name: ::String).void } + def add_rest_param(name); end + + # source://rbi//lib/rbi/model.rb#585 + sig do + params( + params: T::Array[::RBI::SigParam], + return_type: T.nilable(::String), + is_abstract: T::Boolean, + is_override: T::Boolean, + is_overridable: T::Boolean, + is_final: T::Boolean, + type_params: T::Array[::String], + checked: T.nilable(::Symbol), + block: T.proc.params(node: ::RBI::Sig).void + ).void + end + def add_sig(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), &block); end + # source://rbi//lib/rbi/rewriters/merge_trees.rb#461 sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#538 + # source://rbi//lib/rbi/model.rb#611 sig { returns(::String) } def fully_qualified_name; end @@ -962,7 +1006,7 @@ class RBI::Method < ::RBI::NodeWithComments # source://rbi//lib/rbi/model.rb#499 def sigs=(_arg0); end - # source://rbi//lib/rbi/model.rb#547 + # source://rbi//lib/rbi/model.rb#620 sig { override.returns(::String) } def to_s; end @@ -976,11 +1020,11 @@ class RBI::Method < ::RBI::NodeWithComments def visibility=(_arg0); end end -# source://rbi//lib/rbi/model.rb#1355 +# source://rbi//lib/rbi/model.rb#1433 class RBI::MixesInClassMethods < ::RBI::Mixin include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1367 + # source://rbi//lib/rbi/model.rb#1445 sig do params( name: ::String, @@ -1000,7 +1044,7 @@ class RBI::MixesInClassMethods < ::RBI::Mixin sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1373 + # source://rbi//lib/rbi/model.rb#1451 sig { override.returns(::String) } def to_s; end end @@ -1009,11 +1053,11 @@ end # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#770 +# source://rbi//lib/rbi/model.rb#843 class RBI::Mixin < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#787 + # source://rbi//lib/rbi/model.rb#860 sig do params( name: ::String, @@ -1032,7 +1076,7 @@ class RBI::Mixin < ::RBI::NodeWithComments sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#777 + # source://rbi//lib/rbi/model.rb#850 sig { returns(T::Array[::String]) } def names; end end @@ -1202,9 +1246,9 @@ class RBI::NodeWithComments < ::RBI::Node def version_requirements; end end -# source://rbi//lib/rbi/model.rb#601 +# source://rbi//lib/rbi/model.rb#674 class RBI::OptParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#616 + # source://rbi//lib/rbi/model.rb#689 sig do params( name: ::String, @@ -1216,7 +1260,7 @@ class RBI::OptParam < ::RBI::Param end def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#623 + # source://rbi//lib/rbi/model.rb#696 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -1228,18 +1272,18 @@ class RBI::OptParam < ::RBI::Param sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#605 + # source://rbi//lib/rbi/model.rb#678 sig { returns(::String) } def value; end end # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#552 +# source://rbi//lib/rbi/model.rb#625 class RBI::Param < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#568 + # source://rbi//lib/rbi/model.rb#641 sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end @@ -1251,7 +1295,7 @@ class RBI::Param < ::RBI::NodeWithComments sig { returns(T::Array[::String]) } def comments_lines; end - # source://rbi//lib/rbi/model.rb#559 + # source://rbi//lib/rbi/model.rb#632 sig { returns(::String) } def name; end @@ -1259,7 +1303,7 @@ class RBI::Param < ::RBI::NodeWithComments sig { params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#574 + # source://rbi//lib/rbi/model.rb#647 sig { override.returns(::String) } def to_s; end end @@ -1566,9 +1610,9 @@ class RBI::Printer < ::RBI::Visitor def visit_file(file); end end -# source://rbi//lib/rbi/model.rb#909 +# source://rbi//lib/rbi/model.rb#982 class RBI::Private < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#919 + # source://rbi//lib/rbi/model.rb#992 sig do params( loc: T.nilable(::RBI::Loc), @@ -1579,9 +1623,9 @@ class RBI::Private < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#893 +# source://rbi//lib/rbi/model.rb#966 class RBI::Protected < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#903 + # source://rbi//lib/rbi/model.rb#976 sig do params( loc: T.nilable(::RBI::Loc), @@ -1592,9 +1636,9 @@ class RBI::Protected < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#877 +# source://rbi//lib/rbi/model.rb#950 class RBI::Public < ::RBI::Visibility - # source://rbi//lib/rbi/model.rb#887 + # source://rbi//lib/rbi/model.rb#960 sig do params( loc: T.nilable(::RBI::Loc), @@ -1605,9 +1649,9 @@ class RBI::Public < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#579 +# source://rbi//lib/rbi/model.rb#652 class RBI::ReqParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#590 + # source://rbi//lib/rbi/model.rb#663 sig do params( name: ::String, @@ -1618,16 +1662,16 @@ class RBI::ReqParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#596 + # source://rbi//lib/rbi/model.rb#669 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end end -# source://rbi//lib/rbi/model.rb#1378 +# source://rbi//lib/rbi/model.rb#1456 class RBI::RequiresAncestor < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1391 + # source://rbi//lib/rbi/model.rb#1469 sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end @@ -1639,18 +1683,18 @@ class RBI::RequiresAncestor < ::RBI::NodeWithComments sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1382 + # source://rbi//lib/rbi/model.rb#1460 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/model.rb#1397 + # source://rbi//lib/rbi/model.rb#1475 sig { override.returns(::String) } def to_s; end end -# source://rbi//lib/rbi/model.rb#628 +# source://rbi//lib/rbi/model.rb#701 class RBI::RestParam < ::RBI::Param - # source://rbi//lib/rbi/model.rb#639 + # source://rbi//lib/rbi/model.rb#712 sig do params( name: ::String, @@ -1661,7 +1705,7 @@ class RBI::RestParam < ::RBI::Param end def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#650 + # source://rbi//lib/rbi/model.rb#723 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -1673,7 +1717,7 @@ class RBI::RestParam < ::RBI::Param sig { override.params(v: ::RBI::Printer, last: T::Boolean).void } def print_comment_leading_space(v, last:); end - # source://rbi//lib/rbi/model.rb#645 + # source://rbi//lib/rbi/model.rb#718 sig { override.returns(::String) } def to_s; end end @@ -1900,7 +1944,7 @@ class RBI::Rewriters::Merge::Conflict < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11352/lib/types/struct.rb#13 def inherited(s); end end end @@ -2117,7 +2161,7 @@ class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11262/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11352/lib/types/struct.rb#13 def inherited(s); end end end @@ -2231,11 +2275,11 @@ end # Sends # -# source://rbi//lib/rbi/model.rb#927 +# source://rbi//lib/rbi/model.rb#1000 class RBI::Send < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#945 + # source://rbi//lib/rbi/model.rb#1018 sig do params( method: ::String, @@ -2247,11 +2291,11 @@ class RBI::Send < ::RBI::NodeWithComments end def initialize(method, args = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#953 + # source://rbi//lib/rbi/model.rb#1026 sig { params(arg: ::RBI::Arg).void } def <<(arg); end - # source://rbi//lib/rbi/model.rb#958 + # source://rbi//lib/rbi/model.rb#1031 sig { params(other: T.nilable(::Object)).returns(T::Boolean) } def ==(other); end @@ -2259,7 +2303,7 @@ class RBI::Send < ::RBI::NodeWithComments sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#934 + # source://rbi//lib/rbi/model.rb#1007 sig { returns(T::Array[::RBI::Arg]) } def args; end @@ -2271,20 +2315,20 @@ class RBI::Send < ::RBI::NodeWithComments sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#931 + # source://rbi//lib/rbi/model.rb#1004 sig { returns(::String) } def method; end - # source://rbi//lib/rbi/model.rb#963 + # source://rbi//lib/rbi/model.rb#1036 sig { returns(::String) } def to_s; end end # Sorbet's sigs # -# source://rbi//lib/rbi/model.rb#1027 +# source://rbi//lib/rbi/model.rb#1100 class RBI::Sig < ::RBI::Node - # source://rbi//lib/rbi/model.rb#1059 + # source://rbi//lib/rbi/model.rb#1132 sig do params( params: T::Array[::RBI::SigParam], @@ -2301,11 +2345,11 @@ class RBI::Sig < ::RBI::Node end def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#1084 + # source://rbi//lib/rbi/model.rb#1157 sig { params(param: ::RBI::SigParam).void } def <<(param); end - # source://rbi//lib/rbi/model.rb#1089 + # source://rbi//lib/rbi/model.rb#1167 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end @@ -2313,76 +2357,80 @@ class RBI::Sig < ::RBI::Node sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#1043 + # source://rbi//lib/rbi/model.rb#1162 + sig { params(name: ::String, type: ::String).void } + def add_param(name, type); end + + # source://rbi//lib/rbi/model.rb#1116 sig { returns(T.nilable(::Symbol)) } def checked; end # @return [Symbol, nil] # - # source://rbi//lib/rbi/model.rb#1043 + # source://rbi//lib/rbi/model.rb#1116 def checked=(_arg0); end # source://rbi//lib/rbi/printer.rb#656 sig { returns(T::Boolean) } def inline_params?; end - # source://rbi//lib/rbi/model.rb#1037 + # source://rbi//lib/rbi/model.rb#1110 sig { returns(T::Boolean) } def is_abstract; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1037 + # source://rbi//lib/rbi/model.rb#1110 def is_abstract=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1037 + # source://rbi//lib/rbi/model.rb#1110 def is_final; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1037 + # source://rbi//lib/rbi/model.rb#1110 def is_final=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1037 + # source://rbi//lib/rbi/model.rb#1110 def is_overridable; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1037 + # source://rbi//lib/rbi/model.rb#1110 def is_overridable=(_arg0); end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1037 + # source://rbi//lib/rbi/model.rb#1110 def is_override; end # @return [Boolean] # - # source://rbi//lib/rbi/model.rb#1037 + # source://rbi//lib/rbi/model.rb#1110 def is_override=(_arg0); end # source://rbi//lib/rbi/printer.rb#651 sig { override.returns(T::Boolean) } def oneline?; end - # source://rbi//lib/rbi/model.rb#1031 + # source://rbi//lib/rbi/model.rb#1104 sig { returns(T::Array[::RBI::SigParam]) } def params; end - # source://rbi//lib/rbi/model.rb#1034 + # source://rbi//lib/rbi/model.rb#1107 sig { returns(T.nilable(::String)) } def return_type; end # @return [String, nil] # - # source://rbi//lib/rbi/model.rb#1034 + # source://rbi//lib/rbi/model.rb#1107 def return_type=(_arg0); end - # source://rbi//lib/rbi/model.rb#1040 + # source://rbi//lib/rbi/model.rb#1113 sig { returns(T::Array[::String]) } def type_params; end @@ -2401,9 +2449,9 @@ class RBI::Sig < ::RBI::Node def sig_modifiers; end end -# source://rbi//lib/rbi/model.rb#1098 +# source://rbi//lib/rbi/model.rb#1176 class RBI::SigParam < ::RBI::NodeWithComments - # source://rbi//lib/rbi/model.rb#1113 + # source://rbi//lib/rbi/model.rb#1191 sig do params( name: ::String, @@ -2415,7 +2463,7 @@ class RBI::SigParam < ::RBI::NodeWithComments end def initialize(name, type, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#1121 + # source://rbi//lib/rbi/model.rb#1199 sig { params(other: ::Object).returns(T::Boolean) } def ==(other); end @@ -2427,7 +2475,7 @@ class RBI::SigParam < ::RBI::NodeWithComments sig { returns(T::Array[::String]) } def comments_lines; end - # source://rbi//lib/rbi/model.rb#1102 + # source://rbi//lib/rbi/model.rb#1180 sig { returns(::String) } def name; end @@ -2437,7 +2485,7 @@ class RBI::SigParam < ::RBI::NodeWithComments # @return [String] # - # source://rbi//lib/rbi/model.rb#1102 + # source://rbi//lib/rbi/model.rb#1180 def type; end end @@ -2519,9 +2567,9 @@ end # Sorbet's T::Enum # -# source://rbi//lib/rbi/model.rb#1239 +# source://rbi//lib/rbi/model.rb#1317 class RBI::TEnum < ::RBI::Class - # source://rbi//lib/rbi/model.rb#1250 + # source://rbi//lib/rbi/model.rb#1328 sig do params( name: ::String, @@ -2533,11 +2581,11 @@ class RBI::TEnum < ::RBI::Class def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1256 +# source://rbi//lib/rbi/model.rb#1334 class RBI::TEnumBlock < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1270 + # source://rbi//lib/rbi/model.rb#1348 sig do params( names: T::Array[::String], @@ -2548,7 +2596,7 @@ class RBI::TEnumBlock < ::RBI::NodeWithComments end def initialize(names = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi//lib/rbi/model.rb#1282 + # source://rbi//lib/rbi/model.rb#1360 sig { params(name: ::String).void } def <<(name); end @@ -2556,7 +2604,7 @@ class RBI::TEnumBlock < ::RBI::NodeWithComments sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#1277 + # source://rbi//lib/rbi/model.rb#1355 sig { returns(T::Boolean) } def empty?; end @@ -2568,20 +2616,20 @@ class RBI::TEnumBlock < ::RBI::NodeWithComments sig { override.params(other: ::RBI::Node).void } def merge_with(other); end - # source://rbi//lib/rbi/model.rb#1260 + # source://rbi//lib/rbi/model.rb#1338 sig { returns(T::Array[::String]) } def names; end - # source://rbi//lib/rbi/model.rb#1287 + # source://rbi//lib/rbi/model.rb#1365 sig { override.returns(::String) } def to_s; end end # Sorbet's T::Struct # -# source://rbi//lib/rbi/model.rb#1128 +# source://rbi//lib/rbi/model.rb#1206 class RBI::TStruct < ::RBI::Class - # source://rbi//lib/rbi/model.rb#1139 + # source://rbi//lib/rbi/model.rb#1217 sig do params( name: ::String, @@ -2593,11 +2641,11 @@ class RBI::TStruct < ::RBI::Class def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end -# source://rbi//lib/rbi/model.rb#1177 +# source://rbi//lib/rbi/model.rb#1255 class RBI::TStructConst < ::RBI::TStructField include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1190 + # source://rbi//lib/rbi/model.rb#1268 sig do params( name: ::String, @@ -2614,7 +2662,7 @@ class RBI::TStructConst < ::RBI::TStructField sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1196 + # source://rbi//lib/rbi/model.rb#1274 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end @@ -2622,18 +2670,18 @@ class RBI::TStructConst < ::RBI::TStructField sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1202 + # source://rbi//lib/rbi/model.rb#1280 sig { override.returns(::String) } def to_s; end end # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#1145 +# source://rbi//lib/rbi/model.rb#1223 class RBI::TStructField < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#1166 + # source://rbi//lib/rbi/model.rb#1244 sig do params( name: ::String, @@ -2653,46 +2701,46 @@ class RBI::TStructField < ::RBI::NodeWithComments sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1155 + # source://rbi//lib/rbi/model.rb#1233 sig { returns(T.nilable(::String)) } def default; end # @return [String, nil] # - # source://rbi//lib/rbi/model.rb#1155 + # source://rbi//lib/rbi/model.rb#1233 def default=(_arg0); end # @abstract # - # source://rbi//lib/rbi/model.rb#1174 + # source://rbi//lib/rbi/model.rb#1252 sig { abstract.returns(T::Array[::String]) } def fully_qualified_names; end - # source://rbi//lib/rbi/model.rb#1152 + # source://rbi//lib/rbi/model.rb#1230 sig { returns(::String) } def name; end # @return [String] # - # source://rbi//lib/rbi/model.rb#1152 + # source://rbi//lib/rbi/model.rb#1230 def name=(_arg0); end # @return [String] # - # source://rbi//lib/rbi/model.rb#1152 + # source://rbi//lib/rbi/model.rb#1230 def type; end # @return [String] # - # source://rbi//lib/rbi/model.rb#1152 + # source://rbi//lib/rbi/model.rb#1230 def type=(_arg0); end end -# source://rbi//lib/rbi/model.rb#1207 +# source://rbi//lib/rbi/model.rb#1285 class RBI::TStructProp < ::RBI::TStructField include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1220 + # source://rbi//lib/rbi/model.rb#1298 sig do params( name: ::String, @@ -2709,7 +2757,7 @@ class RBI::TStructProp < ::RBI::TStructField sig { override.params(other: ::RBI::Node).returns(T::Boolean) } def compatible_with?(other); end - # source://rbi//lib/rbi/model.rb#1226 + # source://rbi//lib/rbi/model.rb#1304 sig { override.returns(T::Array[::String]) } def fully_qualified_names; end @@ -2717,7 +2765,7 @@ class RBI::TStructProp < ::RBI::TStructField sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1232 + # source://rbi//lib/rbi/model.rb#1310 sig { override.returns(::String) } def to_s; end end @@ -2750,7 +2798,7 @@ class RBI::Tree < ::RBI::NodeWithComments sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#38 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#38 sig do params( name: ::String, @@ -2760,19 +2808,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_class(name, superclass_name: T.unsafe(nil), &block); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#45 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#45 sig { params(name: ::String, value: ::String).void } def create_constant(name, value:); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#55 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#55 sig { params(name: ::String).void } def create_extend(name); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#50 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#50 sig { params(name: ::String).void } def create_include(name); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#89 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#89 sig do params( name: ::String, @@ -2785,19 +2833,36 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#60 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#113 + sig do + params( + name: ::String, + sigs: T::Array[::RBI::Sig], + parameters: T::Array[::RBI::Param], + class_method: T::Boolean, + visibility: ::RBI::Visibility, + comments: T::Array[::RBI::Comment] + ).void + end + def create_method_with_sigs(name, sigs:, parameters: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil)); end + + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#60 sig { params(name: ::String).void } def create_mixes_in_class_methods(name); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#25 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#25 sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_module(name, &block); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#9 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#9 sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_path(constant, &block); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#74 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#134 + sig { params(parameters: T::Hash[T.any(::String, ::Symbol), ::String], return_type: ::String).returns(::RBI::Sig) } + def create_sig(parameters:, return_type: T.unsafe(nil)); end + + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#74 sig do params( name: ::String, @@ -2863,20 +2928,20 @@ class RBI::Tree < ::RBI::NodeWithComments private - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#116 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#149 sig { params(node: ::RBI::Node).returns(::RBI::Node) } def create_node(node); end - # source://tapioca/0.12.0/lib/tapioca/rbi_ext/model.rb#111 + # source://tapioca/0.13.3/lib/tapioca/rbi_ext/model.rb#144 sig { returns(T::Hash[::String, ::RBI::Node]) } def nodes_cache; end end -# source://rbi//lib/rbi/model.rb#1320 +# source://rbi//lib/rbi/model.rb#1398 class RBI::TypeMember < ::RBI::NodeWithComments include ::RBI::Indexable - # source://rbi//lib/rbi/model.rb#1335 + # source://rbi//lib/rbi/model.rb#1413 sig do params( name: ::String, @@ -2892,7 +2957,7 @@ class RBI::TypeMember < ::RBI::NodeWithComments sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#1343 + # source://rbi//lib/rbi/model.rb#1421 sig { returns(::String) } def fully_qualified_name; end @@ -2900,17 +2965,17 @@ class RBI::TypeMember < ::RBI::NodeWithComments sig { override.returns(T::Array[::String]) } def index_ids; end - # source://rbi//lib/rbi/model.rb#1324 + # source://rbi//lib/rbi/model.rb#1402 sig { returns(::String) } def name; end - # source://rbi//lib/rbi/model.rb#1350 + # source://rbi//lib/rbi/model.rb#1428 sig { override.returns(::String) } def to_s; end # @return [String] # - # source://rbi//lib/rbi/model.rb#1324 + # source://rbi//lib/rbi/model.rb#1402 def value; end end @@ -2936,15 +3001,15 @@ RBI::VERSION = T.let(T.unsafe(nil), String) # # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. # -# source://rbi//lib/rbi/model.rb#841 +# source://rbi//lib/rbi/model.rb#914 class RBI::Visibility < ::RBI::NodeWithComments abstract! - # source://rbi//lib/rbi/model.rb#851 + # source://rbi//lib/rbi/model.rb#924 sig { params(visibility: ::Symbol, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void } def initialize(visibility, loc: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://rbi//lib/rbi/model.rb#857 + # source://rbi//lib/rbi/model.rb#930 sig { params(other: ::RBI::Visibility).returns(T::Boolean) } def ==(other); end @@ -2952,19 +3017,19 @@ class RBI::Visibility < ::RBI::NodeWithComments sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi//lib/rbi/model.rb#872 + # source://rbi//lib/rbi/model.rb#945 sig { returns(T::Boolean) } def private?; end - # source://rbi//lib/rbi/model.rb#867 + # source://rbi//lib/rbi/model.rb#940 sig { returns(T::Boolean) } def protected?; end - # source://rbi//lib/rbi/model.rb#862 + # source://rbi//lib/rbi/model.rb#935 sig { returns(T::Boolean) } def public?; end - # source://rbi//lib/rbi/model.rb#848 + # source://rbi//lib/rbi/model.rb#921 sig { returns(::Symbol) } def visibility; end end diff --git a/sorbet/rbi/gems/rubocop-sorbet@0.8.0.rbi b/sorbet/rbi/gems/rubocop-sorbet@0.8.1.rbi similarity index 97% rename from sorbet/rbi/gems/rubocop-sorbet@0.8.0.rbi rename to sorbet/rbi/gems/rubocop-sorbet@0.8.1.rbi index 3888c041e..6f4cc551f 100644 --- a/sorbet/rbi/gems/rubocop-sorbet@0.8.0.rbi +++ b/sorbet/rbi/gems/rubocop-sorbet@0.8.1.rbi @@ -190,16 +190,30 @@ RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), # end # # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#35 -class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Cop - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#75 - def autocorrect(node); end +class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Alignment + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#81 + def argumentless_unbound_callable_callback_conditional?(param0 = T.unsafe(nil)); end - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#127 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#91 def on_send(node); end + + private + + # Find the immediately enclosing class or module name. + # Returns `nil`` if the immediate parent (skipping begin if present) is not a class or module. + # + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#128 + def immediately_enclosing_module_name(node); end end -# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#36 -RuboCop::Cop::Sorbet::CallbackConditionalsBinding::CALLBACKS = T.let(T.unsafe(nil), Array) +# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#39 +RuboCop::Cop::Sorbet::CallbackConditionalsBinding::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#41 +RuboCop::Cop::Sorbet::CallbackConditionalsBinding::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Disallows the usage of `checked(true)`. This usage could cause # confusion; it could lead some people to believe that a method would be checked @@ -259,15 +273,18 @@ RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), Str # # good # { "User" => User }.fetch(class_name) # -# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#37 -class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Cop - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#38 - def constant_from_string?(param0 = T.unsafe(nil)); end - - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#42 +# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#36 +class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Base + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#46 def on_send(node); end end +# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#37 +RuboCop::Cop::Sorbet::ConstantsFromStrings::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#40 +RuboCop::Cop::Sorbet::ConstantsFromStrings::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks for blank lines after signatures. # # @example @@ -1392,7 +1409,7 @@ RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String) # # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#20 class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#35 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#36 def autocorrect(_node); end # So we can properly subclass this cop @@ -1404,56 +1421,56 @@ class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop # checks # - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#70 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#71 def check_sigil_present(sigil); end - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#130 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#131 def check_strictness_level(sigil, strictness); end - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#108 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#109 def check_strictness_not_empty(sigil, strictness); end - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#119 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#120 def check_strictness_valid(sigil, strictness); end # Default is `nil` # - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#180 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#181 def exact_strictness; end # extraction # - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#58 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#59 def extract_sigil(processed_source); end - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#64 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#65 def extract_strictness(sigil); end # Default is `nil` # - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#174 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#175 def minimum_strictness; end # Default is `false` # # @return [Boolean] # - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#163 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#164 def require_sigil_on_all_files?; end # Default is `'false'` # - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#168 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#169 def suggested_strictness; end - # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#86 + # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#87 def suggested_strictness_level; end end -# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#54 +# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#55 RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp) -# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#53 +# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#54 RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array) # Disallows the usage of `.void.checked(:tests)`. diff --git a/sorbet/rbi/gems/rubocop@1.62.1.rbi b/sorbet/rbi/gems/rubocop@1.63.2.rbi similarity index 98% rename from sorbet/rbi/gems/rubocop@1.62.1.rbi rename to sorbet/rbi/gems/rubocop@1.63.2.rbi index e1758a6ac..b31bf2d31 100644 --- a/sorbet/rbi/gems/rubocop@1.62.1.rbi +++ b/sorbet/rbi/gems/rubocop@1.63.2.rbi @@ -999,7 +999,9 @@ class RuboCop::Config # source://rubocop//lib/rubocop/config.rb#237 def base_dir_for_path_parameters; end - # source://rubocop//lib/rubocop/config.rb#266 + # @return [String, nil] + # + # source://rubocop//lib/rubocop/config.rb#267 def bundler_lock_file_path; end # source://rubocop//lib/rubocop/config.rb#51 @@ -1075,7 +1077,12 @@ class RuboCop::Config # source://rubocop//lib/rubocop/config.rb#153 def for_department(department_name); end - # source://rubocop//lib/rubocop/config.rb#289 + # Returns target's locked gem versions (i.e. from Gemfile.lock or gems.locked) + # + # source://rubocop//lib/rubocop/config.rb#292 + def gem_versions_in_target; end + + # source://rubocop//lib/rubocop/config.rb#296 def inspect; end # True if this is a config file that is shipped with RuboCop @@ -1120,7 +1127,7 @@ class RuboCop::Config # source://rubocop//lib/rubocop/config.rb#220 def patterns_to_include; end - # source://rubocop//lib/rubocop/config.rb#277 + # source://rubocop//lib/rubocop/config.rb#278 def pending_cops; end # Returns true if there's a chance that an Include pattern matches hidden @@ -1166,18 +1173,31 @@ class RuboCop::Config private - # source://rubocop//lib/rubocop/config.rb#324 + # source://rubocop//lib/rubocop/config.rb#347 def department_of(qualified_cop_name); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#312 + # source://rubocop//lib/rubocop/config.rb#335 def enable_cop?(qualified_cop_name, cop_options); end - # source://rubocop//lib/rubocop/config.rb#299 + # @param gem_version [Gem::Version] an object like `Gem::Version.new("7.1.2.3")` + # @return [Float] The major and minor version, like `7.1` + # + # source://rubocop//lib/rubocop/config.rb#321 + def gem_version_to_major_minor_float(gem_version); end + + # source://rubocop//lib/rubocop/config.rb#328 + def read_gem_versions_from_target_lockfile; end + + # @return [Float, nil] The Rails version as a `major.minor` Float. + # + # source://rubocop//lib/rubocop/config.rb#308 def read_rails_version_from_bundler_lock_file; end - # source://rubocop//lib/rubocop/config.rb#295 + # @return [Float, nil] The Rails version as a `major.minor` Float. + # + # source://rubocop//lib/rubocop/config.rb#303 def target_rails_version_from_bundler_lock_file; end class << self @@ -2913,18 +2933,18 @@ class RuboCop::Cop::Base # @return [Base] a new instance of Base # - # source://rubocop//lib/rubocop/cop/base.rb#129 + # source://rubocop//lib/rubocop/cop/base.rb#153 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#243 + # source://rubocop//lib/rubocop/cop/base.rb#269 def active_support_extensions_enabled?; end # Adds an offense that has no particular location. # No correction can be applied to global offenses # - # source://rubocop//lib/rubocop/cop/base.rb#162 + # source://rubocop//lib/rubocop/cop/base.rb#186 def add_global_offense(message = T.unsafe(nil), severity: T.unsafe(nil)); end # Adds an offense on the specified range (or node with an expression) @@ -2932,25 +2952,25 @@ class RuboCop::Cop::Base # to provide the cop the opportunity to autocorrect the offense. # If message is not specified, the method `message` will be called. # - # source://rubocop//lib/rubocop/cop/base.rb#172 + # source://rubocop//lib/rubocop/cop/base.rb#198 def add_offense(node_or_range, message: T.unsafe(nil), severity: T.unsafe(nil), &block); end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#313 + # source://rubocop//lib/rubocop/cop/base.rb#340 def always_autocorrect?; end # Called before any investigation # # @api private # - # source://rubocop//lib/rubocop/cop/base.rb#299 + # source://rubocop//lib/rubocop/cop/base.rb#326 def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end # @api private # - # source://rubocop//lib/rubocop/cop/base.rb#284 + # source://rubocop//lib/rubocop/cop/base.rb#311 def callbacks_needed; end # Returns the value of attribute config. @@ -2958,29 +2978,29 @@ class RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/base.rb#43 def config; end - # source://rubocop//lib/rubocop/cop/base.rb#223 + # source://rubocop//lib/rubocop/cop/base.rb#249 def config_to_allow_offenses; end - # source://rubocop//lib/rubocop/cop/base.rb#227 + # source://rubocop//lib/rubocop/cop/base.rb#253 def config_to_allow_offenses=(hash); end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#319 + # source://rubocop//lib/rubocop/cop/base.rb#346 def contextual_autocorrect?; end # Configuration Helpers # - # source://rubocop//lib/rubocop/cop/base.rb#217 + # source://rubocop//lib/rubocop/cop/base.rb#243 def cop_config; end - # source://rubocop//lib/rubocop/cop/base.rb#209 + # source://rubocop//lib/rubocop/cop/base.rb#235 def cop_name; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#255 + # source://rubocop//lib/rubocop/cop/base.rb#282 def excluded_file?(file); end # This method should be overridden when a cop's behavior depends @@ -2999,51 +3019,51 @@ class RuboCop::Cop::Base # ResultCache system when those external dependencies change, # ie when the ResultCache should be invalidated. # - # source://rubocop//lib/rubocop/cop/base.rb#205 + # source://rubocop//lib/rubocop/cop/base.rb#231 def external_dependency_checksum; end - # source://rubocop//lib/rubocop/cop/base.rb#323 + # source://rubocop//lib/rubocop/cop/base.rb#350 def inspect; end # Gets called if no message is specified when calling `add_offense` or # `add_global_offense` # Cops are discouraged to override this; instead pass your message directly # - # source://rubocop//lib/rubocop/cop/base.rb#156 + # source://rubocop//lib/rubocop/cop/base.rb#180 def message(_range = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/base.rb#209 + # source://rubocop//lib/rubocop/cop/base.rb#235 def name; end # @deprecated Make potential errors with previous API more obvious # - # source://rubocop//lib/rubocop/cop/base.rb#275 + # source://rubocop//lib/rubocop/cop/base.rb#302 def offenses; end # Called after all on_... have been called # When refining this method, always call `super` # - # source://rubocop//lib/rubocop/cop/base.rb#143 + # source://rubocop//lib/rubocop/cop/base.rb#167 def on_investigation_end; end # Called before all on_... have been called # When refining this method, always call `super` # - # source://rubocop//lib/rubocop/cop/base.rb#137 + # source://rubocop//lib/rubocop/cop/base.rb#161 def on_new_investigation; end # Called instead of all on_... callbacks for unrecognized files / syntax errors # When refining this method, always call `super` # - # source://rubocop//lib/rubocop/cop/base.rb#149 + # source://rubocop//lib/rubocop/cop/base.rb#173 def on_other_file; end # There should be very limited reasons for a Cop to do it's own parsing # - # source://rubocop//lib/rubocop/cop/base.rb#260 + # source://rubocop//lib/rubocop/cop/base.rb#287 def parse(source, path = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/base.rb#235 + # source://rubocop//lib/rubocop/cop/base.rb#261 def parser_engine; end # Returns the value of attribute processed_source. @@ -3055,99 +3075,104 @@ class RuboCop::Cop::Base # # @api private # - # source://rubocop//lib/rubocop/cop/base.rb#266 + # source://rubocop//lib/rubocop/cop/base.rb#293 def ready; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#247 + # source://rubocop//lib/rubocop/cop/base.rb#273 def relevant_file?(file); end - # source://rubocop//lib/rubocop/cop/base.rb#239 + # source://rubocop//lib/rubocop/cop/base.rb#265 def target_rails_version; end - # source://rubocop//lib/rubocop/cop/base.rb#231 + # source://rubocop//lib/rubocop/cop/base.rb#257 def target_ruby_version; end private - # source://rubocop//lib/rubocop/cop/base.rb#451 + # source://rubocop//lib/rubocop/cop/base.rb#478 def annotate(message); end - # source://rubocop//lib/rubocop/cop/base.rb#335 + # source://rubocop//lib/rubocop/cop/base.rb#362 def apply_correction(corrector); end # @return [Symbol] offense status # - # source://rubocop//lib/rubocop/cop/base.rb#415 + # source://rubocop//lib/rubocop/cop/base.rb#442 def attempt_correction(range, corrector); end # Reserved for Cop::Cop # - # source://rubocop//lib/rubocop/cop/base.rb#331 + # source://rubocop//lib/rubocop/cop/base.rb#358 def callback_argument(range); end # Called to complete an investigation # - # source://rubocop//lib/rubocop/cop/base.rb#364 + # source://rubocop//lib/rubocop/cop/base.rb#391 def complete_investigation; end # @return [Symbol, Corrector] offense status # - # source://rubocop//lib/rubocop/cop/base.rb#389 + # source://rubocop//lib/rubocop/cop/base.rb#416 def correct(range); end - # source://rubocop//lib/rubocop/cop/base.rb#349 + # source://rubocop//lib/rubocop/cop/base.rb#376 def current_corrector; end # Reserved for Commissioner: # - # source://rubocop//lib/rubocop/cop/base.rb#341 + # source://rubocop//lib/rubocop/cop/base.rb#368 def current_offense_locations; end - # source://rubocop//lib/rubocop/cop/base.rb#353 + # source://rubocop//lib/rubocop/cop/base.rb#380 def current_offenses; end - # source://rubocop//lib/rubocop/cop/base.rb#345 + # source://rubocop//lib/rubocop/cop/base.rb#372 def currently_disabled_lines; end - # source://rubocop//lib/rubocop/cop/base.rb#479 + # source://rubocop//lib/rubocop/cop/base.rb#506 def custom_severity; end - # source://rubocop//lib/rubocop/cop/base.rb#475 + # source://rubocop//lib/rubocop/cop/base.rb#502 def default_severity; end - # source://rubocop//lib/rubocop/cop/base.rb#429 + # source://rubocop//lib/rubocop/cop/base.rb#456 def disable_uncorrectable(range); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#465 + # source://rubocop//lib/rubocop/cop/base.rb#492 def enabled_line?(line_number); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#457 + # source://rubocop//lib/rubocop/cop/base.rb#484 def file_name_matches_any?(file, parameter, default_result); end - # source://rubocop//lib/rubocop/cop/base.rb#447 + # source://rubocop//lib/rubocop/cop/base.rb#474 def find_message(range, message); end - # source://rubocop//lib/rubocop/cop/base.rb#471 + # source://rubocop//lib/rubocop/cop/base.rb#498 def find_severity(_range, severity); end - # source://rubocop//lib/rubocop/cop/base.rb#492 + # source://rubocop//lib/rubocop/cop/base.rb#519 def range_for_original(range); end - # source://rubocop//lib/rubocop/cop/base.rb#436 + # source://rubocop//lib/rubocop/cop/base.rb#463 def range_from_node_or_range(node_or_range); end - # source://rubocop//lib/rubocop/cop/base.rb#384 + # source://rubocop//lib/rubocop/cop/base.rb#411 def reset_investigation; end + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/base.rb#527 + def target_satisfies_all_gem_version_requirements?; end + # @return [Symbol] offense status # - # source://rubocop//lib/rubocop/cop/base.rb#404 + # source://rubocop//lib/rubocop/cop/base.rb#431 def use_corrector(range, corrector); end class << self @@ -3162,18 +3187,18 @@ class RuboCop::Cop::Base # Naming # - # source://rubocop//lib/rubocop/cop/base.rb#89 + # source://rubocop//lib/rubocop/cop/base.rb#90 def badge; end # @api private # - # source://rubocop//lib/rubocop/cop/base.rb#289 + # source://rubocop//lib/rubocop/cop/base.rb#316 def callbacks_needed; end - # source://rubocop//lib/rubocop/cop/base.rb#93 + # source://rubocop//lib/rubocop/cop/base.rb#94 def cop_name; end - # source://rubocop//lib/rubocop/cop/base.rb#97 + # source://rubocop//lib/rubocop/cop/base.rb#98 def department; end # Cops (other than builtin) are encouraged to implement this @@ -3186,9 +3211,14 @@ class RuboCop::Cop::Base # Call for abstract Cop classes # - # source://rubocop//lib/rubocop/cop/base.rb#77 + # source://rubocop//lib/rubocop/cop/base.rb#78 def exclude_from_registry; end + # Returns the value of attribute gem_requirements. + # + # source://rubocop//lib/rubocop/cop/base.rb#135 + def gem_requirements; end + # @private # # source://rubocop//lib/rubocop/cop/base.rb#71 @@ -3196,12 +3226,12 @@ class RuboCop::Cop::Base # Override and return the Force class(es) you need to join # - # source://rubocop//lib/rubocop/cop/base.rb#114 + # source://rubocop//lib/rubocop/cop/base.rb#115 def joining_forces; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#101 + # source://rubocop//lib/rubocop/cop/base.rb#102 def lint?; end # Returns true if the cop name or the cop namespace matches any of the @@ -3209,15 +3239,30 @@ class RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#107 + # source://rubocop//lib/rubocop/cop/base.rb#108 def match?(given_names); end + # Register a version requirement for the given gem name. + # This cop will be skipped unless the target satisfies *all* requirements. + # + # @api public + # @param gem_name [String] + # @param version_requirements [Array] The version requirements, + # using the same syntax as a Gemfile, e.g. ">= 1.2.3" + # + # If omitted, any version of the gem will be accepted. + # + # https://guides.rubygems.org/patterns/#declaring-dependencies + # + # source://rubocop//lib/rubocop/cop/base.rb#148 + def requires_gem(gem_name, *version_requirements); end + # Returns if class supports autocorrect. # It is recommended to extend AutoCorrector instead of overriding # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#83 + # source://rubocop//lib/rubocop/cop/base.rb#84 def support_autocorrect?; end # Override if your cop should be called repeatedly for multiple investigations @@ -3230,22 +3275,22 @@ class RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#125 + # source://rubocop//lib/rubocop/cop/base.rb#126 def support_multiple_source?; end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#375 + # source://rubocop//lib/rubocop/cop/base.rb#402 def builtin?; end - # source://rubocop//lib/rubocop/cop/base.rb#357 + # source://rubocop//lib/rubocop/cop/base.rb#384 def restrict_on_send; end end end -# source://rubocop//lib/rubocop/cop/base.rb#361 +# source://rubocop//lib/rubocop/cop/base.rb#388 RuboCop::Cop::Base::EMPTY_OFFENSES = T.let(T.unsafe(nil), Array) # Reports of an investigation. @@ -4134,6 +4179,9 @@ module RuboCop::Cop::CodeLength # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#45 def irrelevant_line(source_line); end + # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#58 + def location(node); end + # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#19 def max_length; end @@ -17383,6 +17431,11 @@ RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) # MyDebugger.debug_this # ---- # +# Some gems also ship files that will start a debugging session when required, +# for example `require 'debug/start'` from `ruby/debug`. These requires can +# be configured through `DebuggerRequires`. It has the same structure as +# `DebuggerMethods`, which you can read about above. +# # @example # # # bad (ok during development) @@ -17415,43 +17468,56 @@ RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) # def some_method # my_debugger # end +# @example DebuggerRequires: [my_debugger/start] +# +# # bad (ok during development) # -# source://rubocop//lib/rubocop/cop/lint/debugger.rb#67 +# require 'my_debugger/start' +# +# source://rubocop//lib/rubocop/cop/lint/debugger.rb#78 class RuboCop::Cop::Lint::Debugger < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#71 + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#82 def on_send(node); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#117 + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#142 def assumed_argument?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#96 + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#121 def assumed_usage_context?(node); end - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#106 + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#131 def chained_method_name(send_node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#90 + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#108 def debugger_method?(send_node); end - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#83 + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#94 def debugger_methods; end - # source://rubocop//lib/rubocop/cop/lint/debugger.rb#79 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#114 + def debugger_require?(send_node); end + + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#101 + def debugger_requires; end + + # source://rubocop//lib/rubocop/cop/lint/debugger.rb#90 def message(node); end end -# source://rubocop//lib/rubocop/cop/lint/debugger.rb#69 +# source://rubocop//lib/rubocop/cop/lint/debugger.rb#80 RuboCop::Cop::Lint::Debugger::BLOCK_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop//lib/rubocop/cop/lint/debugger.rb#68 +# source://rubocop//lib/rubocop/cop/lint/debugger.rb#79 RuboCop::Cop::Lint::Debugger::MSG = T.let(T.unsafe(nil), String) # Checks for uses of the deprecated class method usages. @@ -20466,7 +20532,7 @@ class RuboCop::Cop::Lint::MixedCaseRange < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#56 + # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#58 def each_unsafe_regexp_range(node); end # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#37 @@ -20480,31 +20546,31 @@ class RuboCop::Cop::Lint::MixedCaseRange < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#72 + # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#74 def build_source_range(range_start, range_end); end - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#76 + # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#78 def range_for(char); end - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#82 + # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#84 def range_pairs(expr); end - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#102 - def rewrite_regexp_range(source); end + # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#104 + def regexp_range(source); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#92 + # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#94 def skip_expression?(expr); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#96 + # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#98 def skip_range?(range_start, range_end); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#86 + # source://rubocop//lib/rubocop/cop/lint/mixed_case_range.rb#88 def unsafe_range?(range_start, range_end); end end @@ -22481,21 +22547,21 @@ class RuboCop::Cop::Lint::RedundantWithIndex < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#36 + # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#37 def on_block(node); end - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#36 + # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#37 def on_numblock(node); end - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#57 + # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#60 def redundant_with_index?(param0 = T.unsafe(nil)); end private - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#67 + # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#70 def message(node); end - # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#75 + # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#78 def with_index_range(send); end end @@ -24514,7 +24580,7 @@ class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#194 + # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#200 def conditional_continue_keyword?(break_statement); end # @return [Boolean] @@ -24524,7 +24590,7 @@ class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#184 + # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#190 def preceded_by_continue_statement?(break_statement); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#130 @@ -25887,6 +25953,11 @@ module RuboCop::Cop::MethodComplexity # # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#61 def complexity(body); end + + # @api private + # + # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#73 + def location(node); end end # Common code for cops that deal with preferred methods. @@ -27505,43 +27576,66 @@ class RuboCop::Cop::Naming::BlockForwarding < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#55 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#54 def on_def(node); end - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#55 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#54 def on_defs(node); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#95 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#114 def anonymous_block_argument?(node); end - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#127 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#87 + def block_argument_name_matched?(block_pass_node, last_argument); end + + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#146 def block_forwarding_name; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#81 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#77 def expected_block_forwarding_style?(node, last_argument); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#99 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#118 def explicit_block_argument?(node); end - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#103 + # Prevents the following syntax error: + # + # # foo.rb + # def foo(&) + # block_method do + # bar(&) + # end + # end + # + # $ ruby -vc foo.rb + # ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22] + # foo.rb: foo.rb:4: anonymous block parameter is also used within block (SyntaxError) + # + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#106 + def invalidates_syntax?(block_pass_node); end + + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#122 def register_offense(block_argument, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#119 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#138 def use_block_argument_as_local_variable?(node, last_argument); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#91 + # source://rubocop//lib/rubocop/cop/naming/block_forwarding.rb#110 def use_kwarg_in_method_definition?(node); end class << self @@ -27767,8 +27861,6 @@ class RuboCop::Cop::Naming::FileName < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/file_name.rb#165 def find_definition(node); end - # @yield [source_range(processed_source.buffer, 1, 0), msg] - # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#65 def for_bad_filename(file_path); end @@ -28020,13 +28112,13 @@ class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#126 def check_token?(type); end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#244 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#243 def create_message(word, message = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#218 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#217 def create_multiple_word_message_for_file(words); end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#214 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#213 def create_single_word_message_for_file(word); end # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#189 @@ -28035,10 +28127,10 @@ class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#160 def extract_regexp(term, term_definition); end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#252 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#251 def find_flagged_term(word); end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#266 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#265 def format_suggestions(suggestions); end # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#197 @@ -28047,10 +28139,10 @@ class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#100 def investigate_tokens; end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#232 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#231 def mask_input(str); end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#281 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#280 def offense_range(token, word); end # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#130 @@ -28059,13 +28151,13 @@ class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#144 def preprocess_flagged_terms; end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#259 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#258 def preprocess_suggestions(suggestions); end # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#179 def process_allowed_regex(allowed); end - # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#222 + # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#221 def scan_for_words(input); end # source://rubocop//lib/rubocop/cop/naming/inclusive_language.rb#174 @@ -30812,7 +30904,7 @@ class RuboCop::Cop::Style::Alias < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/alias.rb#51 + # source://rubocop//lib/rubocop/cop/style/alias.rb#52 def on_alias(node); end # source://rubocop//lib/rubocop/cop/style/alias.rb#41 @@ -30820,47 +30912,47 @@ class RuboCop::Cop::Style::Alias < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/alias.rb#85 + # source://rubocop//lib/rubocop/cop/style/alias.rb#86 def add_offense_for_args(node, &block); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/alias.rb#75 + # source://rubocop//lib/rubocop/cop/style/alias.rb#76 def alias_keyword_possible?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/alias.rb#79 + # source://rubocop//lib/rubocop/cop/style/alias.rb#80 def alias_method_possible?(node); end - # source://rubocop//lib/rubocop/cop/style/alias.rb#65 + # source://rubocop//lib/rubocop/cop/style/alias.rb#66 def autocorrect(corrector, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/alias.rb#124 + # source://rubocop//lib/rubocop/cop/style/alias.rb#125 def bareword?(sym_node); end - # source://rubocop//lib/rubocop/cop/style/alias.rb#128 + # source://rubocop//lib/rubocop/cop/style/alias.rb#129 def correct_alias_method_to_alias(corrector, send_node); end - # source://rubocop//lib/rubocop/cop/style/alias.rb#135 + # source://rubocop//lib/rubocop/cop/style/alias.rb#136 def correct_alias_to_alias_method(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/alias.rb#142 + # source://rubocop//lib/rubocop/cop/style/alias.rb#143 def correct_alias_with_symbol_args(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/alias.rb#147 + # source://rubocop//lib/rubocop/cop/style/alias.rb#148 def identifier(node); end - # source://rubocop//lib/rubocop/cop/style/alias.rb#113 + # source://rubocop//lib/rubocop/cop/style/alias.rb#114 def lexical_scope_type(node); end # In this expression, will `self` be the same as the innermost enclosing # class or module block (:lexical)? Or will it be something else # (:dynamic)? If we're in an instance_eval block, return that. # - # source://rubocop//lib/rubocop/cop/style/alias.rb#96 + # source://rubocop//lib/rubocop/cop/style/alias.rb#97 def scope_type(node); end end @@ -31109,7 +31201,7 @@ class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#185 def add_forward_all_offenses(node, send_classifications, forwardable_args); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#350 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#351 def add_parens_if_missing(node, corrector); end # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#212 @@ -31117,10 +31209,10 @@ class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#342 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#343 def allow_only_rest_arguments?; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#334 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#335 def arguments_range(node, first_node); end # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#263 @@ -31131,7 +31223,7 @@ class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#494 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#495 def explicit_block_name?; end # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#168 @@ -31156,7 +31248,7 @@ class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#282 def redundant_named_arg(arg, config_name, keyword); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#324 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#325 def register_forward_all_offense(def_or_send, send_or_arguments, rest_or_splat); end # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#298 @@ -31170,7 +31262,7 @@ class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#346 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#347 def use_anonymous_forwarding?; end class << self @@ -31199,115 +31291,115 @@ RuboCop::Cop::Style::ArgumentsForwarding::KWARGS_MSG = T.let(T.unsafe(nil), Stri # Classifies send nodes for possible rest/kwrest/all (including block) forwarding. # -# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#357 +# source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#358 class RuboCop::Cop::Style::ArgumentsForwarding::SendNodeClassifier extend ::RuboCop::AST::NodePattern::Macros # @return [SendNodeClassifier] a new instance of SendNodeClassifier # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#369 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#370 def initialize(def_node, send_node, referenced_lvars, forwardable_args, **config); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#397 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#398 def classification; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#364 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#365 def extract_forwarded_kwrest_arg(param0 = T.unsafe(nil), param1); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#391 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#392 def forwarded_block_arg; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#367 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#368 def forwarded_block_arg?(param0 = T.unsafe(nil), param1); end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#385 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#386 def forwarded_kwrest_arg; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#379 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#380 def forwarded_rest_arg; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#361 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#362 def forwarded_rest_arg?(param0 = T.unsafe(nil), param1); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#465 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#466 def additional_kwargs?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#461 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#462 def additional_kwargs_or_forwarded_kwargs?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#475 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#476 def allow_offense_for_no_block?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#446 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#447 def any_arg_referenced?; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#430 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#431 def arguments; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#409 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#410 def can_forward_all?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#469 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#470 def forward_additional_kwargs?; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#426 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#427 def forwarded_rest_and_kwrest_args; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#488 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#489 def missing_rest_arg_or_kwrest_arg?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#479 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#480 def no_additional_args?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#454 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#455 def no_post_splat_args?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#422 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#423 def offensive_block_forwarding?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#442 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#443 def referenced_block_arg?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#438 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#439 def referenced_kwrest_arg?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#434 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#435 def referenced_rest_arg?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#418 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#419 def ruby_32_missing_rest_or_kwest?; end - # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#450 + # source://rubocop//lib/rubocop/cop/style/arguments_forwarding.rb#451 def target_ruby_version; end end @@ -32905,9 +32997,7 @@ RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # @example # # bad # array.reject(&:nil?) -# array.delete_if(&:nil?) # array.reject { |e| e.nil? } -# array.delete_if { |e| e.nil? } # array.select { |e| !e.nil? } # array.grep_v(nil) # array.grep_v(NilClass) @@ -32917,7 +33007,9 @@ RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # # # bad # hash.reject!(&:nil?) +# array.delete_if(&:nil?) # hash.reject! { |k, v| v.nil? } +# array.delete_if { |e| e.nil? } # hash.select! { |k, v| !v.nil? } # # # good @@ -34075,36 +34167,36 @@ class RuboCop::Cop::Style::Copyright < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/copyright.rb#47 + # source://rubocop//lib/rubocop/cop/style/copyright.rb#45 + def autocorrect(corrector); end + + # source://rubocop//lib/rubocop/cop/style/copyright.rb#56 def autocorrect_notice; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/copyright.rb#78 + # source://rubocop//lib/rubocop/cop/style/copyright.rb#83 def encoding_token?(processed_source, token_index); end - # source://rubocop//lib/rubocop/cop/style/copyright.rb#64 + # source://rubocop//lib/rubocop/cop/style/copyright.rb#69 def insert_notice_before(processed_source); end - # source://rubocop//lib/rubocop/cop/style/copyright.rb#43 + # source://rubocop//lib/rubocop/cop/style/copyright.rb#52 def notice; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/copyright.rb#85 + # source://rubocop//lib/rubocop/cop/style/copyright.rb#90 def notice_found?(processed_source); end - # source://rubocop//lib/rubocop/cop/style/copyright.rb#51 - def offense_range; end - # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/copyright.rb#71 + # source://rubocop//lib/rubocop/cop/style/copyright.rb#76 def shebang_token?(processed_source, token_index); end # @raise [Warning] # - # source://rubocop//lib/rubocop/cop/style/copyright.rb#55 + # source://rubocop//lib/rubocop/cop/style/copyright.rb#60 def verify_autocorrect_notice!; end end @@ -35827,19 +35919,19 @@ class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#184 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#186 def add_offense_for_different_line(node, line_node, line_diff); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#131 def add_offense_for_incorrect_line(method_name, line_node, sign, line_diff); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#199 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#201 def add_offense_for_missing_line(node, code); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#206 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#208 def add_offense_for_missing_location(node, code); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#178 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#180 def add_offense_for_same_line(node, line_node); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#143 @@ -35851,16 +35943,16 @@ class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#95 def check_location(node, code); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#191 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#193 def expected_line(sign, line_diff); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#122 def file_and_line(node); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#166 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#168 def line_difference(line_node, code); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#218 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#220 def missing_line(node, code); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#109 @@ -35876,7 +35968,7 @@ class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#118 def special_line_keyword?(node); end - # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#170 + # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#172 def string_first_line(str_node); end # @return [Boolean] @@ -35971,10 +36063,10 @@ class RuboCop::Cop::Style::ExactRegexpMatch < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#56 + # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#57 def exact_match_pattern?(parsed_regexp); end - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#63 + # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#64 def new_method(node); end end @@ -36736,25 +36828,25 @@ RuboCop::Cop::Style::For::PREFER_FOR = T.let(T.unsafe(nil), String) # # @example EnforcedStyle: format (default) # # bad -# puts sprintf('%10s', 'hoge') -# puts '%10s' % 'hoge' +# puts sprintf('%10s', 'foo') +# puts '%10s' % 'foo' # # # good -# puts format('%10s', 'hoge') +# puts format('%10s', 'foo') # @example EnforcedStyle: sprintf # # bad -# puts format('%10s', 'hoge') -# puts '%10s' % 'hoge' +# puts format('%10s', 'foo') +# puts '%10s' % 'foo' # # # good -# puts sprintf('%10s', 'hoge') +# puts sprintf('%10s', 'foo') # @example EnforcedStyle: percent # # bad -# puts format('%10s', 'hoge') -# puts sprintf('%10s', 'hoge') +# puts format('%10s', 'foo') +# puts sprintf('%10s', 'foo') # # # good -# puts '%10s' % 'hoge' +# puts '%10s' % 'foo' # # source://rubocop//lib/rubocop/cop/style/format_string.rb#50 class RuboCop::Cop::Style::FormatString < ::RuboCop::Cop::Base @@ -39700,6 +39792,109 @@ end # source://rubocop//lib/rubocop/cop/style/map_compact_with_conditional_block.rb#43 RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil), String) +# Checks for usages of `each` with `<<`, `push`, or `append` which +# can be replaced by `map`. +# +# If `PreferredMethods` is configured for `map` in `Style/CollectionMethods`, +# this cop uses the specified method for replacement. +# +# NOTE: The return value of `Enumerable#each` is `self`, whereas the +# return value of `Enumerable#map` is an `Array`. They are not autocorrected +# when a return value could be used because these types differ. +# +# NOTE: It only detects when the mapping destination is a local variable +# initialized as an empty array and referred to only by the pushing operation. +# This is because, if not, it's challenging to statically guarantee that the +# mapping destination variable remains an empty array: +# +# [source,ruby] +# ---- +# ret = [] +# src.each { |e| ret << e * 2 } # `<<` method may mutate `ret` +# +# dest = [] +# src.each { |e| dest << transform(e, dest) } # `transform` method may mutate `dest` +# ---- +# +# @example +# # bad +# dest = [] +# src.each { |e| dest << e * 2 } +# dest +# +# # good +# dest = src.map { |e| e * 2 } +# +# # good - contains another operation +# dest = [] +# src.each { |e| dest << e * 2; puts e } +# dest +# +# source://rubocop//lib/rubocop/cop/style/map_into_array.rb#50 +class RuboCop::Cop::Style::MapIntoArray < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#75 + def after_leaving_scope(scope, _variable_table); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#57 + def each_block_with_push?(param0 = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#66 + def empty_array_asgn?(param0 = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#69 + def lvar_ref?(param0 = T.unsafe(nil), param1); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#79 + def on_block(node); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#79 + def on_numblock(node); end + + private + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#155 + def correct_push_node(corrector, push_node); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#163 + def correct_return_value_handling(corrector, block, dest_var); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#108 + def dest_used_only_for_mapping?(block, dest_var, asgn); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#102 + def find_closest_assignment(block, dest_var); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#94 + def find_dest_var(block); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#127 + def new_method_name; end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#116 + def register_offense(block, dest_var, asgn); end + + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#148 + def remove_assignment(corrector, asgn); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#133 + def return_value_used?(node); end + + class << self + # source://rubocop//lib/rubocop/cop/style/map_into_array.rb#71 + def joining_forces; end + end +end + +# source://rubocop//lib/rubocop/cop/style/map_into_array.rb#54 +RuboCop::Cop::Style::MapIntoArray::MSG = T.let(T.unsafe(nil), String) + # Looks for uses of `map.to_h` or `collect.to_h` that could be # written with just `to_h` in Ruby >= 2.6. # @@ -41630,7 +41825,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector - # source://rubocop-sorbet/0.7.8/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 + # source://rubocop-sorbet/0.8.1/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 def on_assignment(value); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#127 @@ -41648,7 +41843,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#217 def splat_value(param0 = T.unsafe(nil)); end - # source://rubocop-sorbet/0.7.8/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 + # source://rubocop-sorbet/0.8.1/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 def t_let(param0 = T.unsafe(nil)); end private @@ -44313,10 +44508,20 @@ class RuboCop::Cop::Style::RedundantArgument < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#94 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#108 + def argument_matched?(target_argument, redundant_argument); end + + # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#100 def argument_range(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#87 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#120 + def exclude_cntrl_character?(target_argument, redundant_argument); end + + # source://rubocop//lib/rubocop/cop/style/redundant_argument.rb#93 def redundant_arg_for_method(method_name); end # @return [Boolean] @@ -44925,16 +45130,19 @@ class RuboCop::Cop::Style::RedundantCurrentDirectoryInPath < ::RuboCop::Cop::Bas include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#23 + # source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#24 def on_send(node); end end -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#21 +# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#22 RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::CURRENT_DIRECTORY_PATH = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#20 RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::MSG = T.let(T.unsafe(nil), String) +# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#21 +RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks for redundant uses of double splat hash braces. # # @example @@ -45697,17 +45905,12 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#168 - def allowed_type?(node); end - - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#186 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#180 def argument_is_method?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#146 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#144 def argument_newline?(node); end # @return [Boolean] @@ -45715,12 +45918,12 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#101 def ends_with_backslash_without_comment?(source_line); end - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#162 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#160 def find_node_for_line(line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#133 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#131 def inside_string_literal?(range, token); end # @return [Boolean] @@ -45735,7 +45938,7 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#193 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#187 def method_call_with_arguments?(node); end # A method call without parentheses such as the following cannot remove `\`: @@ -45745,7 +45948,7 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#141 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#139 def method_with_argument?(current_token, next_token); end # @return [Boolean] @@ -45760,12 +45963,12 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#172 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#166 def same_line?(node, line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#197 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#191 def start_with_arithmetic_operator?(source_line); end # @return [Boolean] @@ -51810,22 +52013,22 @@ class RuboCop::Cop::Team # source://rubocop//lib/rubocop/cop/team.rb#121 def autocorrect(processed_source, report, original:, offset:); end - # source://rubocop//lib/rubocop/cop/team.rb#182 + # source://rubocop//lib/rubocop/cop/team.rb#185 def autocorrect_report(report, offset:, original:); end # source://rubocop//lib/rubocop/cop/team.rb#140 def be_ready; end - # source://rubocop//lib/rubocop/cop/team.rb#188 + # source://rubocop//lib/rubocop/cop/team.rb#191 def collate_corrections(report, offset:, original:); end - # source://rubocop//lib/rubocop/cop/team.rb#204 + # source://rubocop//lib/rubocop/cop/team.rb#207 def each_corrector(report); end - # source://rubocop//lib/rubocop/cop/team.rb#254 + # source://rubocop//lib/rubocop/cop/team.rb#257 def handle_error(error, location, cop); end - # source://rubocop//lib/rubocop/cop/team.rb#246 + # source://rubocop//lib/rubocop/cop/team.rb#249 def handle_warning(error, location); end # @return [Commissioner::InvestigationReport] @@ -51833,7 +52036,7 @@ class RuboCop::Cop::Team # source://rubocop//lib/rubocop/cop/team.rb#154 def investigate_partial(cops, processed_source, offset:, original:); end - # source://rubocop//lib/rubocop/cop/team.rb#231 + # source://rubocop//lib/rubocop/cop/team.rb#234 def process_errors(file, errors); end # source://rubocop//lib/rubocop/cop/team.rb#148 @@ -51854,10 +52057,10 @@ class RuboCop::Cop::Team # source://rubocop//lib/rubocop/cop/team.rb#170 def support_target_ruby_version?(cop); end - # source://rubocop//lib/rubocop/cop/team.rb#219 + # source://rubocop//lib/rubocop/cop/team.rb#222 def suppress_clobbering; end - # source://rubocop//lib/rubocop/cop/team.rb#225 + # source://rubocop//lib/rubocop/cop/team.rb#228 def validate_config; end class << self @@ -54379,10 +54582,10 @@ class RuboCop::Formatter::ClangStyleFormatter < ::RuboCop::Formatter::SimpleText private - # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#51 + # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#47 def report_highlighted_area(highlighted_area); end - # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#41 + # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#37 def report_line(location); end # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#17 @@ -54390,7 +54593,7 @@ class RuboCop::Formatter::ClangStyleFormatter < ::RuboCop::Formatter::SimpleText # @return [Boolean] # - # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#37 + # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#33 def valid_line?(offense); end end @@ -55333,10 +55536,10 @@ class RuboCop::Formatter::TapFormatter < ::RuboCop::Formatter::ClangStyleFormatt private - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#66 + # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#62 def annotate_message(msg); end - # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#70 + # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#66 def message(offense); end # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#39 @@ -55682,31 +55885,59 @@ RuboCop::LSP::Severity::SEVERITIES = T.let(T.unsafe(nil), Hash) # # source://rubocop//lib/rubocop/lockfile.rb#7 class RuboCop::Lockfile - # Gems that the bundle depends on - # # @api private + # @param lockfile_path [String, Pathname, nil] + # @return [Lockfile] a new instance of Lockfile # # source://rubocop//lib/rubocop/lockfile.rb#9 + def initialize(lockfile_path = T.unsafe(nil)); end + + # Gems that the bundle directly depends on. + # + # @api private + # @return [Array, nil] + # + # source://rubocop//lib/rubocop/lockfile.rb#17 def dependencies; end - # All activated gems, including transitive dependencies + # Returns the locked versions of gems from this lockfile. # # @api private + # @param include_transitive_dependencies: [Boolean] When false, only direct dependencies + # are returned, i.e. those listed explicitly in the `Gemfile`. # - # source://rubocop//lib/rubocop/lockfile.rb#16 + # source://rubocop//lib/rubocop/lockfile.rb#37 + def gem_versions(include_transitive_dependencies: T.unsafe(nil)); end + + # All activated gems, including transitive dependencies. + # + # @api private + # @return [Array, nil] + # + # source://rubocop//lib/rubocop/lockfile.rb#25 def gems; end + # Whether this lockfile includes the named gem, directly or indirectly. + # # @api private + # @param name [String] # @return [Boolean] # - # source://rubocop//lib/rubocop/lockfile.rb#24 + # source://rubocop//lib/rubocop/lockfile.rb#53 def includes_gem?(name); end private # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/lockfile.rb#73 + def bundler_lock_parser_defined?; end + + # @api private + # @return [Bundler::LockfileParser, nil] # - # source://rubocop//lib/rubocop/lockfile.rb#30 + # source://rubocop//lib/rubocop/lockfile.rb#60 def parser; end end @@ -56558,36 +56789,36 @@ module RuboCop::RSpec; end # # source://rubocop//lib/rubocop/rspec/expect_offense.rb#103 module RuboCop::RSpec::ExpectOffense - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#130 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#138 def expect_correction(correction, loop: T.unsafe(nil), source: T.unsafe(nil)); end # @raise [RuboCop::Runner::InfiniteCorrectionLoop] # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#167 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#175 def expect_no_corrections; end - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#181 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#189 def expect_no_offenses(source, file = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#114 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#115 def expect_offense(source, file = T.unsafe(nil), severity: T.unsafe(nil), chomp: T.unsafe(nil), **replacements); end # source://rubocop//lib/rubocop/rspec/expect_offense.rb#104 def format_offense(source, **replacements); end - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#189 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#197 def parse_annotations(source, raise_error: T.unsafe(nil), **replacements); end - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#199 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#207 def parse_processed_source(source, file = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#207 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#215 def set_formatter_options; end end # Parsed representation of code annotated with the `^^^ Message` style # -# source://rubocop//lib/rubocop/rspec/expect_offense.rb#214 +# source://rubocop//lib/rubocop/rspec/expect_offense.rb#222 class RuboCop::RSpec::ExpectOffense::AnnotatedSource # @note annotations are sorted so that reconstructing the annotation # text via {#to_s} is deterministic @@ -56595,10 +56826,10 @@ class RuboCop::RSpec::ExpectOffense::AnnotatedSource # @param annotations [Array<(Integer, String)>] each entry is the annotated line number and the annotation text # @return [AnnotatedSource] a new instance of AnnotatedSource # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#246 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#254 def initialize(lines, annotations); end - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#251 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#259 def ==(other); end # Construct annotated source string (like what we parse) @@ -56623,7 +56854,7 @@ class RuboCop::RSpec::ExpectOffense::AnnotatedSource # source1.to_s == source2.to_s # => true # @return [String] # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#293 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#301 def inspect; end # Dirty hack: expectations with [...] are rewritten when they match @@ -56631,14 +56862,14 @@ class RuboCop::RSpec::ExpectOffense::AnnotatedSource # # @return [Boolean] # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#257 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#265 def match_annotations?(other); end # Return the plain source code without annotations # # @return [String] # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#307 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#315 def plain_source; end # Construct annotated source string (like what we parse) @@ -56664,7 +56895,7 @@ class RuboCop::RSpec::ExpectOffense::AnnotatedSource # source1.to_s == source2.to_s # => true # @return [String] # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#293 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#301 def to_s; end # Annotate the source code with the RuboCop offenses provided @@ -56672,19 +56903,19 @@ class RuboCop::RSpec::ExpectOffense::AnnotatedSource # @param offenses [Array] # @return [self] # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#316 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#324 def with_offense_annotations(offenses); end protected # Returns the value of attribute annotations. # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#331 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#339 def annotations; end # Returns the value of attribute lines. # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#331 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#339 def lines; end class << self @@ -56694,15 +56925,15 @@ class RuboCop::RSpec::ExpectOffense::AnnotatedSource # @param annotated_source [String] string passed to the matchers # @return [AnnotatedSource] # - # source://rubocop//lib/rubocop/rspec/expect_offense.rb#224 + # source://rubocop//lib/rubocop/rspec/expect_offense.rb#232 def parse(annotated_source); end end end -# source://rubocop//lib/rubocop/rspec/expect_offense.rb#216 +# source://rubocop//lib/rubocop/rspec/expect_offense.rb#224 RuboCop::RSpec::ExpectOffense::AnnotatedSource::ABBREV = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/rspec/expect_offense.rb#215 +# source://rubocop//lib/rubocop/rspec/expect_offense.rb#223 RuboCop::RSpec::ExpectOffense::AnnotatedSource::ANNOTATION_PATTERN = T.let(T.unsafe(nil), Regexp) # Common methods and behaviors for dealing with remote config files. @@ -56977,145 +57208,145 @@ RuboCop::ResultCache::NON_CHANGING = T.let(T.unsafe(nil), Array) class RuboCop::Runner # @return [Runner] a new instance of Runner # - # source://rubocop//lib/rubocop/runner.rb#59 + # source://rubocop//lib/rubocop/runner.rb#62 def initialize(options, config_store); end # Sets the attribute aborting # # @param value the value to set the attribute aborting to. # - # source://rubocop//lib/rubocop/runner.rb#57 + # source://rubocop//lib/rubocop/runner.rb#60 def aborting=(_arg0); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#83 + # source://rubocop//lib/rubocop/runner.rb#86 def aborting?; end # Returns the value of attribute errors. # - # source://rubocop//lib/rubocop/runner.rb#56 + # source://rubocop//lib/rubocop/runner.rb#59 def errors; end - # source://rubocop//lib/rubocop/runner.rb#67 + # source://rubocop//lib/rubocop/runner.rb#70 def run(paths); end # Returns the value of attribute warnings. # - # source://rubocop//lib/rubocop/runner.rb#56 + # source://rubocop//lib/rubocop/runner.rb#59 def warnings; end private - # source://rubocop//lib/rubocop/runner.rb#196 + # source://rubocop//lib/rubocop/runner.rb#199 def add_redundant_disables(file, offenses, source); end - # source://rubocop//lib/rubocop/runner.rb#170 + # source://rubocop//lib/rubocop/runner.rb#173 def cached_result(file, team); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#250 + # source://rubocop//lib/rubocop/runner.rb#253 def cached_run?; end # Check whether a run created source identical to a previous run, which # means that we definitely have an infinite loop. # - # source://rubocop//lib/rubocop/runner.rb#328 + # source://rubocop//lib/rubocop/runner.rb#331 def check_for_infinite_loop(processed_source, offenses_by_iteration); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#222 + # source://rubocop//lib/rubocop/runner.rb#225 def check_for_redundant_disables?(source); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#423 + # source://rubocop//lib/rubocop/runner.rb#426 def considered_failure?(offense); end - # source://rubocop//lib/rubocop/runner.rb#456 + # source://rubocop//lib/rubocop/runner.rb#459 def default_config(cop_name); end - # source://rubocop//lib/rubocop/runner.rb#272 + # source://rubocop//lib/rubocop/runner.rb#275 def do_inspection_loop(file); end - # source://rubocop//lib/rubocop/runner.rb#133 + # source://rubocop//lib/rubocop/runner.rb#136 def each_inspected_file(files); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#236 + # source://rubocop//lib/rubocop/runner.rb#239 def except_redundant_cop_disable_directive?; end - # source://rubocop//lib/rubocop/runner.rb#357 + # source://rubocop//lib/rubocop/runner.rb#360 def extract_ruby_sources(processed_source); end - # source://rubocop//lib/rubocop/runner.rb#245 + # source://rubocop//lib/rubocop/runner.rb#248 def file_finished(file, offenses); end - # source://rubocop//lib/rubocop/runner.rb#174 + # source://rubocop//lib/rubocop/runner.rb#177 def file_offense_cache(file); end - # source://rubocop//lib/rubocop/runner.rb#162 + # source://rubocop//lib/rubocop/runner.rb#165 def file_offenses(file); end - # source://rubocop//lib/rubocop/runner.rb#240 + # source://rubocop//lib/rubocop/runner.rb#243 def file_started(file); end - # source://rubocop//lib/rubocop/runner.rb#403 + # source://rubocop//lib/rubocop/runner.rb#406 def filter_cop_classes(cop_classes, config); end - # source://rubocop//lib/rubocop/runner.rb#104 + # source://rubocop//lib/rubocop/runner.rb#107 def find_target_files(paths); end - # source://rubocop//lib/rubocop/runner.rb#414 + # source://rubocop//lib/rubocop/runner.rb#417 def formatter_set; end - # source://rubocop//lib/rubocop/runner.rb#471 + # source://rubocop//lib/rubocop/runner.rb#474 def get_processed_source(file); end - # source://rubocop//lib/rubocop/runner.rb#342 + # source://rubocop//lib/rubocop/runner.rb#345 def inspect_file(processed_source, team = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/runner.rb#115 + # source://rubocop//lib/rubocop/runner.rb#118 def inspect_files(files); end - # source://rubocop//lib/rubocop/runner.rb#303 + # source://rubocop//lib/rubocop/runner.rb#306 def iterate_until_no_changes(source, offenses_by_iteration); end - # source://rubocop//lib/rubocop/runner.rb#148 + # source://rubocop//lib/rubocop/runner.rb#151 def list_files(paths); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#452 + # source://rubocop//lib/rubocop/runner.rb#455 def mark_as_safe_by_config?(config); end - # source://rubocop//lib/rubocop/runner.rb#460 + # source://rubocop//lib/rubocop/runner.rb#463 def minimum_severity_to_fail; end - # source://rubocop//lib/rubocop/runner.rb#364 + # source://rubocop//lib/rubocop/runner.rb#367 def mobilize_team(processed_source); end - # source://rubocop//lib/rubocop/runner.rb#369 + # source://rubocop//lib/rubocop/runner.rb#372 def mobilized_cop_classes(config); end - # source://rubocop//lib/rubocop/runner.rb#432 + # source://rubocop//lib/rubocop/runner.rb#435 def offenses_to_report(offenses); end - # source://rubocop//lib/rubocop/runner.rb#152 + # source://rubocop//lib/rubocop/runner.rb#155 def process_file(file); end - # source://rubocop//lib/rubocop/runner.rb#393 + # source://rubocop//lib/rubocop/runner.rb#396 def qualify_option_cop_names; end # @yield [cop] # - # source://rubocop//lib/rubocop/runner.rb#228 + # source://rubocop//lib/rubocop/runner.rb#231 def redundant_cop_disable_directive(file); end - # source://rubocop//lib/rubocop/runner.rb#262 + # source://rubocop//lib/rubocop/runner.rb#265 def save_in_cache(cache, offenses); end # A Cop::Team instance is stateful and may change when inspecting. @@ -57123,41 +57354,41 @@ class RuboCop::Runner # otherwise dormant team that can be used for config- and option- # level caching in ResultCache. # - # source://rubocop//lib/rubocop/runner.rb#499 + # source://rubocop//lib/rubocop/runner.rb#502 def standby_team(config); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#410 + # source://rubocop//lib/rubocop/runner.rb#413 def style_guide_cops_only?(config); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#444 + # source://rubocop//lib/rubocop/runner.rb#447 def supports_safe_autocorrect?(offense); end # @yield [team] # - # source://rubocop//lib/rubocop/runner.rb#211 + # source://rubocop//lib/rubocop/runner.rb#214 def team_for_redundant_disables(file, offenses, source); end # Warms up the RuboCop cache by forking a suitable number of RuboCop # instances that each inspects its allotted group of files. # - # source://rubocop//lib/rubocop/runner.rb#91 + # source://rubocop//lib/rubocop/runner.rb#94 def warm_cache(target_files); end class << self # @return [Array<#call>] # - # source://rubocop//lib/rubocop/runner.rb#29 + # source://rubocop//lib/rubocop/runner.rb#32 def ruby_extractors; end private # @return [#call] # - # source://rubocop//lib/rubocop/runner.rb#36 + # source://rubocop//lib/rubocop/runner.rb#39 def default_ruby_extractor; end end end @@ -57180,12 +57411,12 @@ end # @api private # -# source://rubocop//lib/rubocop/runner.rb#49 +# source://rubocop//lib/rubocop/runner.rb#52 RuboCop::Runner::MAX_ITERATIONS = T.let(T.unsafe(nil), Integer) # @api private # -# source://rubocop//lib/rubocop/runner.rb#52 +# source://rubocop//lib/rubocop/runner.rb#55 RuboCop::Runner::REDUNDANT_COP_DISABLE_DIRECTIVE_RULES = T.let(T.unsafe(nil), Array) # Take a string with embedded escapes, and convert the escapes as the Ruby diff --git a/sorbet/rbi/gems/tapioca@0.13.1.rbi b/sorbet/rbi/gems/tapioca@0.13.3.rbi similarity index 98% rename from sorbet/rbi/gems/tapioca@0.13.1.rbi rename to sorbet/rbi/gems/tapioca@0.13.3.rbi index 2ea240e88..64b8e7d8b 100644 --- a/sorbet/rbi/gems/tapioca@0.13.1.rbi +++ b/sorbet/rbi/gems/tapioca@0.13.3.rbi @@ -54,7 +54,7 @@ module RBI; end # source://tapioca//lib/tapioca/rbi_ext/model.rb#5 class RBI::Tree < ::RBI::NodeWithComments - # source://rbi/0.1.9/lib/rbi/model.rb#119 + # source://rbi/0.1.11/lib/rbi/model.rb#119 sig do params( loc: T.nilable(::RBI::Loc), @@ -64,19 +64,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi/0.1.9/lib/rbi/model.rb#126 + # source://rbi/0.1.11/lib/rbi/model.rb#126 sig { params(node: ::RBI::Node).void } def <<(node); end - # source://rbi/0.1.9/lib/rbi/printer.rb#226 + # source://rbi/0.1.11/lib/rbi/printer.rb#226 sig { override.params(v: ::RBI::Printer).void } def accept_printer(v); end - # source://rbi/0.1.9/lib/rbi/rewriters/add_sig_templates.rb#66 + # source://rbi/0.1.11/lib/rbi/rewriters/add_sig_templates.rb#66 sig { params(with_todo_comment: T::Boolean).void } def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end - # source://rbi/0.1.9/lib/rbi/rewriters/annotate.rb#49 + # source://rbi/0.1.11/lib/rbi/rewriters/annotate.rb#49 sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void } def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end @@ -115,7 +115,7 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil)); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#112 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#113 sig do params( name: ::String, @@ -140,9 +140,9 @@ class RBI::Tree < ::RBI::NodeWithComments sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) } def create_path(constant, &block); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#133 - sig { params(parameters: T::Array[::RBI::TypedParam], return_type: ::String).returns(::RBI::Sig) } - def create_sig(parameters: T.unsafe(nil), return_type: T.unsafe(nil)); end + # source://tapioca//lib/tapioca/rbi_ext/model.rb#134 + sig { params(parameters: T::Hash[T.any(::String, ::Symbol), ::String], return_type: ::String).returns(::RBI::Sig) } + def create_sig(parameters:, return_type: T.unsafe(nil)); end # source://tapioca//lib/tapioca/rbi_ext/model.rb#74 sig do @@ -157,27 +157,27 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end - # source://rbi/0.1.9/lib/rbi/rewriters/deannotate.rb#41 + # source://rbi/0.1.11/lib/rbi/rewriters/deannotate.rb#41 sig { params(annotation: ::String).void } def deannotate!(annotation); end - # source://rbi/0.1.9/lib/rbi/model.rb#132 + # source://rbi/0.1.11/lib/rbi/model.rb#132 sig { returns(T::Boolean) } def empty?; end - # source://rbi/0.1.9/lib/rbi/rewriters/filter_versions.rb#118 + # source://rbi/0.1.11/lib/rbi/rewriters/filter_versions.rb#118 sig { params(version: ::Gem::Version).void } def filter_versions!(version); end - # source://rbi/0.1.9/lib/rbi/rewriters/group_nodes.rb#38 + # source://rbi/0.1.11/lib/rbi/rewriters/group_nodes.rb#38 sig { void } def group_nodes!; end - # source://rbi/0.1.9/lib/rbi/index.rb#68 + # source://rbi/0.1.11/lib/rbi/index.rb#68 sig { returns(::RBI::Index) } def index; end - # source://rbi/0.1.9/lib/rbi/rewriters/merge_trees.rb#324 + # source://rbi/0.1.11/lib/rbi/rewriters/merge_trees.rb#324 sig do params( other: ::RBI::Tree, @@ -188,44 +188,44 @@ class RBI::Tree < ::RBI::NodeWithComments end def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end - # source://rbi/0.1.9/lib/rbi/rewriters/nest_non_public_methods.rb#46 + # source://rbi/0.1.11/lib/rbi/rewriters/nest_non_public_methods.rb#46 sig { void } def nest_non_public_methods!; end - # source://rbi/0.1.9/lib/rbi/rewriters/nest_singleton_methods.rb#36 + # source://rbi/0.1.11/lib/rbi/rewriters/nest_singleton_methods.rb#36 sig { void } def nest_singleton_methods!; end - # source://rbi/0.1.9/lib/rbi/model.rb#110 + # source://rbi/0.1.11/lib/rbi/model.rb#110 sig { returns(T::Array[::RBI::Node]) } def nodes; end - # source://rbi/0.1.9/lib/rbi/printer.rb#233 + # source://rbi/0.1.11/lib/rbi/printer.rb#233 sig { override.returns(T::Boolean) } def oneline?; end - # source://rbi/0.1.9/lib/rbi/rewriters/sort_nodes.rb#119 + # source://rbi/0.1.11/lib/rbi/rewriters/sort_nodes.rb#119 sig { void } def sort_nodes!; end private - # source://tapioca//lib/tapioca/rbi_ext/model.rb#148 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#149 sig { params(node: ::RBI::Node).returns(::RBI::Node) } def create_node(node); end - # source://tapioca//lib/tapioca/rbi_ext/model.rb#143 + # source://tapioca//lib/tapioca/rbi_ext/model.rb#144 sig { returns(T::Hash[::String, ::RBI::Node]) } def nodes_cache; end end -# source://tapioca//lib/tapioca/rbi_ext/model.rb#158 +# source://tapioca//lib/tapioca/rbi_ext/model.rb#159 class RBI::TypedParam < ::T::Struct const :param, ::RBI::Param const :type, ::String class << self - # source://sorbet-runtime/0.5.11319/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11352/lib/types/struct.rb#13 def inherited(s); end end end @@ -1142,7 +1142,7 @@ class Tapioca::ConfigHelper::ConfigError < ::T::Struct const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart] class << self - # source://sorbet-runtime/0.5.11319/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11352/lib/types/struct.rb#13 def inherited(s); end end end @@ -1153,7 +1153,7 @@ class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct const :colors, T::Array[::Symbol] class << self - # source://sorbet-runtime/0.5.11319/lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11352/lib/types/struct.rb#13 def inherited(s); end end end @@ -2453,7 +2453,7 @@ class Tapioca::Loaders::Loader # @param engine [T.class_of(Rails::Engine)] # @return [Array] # - # source://sorbet-runtime/0.5.11319/lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11352/lib/types/private/methods/_methods.rb#257 def eager_load_paths(*args, **_arg1, &blk); end # source://tapioca//lib/tapioca/loaders/loader.rb#198 @@ -3361,7 +3361,7 @@ module Tapioca::Static::SymbolLoader # @return [Array] # - # source://sorbet-runtime/0.5.11319/lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11352/lib/types/private/methods/_methods.rb#257 def engines(*args, **_arg1, &blk); end # source://tapioca//lib/tapioca/static/symbol_loader.rb#82