From 381528f528db27e7b83e13171e5378846c20e03e Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Tue, 5 Nov 2024 11:40:50 -0500 Subject: [PATCH] Upgrade gems and remove webmock --- Gemfile | 3 +- Gemfile.lock | 74 +- sorbet/rbi/gems/addressable@2.8.6.rbi | 1994 ----- sorbet/rbi/gems/crack@1.0.0.rbi | 145 - sorbet/rbi/gems/hashdiff@1.1.0.rbi | 353 - .../gems/{json@2.7.2.rbi => json@2.7.6.rbi} | 195 +- ...arallel@1.24.0.rbi => parallel@1.26.3.rbi} | 52 +- ...{parser@3.3.1.0.rbi => parser@3.3.6.0.rbi} | 0 sorbet/rbi/gems/public_suffix@5.0.5.rbi | 936 --- sorbet/rbi/gems/rack@3.1.7.rbi | 6 +- .../rbi/gems/{rbi@0.2.0.rbi => rbi@0.2.1.rbi} | 456 +- ...rser@2.9.0.rbi => regexp_parser@2.9.2.rbi} | 4 +- sorbet/rbi/gems/rexml@3.3.8.rbi | 4961 ------------- ...-ast@1.31.3.rbi => rubocop-ast@1.34.0.rbi} | 1913 +++-- ...0.35.0.rbi => rubocop-minitest@0.36.0.rbi} | 22 +- ...bet@0.8.3.rbi => rubocop-sorbet@0.8.7.rbi} | 235 +- ...{rubocop@1.63.4.rbi => rubocop@1.68.0.rbi} | 6612 ++++++++++------- sorbet/rbi/gems/ruby-lsp@0.21.2.rbi | 16 +- .../gems/{spoom@1.3.0.rbi => spoom@1.5.0.rbi} | 4251 ++++++----- ...{tapioca@0.16.2.rbi => tapioca@0.16.3.rbi} | 91 +- ....0.rbi => unicode-display_width@2.6.0.rbi} | 0 sorbet/rbi/gems/webmock@3.23.1.rbi | 1776 ----- ...sorbet@0.8.1.rbi => yard-sorbet@0.9.0.rbi} | 64 +- .../gems/{yard@0.9.36.rbi => yard@0.9.37.rbi} | 628 +- ...zeitwerk@2.6.18.rbi => zeitwerk@2.7.1.rbi} | 156 +- sorbet/tapioca/require.rb | 1 - test/test_helper.rb | 1 - 27 files changed, 8815 insertions(+), 16130 deletions(-) delete mode 100644 sorbet/rbi/gems/addressable@2.8.6.rbi delete mode 100644 sorbet/rbi/gems/crack@1.0.0.rbi delete mode 100644 sorbet/rbi/gems/hashdiff@1.1.0.rbi rename sorbet/rbi/gems/{json@2.7.2.rbi => json@2.7.6.rbi} (91%) rename sorbet/rbi/gems/{parallel@1.24.0.rbi => parallel@1.26.3.rbi} (84%) rename sorbet/rbi/gems/{parser@3.3.1.0.rbi => parser@3.3.6.0.rbi} (100%) delete mode 100644 sorbet/rbi/gems/public_suffix@5.0.5.rbi rename sorbet/rbi/gems/{rbi@0.2.0.rbi => rbi@0.2.1.rbi} (88%) rename sorbet/rbi/gems/{regexp_parser@2.9.0.rbi => regexp_parser@2.9.2.rbi} (99%) delete mode 100644 sorbet/rbi/gems/rexml@3.3.8.rbi rename sorbet/rbi/gems/{rubocop-ast@1.31.3.rbi => rubocop-ast@1.34.0.rbi} (78%) rename sorbet/rbi/gems/{rubocop-minitest@0.35.0.rbi => rubocop-minitest@0.36.0.rbi} (99%) rename sorbet/rbi/gems/{rubocop-sorbet@0.8.3.rbi => rubocop-sorbet@0.8.7.rbi} (91%) rename sorbet/rbi/gems/{rubocop@1.63.4.rbi => rubocop@1.68.0.rbi} (93%) rename sorbet/rbi/gems/{spoom@1.3.0.rbi => spoom@1.5.0.rbi} (76%) rename sorbet/rbi/gems/{tapioca@0.16.2.rbi => tapioca@0.16.3.rbi} (98%) rename sorbet/rbi/gems/{unicode-display_width@2.5.0.rbi => unicode-display_width@2.6.0.rbi} (100%) delete mode 100644 sorbet/rbi/gems/webmock@3.23.1.rbi rename sorbet/rbi/gems/{yard-sorbet@0.8.1.rbi => yard-sorbet@0.9.0.rbi} (91%) rename sorbet/rbi/gems/{yard@0.9.36.rbi => yard@0.9.37.rbi} (97%) rename sorbet/rbi/gems/{zeitwerk@2.6.18.rbi => zeitwerk@2.7.1.rbi} (88%) diff --git a/Gemfile b/Gemfile index c34d0d2d..cd3451b9 100644 --- a/Gemfile +++ b/Gemfile @@ -11,14 +11,13 @@ gem "sqlite3" gem "debug", ">= 1.7.0" gem "mocha" gem "rubocop-shopify", "~> 2.15", require: false -gem "rubocop-minitest", "~> 0.35.0", require: false +gem "rubocop-minitest", "~> 0.36.0", require: false gem "rubocop-rake", "~> 0.6.0", require: false gem "rubocop-sorbet", "~> 0.8", require: false gem "sorbet-static-and-runtime", platforms: :ruby gem "tapioca", "~> 0.13", require: false, platforms: :ruby gem "psych", "~> 5.1", require: false gem "rails", "8.0.0.beta1" -gem "webmock" platforms :mingw, :x64_mingw, :mswin, :jruby do gem "tzinfo" diff --git a/Gemfile.lock b/Gemfile.lock index 68927124..e6f75b22 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,8 +78,6 @@ GEM securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) base64 (0.2.0) benchmark (0.3.0) @@ -87,9 +85,6 @@ GEM builder (3.3.0) concurrent-ruby (1.3.4) connection_pool (2.4.1) - crack (1.0.0) - bigdecimal - rexml crass (1.0.6) date (3.3.4) debug (1.9.2) @@ -99,14 +94,13 @@ GEM erubi (1.13.0) globalid (1.2.1) activesupport (>= 6.1) - hashdiff (1.1.0) i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.7.2) irb (1.14.1) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.7.2) + json (2.7.6) language_server-protocol (3.17.0.3) logger (1.6.1) loofah (2.22.0) @@ -141,14 +135,13 @@ GEM racc (~> 1.4) nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) - parallel (1.24.0) - parser (3.3.1.0) + parallel (1.26.3) + parser (3.3.6.0) ast (~> 2.4.1) racc prism (1.2.0) psych (5.1.2) stringio - public_suffix (5.0.5) puma (6.4.3) nio4r (~> 2.0) racc (1.8.1) @@ -191,39 +184,37 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rbi (0.2.0) + rbi (0.2.1) prism (~> 1.0) sorbet-runtime (>= 0.5.9204) rbs (3.6.1) logger rdoc (6.7.0) psych (>= 4.0.0) - regexp_parser (2.9.0) + regexp_parser (2.9.2) reline (0.5.10) io-console (~> 0.5) - rexml (3.3.8) - rubocop (1.63.4) + rubocop (1.68.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.34.0) parser (>= 3.3.1.0) - rubocop-minitest (0.35.0) + rubocop-minitest (0.36.0) rubocop (>= 1.61, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) rubocop-shopify (2.15.1) rubocop (~> 1.51) - rubocop-sorbet (0.8.3) - rubocop (>= 0.90.0) + rubocop-sorbet (0.8.7) + rubocop (>= 1) ruby-lsp (0.21.2) language_server-protocol (~> 3.17.0) prism (>= 1.2, < 2.0) @@ -232,17 +223,17 @@ GEM ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) securerandom (0.3.1) - sorbet (0.5.11577) - sorbet-static (= 0.5.11577) - sorbet-runtime (0.5.11577) - sorbet-static (0.5.11577-universal-darwin) - sorbet-static (0.5.11577-x86_64-linux) - sorbet-static-and-runtime (0.5.11577) - sorbet (= 0.5.11577) - sorbet-runtime (= 0.5.11577) - spoom (1.3.0) + sorbet (0.5.11635) + sorbet-static (= 0.5.11635) + sorbet-runtime (0.5.11635) + sorbet-static (0.5.11635-universal-darwin) + sorbet-static (0.5.11635-x86_64-linux) + sorbet-static-and-runtime (0.5.11635) + sorbet (= 0.5.11635) + sorbet-runtime (= 0.5.11635) + spoom (1.5.0) erubi (>= 1.10.0) - prism (>= 0.19.0) + prism (>= 0.28.0) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) sqlite3 (2.1.0-arm64-darwin) @@ -250,7 +241,7 @@ GEM sqlite3 (2.1.0-x86_64-darwin) sqlite3 (2.1.0-x86_64-linux-gnu) stringio (3.1.1) - tapioca (0.16.2) + tapioca (0.16.3) bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) @@ -265,22 +256,18 @@ GEM concurrent-ruby (~> 1.0) tzinfo-data (1.2024.1) tzinfo (>= 1.0.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) uri (0.13.1) useragent (0.16.10) - webmock (3.23.1) - addressable (>= 2.8.0) - crack (>= 0.3.2) - hashdiff (>= 0.4.0, < 2.0.0) webrick (1.8.2) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - yard (0.9.36) - yard-sorbet (0.8.1) - sorbet-runtime (>= 0.5) - yard (>= 0.9) - zeitwerk (2.6.18) + yard (0.9.37) + yard-sorbet (0.9.0) + sorbet-runtime + yard + zeitwerk (2.7.1) PLATFORMS arm64-darwin @@ -294,7 +281,7 @@ DEPENDENCIES psych (~> 5.1) puma rails (= 8.0.0.beta1) - rubocop-minitest (~> 0.35.0) + rubocop-minitest (~> 0.36.0) rubocop-rake (~> 0.6.0) rubocop-shopify (~> 2.15) rubocop-sorbet (~> 0.8) @@ -304,7 +291,6 @@ DEPENDENCIES tapioca (~> 0.13) tzinfo tzinfo-data - webmock BUNDLED WITH 2.5.19 diff --git a/sorbet/rbi/gems/addressable@2.8.6.rbi b/sorbet/rbi/gems/addressable@2.8.6.rbi deleted file mode 100644 index 0990c186..00000000 --- a/sorbet/rbi/gems/addressable@2.8.6.rbi +++ /dev/null @@ -1,1994 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `addressable` gem. -# Please instead update this file by running `bin/tapioca gem addressable`. - - -# Addressable is a library for processing links and URIs. -# -# source://addressable/lib/addressable/version.rb#22 -module Addressable; end - -# source://addressable/lib/addressable/idna/pure.rb#21 -module Addressable::IDNA - class << self - # source://addressable/lib/addressable/idna/pure.rb#117 - def _deprecated_unicode_normalize_kc(value); end - - # Converts from a Unicode internationalized domain name to an ASCII - # domain name as described in RFC 3490. - # - # source://addressable/lib/addressable/idna/pure.rb#67 - def to_ascii(input); end - - # Converts from an ASCII domain name to a Unicode internationalized - # domain name as described in RFC 3490. - # - # source://addressable/lib/addressable/idna/pure.rb#93 - def to_unicode(input); end - - # @deprecated Use {String#unicode_normalize(:nfkc)} instead - def unicode_normalize_kc(*args, **_arg1, &block); end - - private - - # source://addressable/lib/addressable/idna/pure.rb#140 - def lookup_unicode_lowercase(codepoint); end - - # Bias adaptation method - # - # source://addressable/lib/addressable/idna/pure.rb#488 - def punycode_adapt(delta, numpoints, firsttime); end - - # @return [Boolean] - # - # source://addressable/lib/addressable/idna/pure.rb#456 - def punycode_basic?(codepoint); end - - # source://addressable/lib/addressable/idna/pure.rb#334 - def punycode_decode(punycode); end - - # Returns the numeric value of a basic codepoint - # (for use in representing integers) in the range 0 to - # base - 1, or PUNYCODE_BASE if codepoint does not represent a value. - # - # source://addressable/lib/addressable/idna/pure.rb#474 - def punycode_decode_digit(codepoint); end - - # @return [Boolean] - # - # source://addressable/lib/addressable/idna/pure.rb#461 - def punycode_delimiter?(codepoint); end - - # source://addressable/lib/addressable/idna/pure.rb#213 - def punycode_encode(unicode); end - - # source://addressable/lib/addressable/idna/pure.rb#466 - def punycode_encode_digit(d); end - - # Unicode aware downcase method. - # - # @api private - # @param input [String] The input string. - # @return [String] The downcased result. - # - # source://addressable/lib/addressable/idna/pure.rb#132 - def unicode_downcase(input); end - end -end - -# source://addressable/lib/addressable/idna/pure.rb#183 -Addressable::IDNA::ACE_MAX_LENGTH = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#40 -Addressable::IDNA::ACE_PREFIX = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/idna/pure.rb#172 -Addressable::IDNA::COMPOSITION_TABLE = T.let(T.unsafe(nil), Hash) - -# source://addressable/lib/addressable/idna/pure.rb#185 -Addressable::IDNA::PUNYCODE_BASE = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#189 -Addressable::IDNA::PUNYCODE_DAMP = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#192 -Addressable::IDNA::PUNYCODE_DELIMITER = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#190 -Addressable::IDNA::PUNYCODE_INITIAL_BIAS = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#191 -Addressable::IDNA::PUNYCODE_INITIAL_N = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#194 -Addressable::IDNA::PUNYCODE_MAXINT = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#196 -Addressable::IDNA::PUNYCODE_PRINT_ASCII = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/idna/pure.rb#188 -Addressable::IDNA::PUNYCODE_SKEW = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#187 -Addressable::IDNA::PUNYCODE_TMAX = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#186 -Addressable::IDNA::PUNYCODE_TMIN = T.let(T.unsafe(nil), Integer) - -# Input is invalid. -# -# source://addressable/lib/addressable/idna/pure.rb#207 -class Addressable::IDNA::PunycodeBadInput < ::StandardError; end - -# Output would exceed the space provided. -# -# source://addressable/lib/addressable/idna/pure.rb#209 -class Addressable::IDNA::PunycodeBigOutput < ::StandardError; end - -# Input needs wider integers to process. -# -# source://addressable/lib/addressable/idna/pure.rb#211 -class Addressable::IDNA::PunycodeOverflow < ::StandardError; end - -# source://addressable/lib/addressable/idna/pure.rb#163 -Addressable::IDNA::UNICODE_DATA = T.let(T.unsafe(nil), Hash) - -# source://addressable/lib/addressable/idna/pure.rb#150 -Addressable::IDNA::UNICODE_DATA_CANONICAL = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#148 -Addressable::IDNA::UNICODE_DATA_COMBINING_CLASS = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#151 -Addressable::IDNA::UNICODE_DATA_COMPATIBILITY = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#149 -Addressable::IDNA::UNICODE_DATA_EXCLUSION = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#153 -Addressable::IDNA::UNICODE_DATA_LOWERCASE = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#154 -Addressable::IDNA::UNICODE_DATA_TITLECASE = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#152 -Addressable::IDNA::UNICODE_DATA_UPPERCASE = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#182 -Addressable::IDNA::UNICODE_MAX_LENGTH = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/idna/pure.rb#36 -Addressable::IDNA::UNICODE_TABLE = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/idna/pure.rb#42 -Addressable::IDNA::UTF8_REGEX = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/idna/pure.rb#53 -Addressable::IDNA::UTF8_REGEX_MULTIBYTE = T.let(T.unsafe(nil), Regexp) - -# This is an implementation of a URI template based on -# RFC 6570 (http://tools.ietf.org/html/rfc6570). -# -# source://addressable/lib/addressable/template.rb#27 -class Addressable::Template - # Creates a new Addressable::Template object. - # - # @param pattern [#to_str] The URI Template pattern. - # @return [Addressable::Template] The initialized Template object. - # - # source://addressable/lib/addressable/template.rb#234 - def initialize(pattern); end - - # Returns true if the Template objects are equal. This method - # does NOT normalize either Template before doing the comparison. - # - # @param template [Object] The Template to compare. - # @return [TrueClass, FalseClass] true if the Templates are equivalent, false - # otherwise. - # - # source://addressable/lib/addressable/template.rb#274 - def ==(template); end - - # Returns true if the Template objects are equal. This method - # does NOT normalize either Template before doing the comparison. - # Addressable::Template makes no distinction between `==` and `eql?`. - # - # @param template [Object] The Template to compare. - # @return [TrueClass, FalseClass] true if the Templates are equivalent, false - # otherwise. - # @see #== - # - # source://addressable/lib/addressable/template.rb#274 - def eql?(template); end - - # Expands a URI template into a full URI. - # - # The object should respond to either the validate or - # transform messages or both. Both the validate and - # transform methods should take two parameters: name and - # value. The validate method should return true - # or false; true if the value of the variable is valid, - # false otherwise. An InvalidTemplateValueError - # exception will be raised if the value is invalid. The transform - # method should return the transformed variable value as a String. - # If a transform method is used, the value will not be percent - # encoded automatically. Unicode normalization will be performed both - # before and after sending the value to the transform method. - # - # @example - # class ExampleProcessor - # def self.validate(name, value) - # return !!(value =~ /^[\w ]+$/) if name == "query" - # return true - # end - # - # def self.transform(name, value) - # return value.gsub(/ /, "+") if name == "query" - # return value - # end - # end - # - # Addressable::Template.new( - # "http://example.com/search/{query}/" - # ).expand( - # {"query" => "an example search query"}, - # ExampleProcessor - # ).to_str - # #=> "http://example.com/search/an+example+search+query/" - # - # Addressable::Template.new( - # "http://example.com/search/{query}/" - # ).expand( - # {"query" => "an example search query"} - # ).to_str - # #=> "http://example.com/search/an%20example%20search%20query/" - # - # Addressable::Template.new( - # "http://example.com/search/{query}/" - # ).expand( - # {"query" => "bogus!"}, - # ExampleProcessor - # ).to_str - # #=> Addressable::Template::InvalidTemplateValueError - # @param mapping [Hash] The mapping that corresponds to the pattern. - # @param processor [#validate, #transform] An optional processor object may be supplied. - # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true - # @return [Addressable::URI] The expanded URI template. - # - # source://addressable/lib/addressable/template.rb#591 - def expand(mapping, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end - - # Extracts a mapping from the URI using a URI Template pattern. - # - # @example - # class ExampleProcessor - # def self.restore(name, value) - # return value.gsub(/\+/, " ") if name == "query" - # return value - # end - # - # def self.match(name) - # return ".*?" if name == "first" - # return ".*" - # end - # end - # - # uri = Addressable::URI.parse( - # "http://example.com/search/an+example+search+query/" - # ) - # Addressable::Template.new( - # "http://example.com/search/{query}/" - # ).extract(uri, ExampleProcessor) - # #=> {"query" => "an example search query"} - # - # uri = Addressable::URI.parse("http://example.com/a/b/c/") - # Addressable::Template.new( - # "http://example.com/{first}/{second}/" - # ).extract(uri, ExampleProcessor) - # #=> {"first" => "a", "second" => "b/c"} - # - # uri = Addressable::URI.parse("http://example.com/a/b/c/") - # Addressable::Template.new( - # "http://example.com/{first}/{-list|/|second}/" - # ).extract(uri) - # #=> {"first" => "a", "second" => ["b", "c"]} - # @param uri [Addressable::URI, #to_str] The URI to extract from. - # @param processor [#restore, #match] A template processor object may optionally be supplied. - # - # The object should respond to either the restore or - # match messages or both. The restore method should - # take two parameters: `[String] name` and `[String] value`. - # The restore method should reverse any transformations that - # have been performed on the value to ensure a valid URI. - # The match method should take a single - # parameter: `[String] name`. The match method should return - # a String containing a regular expression capture group for - # matching on that particular variable. The default value is `".*?"`. - # The match method has no effect on multivariate operator - # expansions. - # @return [Hash, NilClass] The Hash mapping that was extracted from the URI, or - # nil if the URI didn't match the template. - # - # source://addressable/lib/addressable/template.rb#342 - def extract(uri, processor = T.unsafe(nil)); end - - # Freeze URI, initializing instance variables. - # - # @return [Addressable::URI] The frozen URI object. - # - # source://addressable/lib/addressable/template.rb#245 - def freeze; end - - # Returns a String representation of the Template object's state. - # - # @return [String] The Template object's state, as a String. - # - # source://addressable/lib/addressable/template.rb#260 - def inspect; end - - # Returns an Array of variables used within the template pattern. - # The variables are listed in the Array in the order they appear within - # the pattern. Multiple occurrences of a variable within a pattern are - # not represented in this Array. - # - # @return [Array] The variables present in the template's pattern. - # - # source://addressable/lib/addressable/template.rb#607 - def keys; end - - # Extracts match data from the URI using a URI Template pattern. - # - # @example - # class ExampleProcessor - # def self.restore(name, value) - # return value.gsub(/\+/, " ") if name == "query" - # return value - # end - # - # def self.match(name) - # return ".*?" if name == "first" - # return ".*" - # end - # end - # - # uri = Addressable::URI.parse( - # "http://example.com/search/an+example+search+query/" - # ) - # match = Addressable::Template.new( - # "http://example.com/search/{query}/" - # ).match(uri, ExampleProcessor) - # match.variables - # #=> ["query"] - # match.captures - # #=> ["an example search query"] - # - # uri = Addressable::URI.parse("http://example.com/a/b/c/") - # match = Addressable::Template.new( - # "http://example.com/{first}/{+second}/" - # ).match(uri, ExampleProcessor) - # match.variables - # #=> ["first", "second"] - # match.captures - # #=> ["a", "b/c"] - # - # uri = Addressable::URI.parse("http://example.com/a/b/c/") - # match = Addressable::Template.new( - # "http://example.com/{first}{/second*}/" - # ).match(uri) - # match.variables - # #=> ["first", "second"] - # match.captures - # #=> ["a", ["b", "c"]] - # @param uri [Addressable::URI, #to_str] The URI to extract from. - # @param processor [#restore, #match] A template processor object may optionally be supplied. - # - # The object should respond to either the restore or - # match messages or both. The restore method should - # take two parameters: `[String] name` and `[String] value`. - # The restore method should reverse any transformations that - # have been performed on the value to ensure a valid URI. - # The match method should take a single - # parameter: `[String] name`. The match method should return - # a String containing a regular expression capture group for - # matching on that particular variable. The default value is `".*?"`. - # The match method has no effect on multivariate operator - # expansions. - # @return [Hash, NilClass] The Hash mapping that was extracted from the URI, or - # nil if the URI didn't match the template. - # - # source://addressable/lib/addressable/template.rb#413 - def match(uri, processor = T.unsafe(nil)); end - - # Returns the named captures of the coerced `Regexp`. - # - # @api private - # @return [Hash] The named captures of the `Regexp` given by {#to_regexp}. - # - # source://addressable/lib/addressable/template.rb#651 - def named_captures; end - - # Returns an Array of variables used within the template pattern. - # The variables are listed in the Array in the order they appear within - # the pattern. Multiple occurrences of a variable within a pattern are - # not represented in this Array. - # - # @return [Array] The variables present in the template's pattern. - # - # source://addressable/lib/addressable/template.rb#607 - def names; end - - # Expands a URI template into another URI template. - # - # The object should respond to either the validate or - # transform messages or both. Both the validate and - # transform methods should take two parameters: name and - # value. The validate method should return true - # or false; true if the value of the variable is valid, - # false otherwise. An InvalidTemplateValueError - # exception will be raised if the value is invalid. The transform - # method should return the transformed variable value as a String. - # If a transform method is used, the value will not be percent - # encoded automatically. Unicode normalization will be performed both - # before and after sending the value to the transform method. - # - # @example - # Addressable::Template.new( - # "http://example.com/{one}/{two}/" - # ).partial_expand({"one" => "1"}).pattern - # #=> "http://example.com/1/{two}/" - # - # Addressable::Template.new( - # "http://example.com/{?one,two}/" - # ).partial_expand({"one" => "1"}).pattern - # #=> "http://example.com/?one=1{&two}/" - # - # Addressable::Template.new( - # "http://example.com/{?one,two,three}/" - # ).partial_expand({"one" => "1", "three" => 3}).pattern - # #=> "http://example.com/?one=1{&two}&three=3" - # @param mapping [Hash] The mapping that corresponds to the pattern. - # @param processor [#validate, #transform] An optional processor object may be supplied. - # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true - # @return [Addressable::Template] The partially expanded URI template. - # - # source://addressable/lib/addressable/template.rb#524 - def partial_expand(mapping, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end - - # @return [String] The Template object's pattern. - # - # source://addressable/lib/addressable/template.rb#254 - def pattern; end - - # Returns the source of the coerced `Regexp`. - # - # @api private - # @return [String] The source of the `Regexp` given by {#to_regexp}. - # - # source://addressable/lib/addressable/template.rb#641 - def source; end - - # Coerces a template into a `Regexp` object. This regular expression will - # behave very similarly to the actual template, and should match the same - # URI values, but it cannot fully handle, for example, values that would - # extract to an `Array`. - # - # @return [Regexp] A regular expression which should match the template. - # - # source://addressable/lib/addressable/template.rb#630 - def to_regexp; end - - # Returns a mapping of variables to their default values specified - # in the template. Variables without defaults are not returned. - # - # @return [Hash] Mapping of template variables to their defaults - # - # source://addressable/lib/addressable/template.rb#618 - def variable_defaults; end - - # Returns an Array of variables used within the template pattern. - # The variables are listed in the Array in the order they appear within - # the pattern. Multiple occurrences of a variable within a pattern are - # not represented in this Array. - # - # @return [Array] The variables present in the template's pattern. - # - # source://addressable/lib/addressable/template.rb#607 - def variables; end - - private - - # Takes a set of values, and joins them together based on the - # operator. - # - # @param operator [String, Nil] One of the operators from the set - # (?,&,+,#,;,/,.), or nil if there wasn't one. - # @param return_value [Array] The set of return values (as [variable_name, value] tuples) that will - # be joined together. - # @return [String] The transformed mapped value - # - # source://addressable/lib/addressable/template.rb#861 - def join_values(operator, return_value); end - - # Generates a hash with string keys - # - # @param mapping [Hash] A mapping hash to normalize - # @return [Hash] A hash with stringified keys - # - # source://addressable/lib/addressable/template.rb#924 - def normalize_keys(mapping); end - - # Takes a set of values, and joins them together based on the - # operator. - # - # @param value [Hash, Array, String] Normalizes unicode keys and values with String#unicode_normalize (NFC) - # @return [Hash, Array, String] The normalized values - # - # source://addressable/lib/addressable/template.rb#898 - def normalize_value(value); end - - # source://addressable/lib/addressable/template.rb#656 - def ordered_variable_defaults; end - - # Generates the Regexp that parses a template pattern. - # - # @param pattern [String] The URI template pattern. - # @param processor [#match] The template processor to use. - # @return [Array, Regexp] An array of expansion variables nad a regular expression which may be - # used to parse a template pattern - # - # source://addressable/lib/addressable/template.rb#968 - def parse_new_template_pattern(pattern, processor = T.unsafe(nil)); end - - # Generates the Regexp that parses a template pattern. Memoizes the - # value if template processor not set (processors may not be deterministic) - # - # @param pattern [String] The URI template pattern. - # @param processor [#match] The template processor to use. - # @return [Array, Regexp] An array of expansion variables nad a regular expression which may be - # used to parse a template pattern - # - # source://addressable/lib/addressable/template.rb#950 - def parse_template_pattern(pattern, processor = T.unsafe(nil)); end - - # Transforms a mapped value so that values can be substituted into the - # template. - # - # The object should respond to either the validate or - # transform messages or both. Both the validate and - # transform methods should take two parameters: name and - # value. The validate method should return true - # or false; true if the value of the variable is valid, - # false otherwise. An InvalidTemplateValueError exception - # will be raised if the value is invalid. The transform method - # should return the transformed variable value as a String. If a - # transform method is used, the value will not be percent encoded - # automatically. Unicode normalization will be performed both before and - # after sending the value to the transform method. - # - # @param mapping [Hash] The mapping to replace captures - # @param capture [String] The expression to replace - # @param processor [#validate, #transform] An optional processor object may be supplied. - # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true - # @return [String] The expanded expression - # - # source://addressable/lib/addressable/template.rb#753 - def transform_capture(mapping, capture, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end - - # Loops through each capture and expands any values available in mapping - # - # The object should respond to either the validate or - # transform messages or both. Both the validate and - # transform methods should take two parameters: name and - # value. The validate method should return true - # or false; true if the value of the variable is valid, - # false otherwise. An InvalidTemplateValueError exception - # will be raised if the value is invalid. The transform method - # should return the transformed variable value as a String. If a - # transform method is used, the value will not be percent encoded - # automatically. Unicode normalization will be performed both before and - # after sending the value to the transform method. - # - # @param mapping [Hash] Set of keys to expand - # @param capture [String] The expression to expand - # @param processor [#validate, #transform] An optional processor object may be supplied. - # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true - # @return [String] The expanded expression - # - # source://addressable/lib/addressable/template.rb#694 - def transform_partial_capture(mapping, capture, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end -end - -# source://addressable/lib/addressable/template.rb#58 -Addressable::Template::EXPRESSION = T.let(T.unsafe(nil), Regexp) - -# Raised if an invalid template operator is used in a pattern. -# -# source://addressable/lib/addressable/template.rb#85 -class Addressable::Template::InvalidTemplateOperatorError < ::StandardError; end - -# Raised if an invalid template value is supplied. -# -# source://addressable/lib/addressable/template.rb#80 -class Addressable::Template::InvalidTemplateValueError < ::StandardError; end - -# source://addressable/lib/addressable/template.rb#70 -Addressable::Template::JOINERS = T.let(T.unsafe(nil), Hash) - -# source://addressable/lib/addressable/template.rb#62 -Addressable::Template::LEADERS = T.let(T.unsafe(nil), Hash) - -# This class represents the data that is extracted when a Template -# is matched against a URI. -# -# source://addressable/lib/addressable/template.rb#96 -class Addressable::Template::MatchData - # Creates a new MatchData object. - # MatchData objects should never be instantiated directly. - # - # @param uri [Addressable::URI] The URI that the template was matched against. - # @return [MatchData] a new instance of MatchData - # - # source://addressable/lib/addressable/template.rb#103 - def initialize(uri, template, mapping); end - - # Accesses captured values by name or by index. - # - # @param key [String, Symbol, Fixnum] Capture index or name. Note that when accessing by with index - # of 0, the full URI will be returned. The intention is to mimic - # the ::MatchData#[] behavior. - # @param len [#to_int, nil] If provided, an array of values will be returend with the given - # parameter used as length. - # @return [Array, String, nil] The captured value corresponding to the index or name. If the - # value was not provided or the key is unknown, nil will be - # returned. - # - # If the second parameter is provided, an array of that length will - # be returned instead. - # - # source://addressable/lib/addressable/template.rb#170 - def [](key, len = T.unsafe(nil)); end - - # @return [Array] The list of values that were captured by the Template. - # Note that this list will include nils for any variables which - # were in the Template, but did not appear in the URI. - # - # source://addressable/lib/addressable/template.rb#143 - def captures; end - - # Returns a String representation of the MatchData's state. - # - # @return [String] The MatchData's state, as a String. - # - # source://addressable/lib/addressable/template.rb#213 - def inspect; end - - # @return [Array] The list of variables that were present in the Template. - # Note that this list will include variables which do not appear - # in the mapping because they were not present in URI. - # - # source://addressable/lib/addressable/template.rb#132 - def keys; end - - # @return [Hash] The mapping that resulted from the match. - # Note that this mapping does not include keys or values for - # variables that appear in the Template, but are not present - # in the URI. - # - # source://addressable/lib/addressable/template.rb#125 - def mapping; end - - # @return [Array] The list of variables that were present in the Template. - # Note that this list will include variables which do not appear - # in the mapping because they were not present in URI. - # - # source://addressable/lib/addressable/template.rb#132 - def names; end - - # Dummy method for code expecting a ::MatchData instance - # - # @return [String] An empty string. - # - # source://addressable/lib/addressable/template.rb#222 - def post_match; end - - # Dummy method for code expecting a ::MatchData instance - # - # @return [String] An empty string. - # - # source://addressable/lib/addressable/template.rb#222 - def pre_match; end - - # @return [String] The matched URI as String. - # - # source://addressable/lib/addressable/template.rb#191 - def string; end - - # @return [Addressable::Template] The Template used for the match. - # - # source://addressable/lib/addressable/template.rb#117 - def template; end - - # @return [Array] Array with the matched URI as first element followed by the captured - # values. - # - # source://addressable/lib/addressable/template.rb#184 - def to_a; end - - # @return [String] The matched URI as String. - # - # source://addressable/lib/addressable/template.rb#191 - def to_s; end - - # @return [Addressable::URI] The URI that the Template was matched against. - # - # source://addressable/lib/addressable/template.rb#112 - def uri; end - - # @return [Array] The list of values that were captured by the Template. - # Note that this list will include nils for any variables which - # were in the Template, but did not appear in the URI. - # - # source://addressable/lib/addressable/template.rb#143 - def values; end - - # Returns multiple captured values at once. - # - # @param *indexes [String, Symbol, Fixnum] Indices of the captures to be returned - # @return [Array] Values corresponding to given indices. - # @see Addressable::Template::MatchData#[] - # - # source://addressable/lib/addressable/template.rb#205 - def values_at(*indexes); end - - # @return [Array] The list of variables that were present in the Template. - # Note that this list will include variables which do not appear - # in the mapping because they were not present in URI. - # - # source://addressable/lib/addressable/template.rb#132 - def variables; end -end - -# source://addressable/lib/addressable/template.rb#40 -Addressable::Template::RESERVED = T.let(T.unsafe(nil), String) - -# Raised if an invalid template operator is used in a pattern. -# -# source://addressable/lib/addressable/template.rb#90 -class Addressable::Template::TemplateOperatorAbortedError < ::StandardError; end - -# source://addressable/lib/addressable/template.rb#42 -Addressable::Template::UNRESERVED = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/template.rb#54 -Addressable::Template::VARIABLE_LIST = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/template.rb#50 -Addressable::Template::VARNAME = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/template.rb#52 -Addressable::Template::VARSPEC = T.let(T.unsafe(nil), Regexp) - -# This is an implementation of a URI parser based on -# RFC 3986, -# RFC 3987. -# -# source://addressable/lib/addressable/uri.rb#31 -class Addressable::URI - # Creates a new uri object from component parts. - # - # @option [String, - # @option [String, - # @option [String, - # @option [String, - # @option [String, - # @option [String, - # @option [String, - # @option [String, - # @option [String, - # @option [String, - # @param [String, [Hash] a customizable set of options - # @return [Addressable::URI] The constructed URI object. - # - # source://addressable/lib/addressable/uri.rb#830 - def initialize(options = T.unsafe(nil)); end - - # Joins two URIs together. - # - # @param The [String, Addressable::URI, #to_str] URI to join with. - # @return [Addressable::URI] The joined URI. - # - # source://addressable/lib/addressable/uri.rb#1889 - def +(uri); end - - # Returns true if the URI objects are equal. This method - # normalizes both URIs before doing the comparison. - # - # @param uri [Object] The URI to compare. - # @return [TrueClass, FalseClass] true if the URIs are equivalent, false - # otherwise. - # - # source://addressable/lib/addressable/uri.rb#2239 - def ==(uri); end - - # Returns true if the URI objects are equal. This method - # normalizes both URIs before doing the comparison, and allows comparison - # against Strings. - # - # @param uri [Object] The URI to compare. - # @return [TrueClass, FalseClass] true if the URIs are equivalent, false - # otherwise. - # - # source://addressable/lib/addressable/uri.rb#2217 - def ===(uri); end - - # Determines if the URI is absolute. - # - # @return [TrueClass, FalseClass] true if the URI is absolute. false - # otherwise. - # - # source://addressable/lib/addressable/uri.rb#1879 - def absolute?; end - - # The authority component for this URI. - # Combines the user, password, host, and port components. - # - # @return [String] The authority component. - # - # source://addressable/lib/addressable/uri.rb#1234 - def authority; end - - # Sets the authority component for this URI. - # - # @param new_authority [String, #to_str] The new authority component. - # - # source://addressable/lib/addressable/uri.rb#1274 - def authority=(new_authority); end - - # The basename, if any, of the file in the path component. - # - # @return [String] The path's basename. - # - # source://addressable/lib/addressable/uri.rb#1588 - def basename; end - - # The default port for this URI's scheme. - # This method will always returns the default port for the URI's scheme - # regardless of the presence of an explicit port in the URI. - # - # @return [Integer] The default port. - # - # source://addressable/lib/addressable/uri.rb#1454 - def default_port; end - - # This method allows you to make several changes to a URI simultaneously, - # which separately would cause validation errors, but in conjunction, - # are valid. The URI will be revalidated as soon as the entire block has - # been executed. - # - # @param block [Proc] A set of operations to perform on a given URI. - # - # source://addressable/lib/addressable/uri.rb#2396 - def defer_validation; end - - # Creates a URI suitable for display to users. If semantic attacks are - # likely, the application should try to detect these and warn the user. - # See RFC 3986, - # section 7.6 for more information. - # - # @return [Addressable::URI] A URI suitable for display purposes. - # - # source://addressable/lib/addressable/uri.rb#2201 - def display_uri; end - - # Returns the public suffix domain for this host. - # - # @example - # Addressable::URI.parse("http://www.example.co.uk").domain # => "example.co.uk" - # - # source://addressable/lib/addressable/uri.rb#1225 - def domain; end - - # Clones the URI object. - # - # @return [Addressable::URI] The cloned URI. - # - # source://addressable/lib/addressable/uri.rb#2271 - def dup; end - - # Determines if the URI is an empty string. - # - # @return [TrueClass, FalseClass] Returns true if empty, false otherwise. - # - # source://addressable/lib/addressable/uri.rb#2333 - def empty?; end - - # source://addressable/lib/addressable/uri.rb#2406 - def encode_with(coder); end - - # Returns true if the URI objects are equal. This method - # does NOT normalize either URI before doing the comparison. - # - # @param uri [Object] The URI to compare. - # @return [TrueClass, FalseClass] true if the URIs are equivalent, false - # otherwise. - # - # source://addressable/lib/addressable/uri.rb#2253 - def eql?(uri); end - - # The extname, if any, of the file in the path component. - # Empty string if there is no extension. - # - # @return [String] The path's extname. - # - # source://addressable/lib/addressable/uri.rb#1598 - def extname; end - - # The fragment component for this URI. - # - # @return [String] The fragment component. - # - # source://addressable/lib/addressable/uri.rb#1810 - def fragment; end - - # Sets the fragment component for this URI. - # - # @param new_fragment [String, #to_str] The new fragment component. - # - # source://addressable/lib/addressable/uri.rb#1835 - def fragment=(new_fragment); end - - # Freeze URI, initializing instance variables. - # - # @return [Addressable::URI] The frozen URI object. - # - # source://addressable/lib/addressable/uri.rb#870 - def freeze; end - - # A hash value that will make a URI equivalent to its normalized - # form. - # - # @return [Integer] A hash of the URI. - # - # source://addressable/lib/addressable/uri.rb#2263 - def hash; end - - # The host component for this URI. - # - # @return [String] The host component. - # - # source://addressable/lib/addressable/uri.rb#1120 - def host; end - - # Sets the host component for this URI. - # - # @param new_host [String, #to_str] The new host component. - # - # source://addressable/lib/addressable/uri.rb#1156 - def host=(new_host); end - - # This method is same as URI::Generic#host except - # brackets for IPv6 (and 'IPvFuture') addresses are removed. - # - # @return [String] The hostname for this URI. - # @see Addressable::URI#host - # - # source://addressable/lib/addressable/uri.rb#1178 - def hostname; end - - # This method is same as URI::Generic#host= except - # the argument can be a bare IPv6 address (or 'IPvFuture'). - # - # @param new_hostname [String, #to_str] The new hostname for this URI. - # @see Addressable::URI#host= - # - # source://addressable/lib/addressable/uri.rb#1190 - def hostname=(new_hostname); end - - # The inferred port component for this URI. - # This method will normalize to the default port for the URI's scheme if - # the port isn't explicitly specified in the URI. - # - # @return [Integer] The inferred port component. - # - # source://addressable/lib/addressable/uri.rb#1440 - def inferred_port; end - - # source://addressable/lib/addressable/uri.rb#2417 - def init_with(coder); end - - # Returns a String representation of the URI object's state. - # - # @return [String] The URI object's state, as a String. - # - # source://addressable/lib/addressable/uri.rb#2384 - def inspect; end - - # Determines if the scheme indicates an IP-based protocol. - # - # @return [TrueClass, FalseClass] true if the scheme indicates an IP-based protocol. - # false otherwise. - # - # source://addressable/lib/addressable/uri.rb#1855 - def ip_based?; end - - # Joins two URIs together. - # - # @param The [String, Addressable::URI, #to_str] URI to join with. - # @return [Addressable::URI] The joined URI. - # - # source://addressable/lib/addressable/uri.rb#1889 - def join(uri); end - - # Destructive form of join. - # - # @param The [String, Addressable::URI, #to_str] URI to join with. - # @return [Addressable::URI] The joined URI. - # @see Addressable::URI#join - # - # source://addressable/lib/addressable/uri.rb#1992 - def join!(uri); end - - # Merges a URI with a Hash of components. - # This method has different behavior from join. Any - # components present in the hash parameter will override the - # original components. The path component is not treated specially. - # - # @param The [Hash, Addressable::URI, #to_hash] components to merge with. - # @return [Addressable::URI] The merged URI. - # @see Hash#merge - # - # source://addressable/lib/addressable/uri.rb#2007 - def merge(hash); end - - # Destructive form of merge. - # - # @param The [Hash, Addressable::URI, #to_hash] components to merge with. - # @return [Addressable::URI] The merged URI. - # @see Addressable::URI#merge - # - # source://addressable/lib/addressable/uri.rb#2072 - def merge!(uri); end - - # Returns a normalized URI object. - # - # NOTE: This method does not attempt to fully conform to specifications. - # It exists largely to correct other people's failures to read the - # specifications, and also to deal with caching issues since several - # different URIs may represent the same resource and should not be - # cached multiple times. - # - # @return [Addressable::URI] The normalized URI. - # - # source://addressable/lib/addressable/uri.rb#2164 - def normalize; end - - # Destructively normalizes this URI object. - # - # @return [Addressable::URI] The normalized URI. - # @see Addressable::URI#normalize - # - # source://addressable/lib/addressable/uri.rb#2190 - def normalize!; end - - # The authority component for this URI, normalized. - # - # @return [String] The authority component, normalized. - # - # source://addressable/lib/addressable/uri.rb#1252 - def normalized_authority; end - - # The fragment component for this URI, normalized. - # - # @return [String] The fragment component, normalized. - # - # source://addressable/lib/addressable/uri.rb#1816 - def normalized_fragment; end - - # The host component for this URI, normalized. - # - # @return [String] The host component, normalized. - # - # source://addressable/lib/addressable/uri.rb#1126 - def normalized_host; end - - # The password component for this URI, normalized. - # - # @return [String] The password component, normalized. - # - # source://addressable/lib/addressable/uri.rb#1002 - def normalized_password; end - - # The path component for this URI, normalized. - # - # @return [String] The path component, normalized. - # - # source://addressable/lib/addressable/uri.rb#1535 - def normalized_path; end - - # The port component for this URI, normalized. - # - # @return [Integer] The port component, normalized. - # - # source://addressable/lib/addressable/uri.rb#1392 - def normalized_port; end - - # The query component for this URI, normalized. - # - # @return [String] The query component, normalized. - # - # source://addressable/lib/addressable/uri.rb#1613 - def normalized_query(*flags); end - - # The scheme component for this URI, normalized. - # - # @return [String] The scheme component, normalized. - # - # source://addressable/lib/addressable/uri.rb#896 - def normalized_scheme; end - - # The normalized combination of components that represent a site. - # Combines the scheme, user, password, host, and port components. - # Primarily useful for HTTP and HTTPS. - # - # For example, "http://example.com/path?query" would have a - # site value of "http://example.com". - # - # @return [String] The normalized components that identify a site. - # - # source://addressable/lib/addressable/uri.rb#1485 - def normalized_site; end - - # The user component for this URI, normalized. - # - # @return [String] The user component, normalized. - # - # source://addressable/lib/addressable/uri.rb#947 - def normalized_user; end - - # The userinfo component for this URI, normalized. - # - # @return [String] The userinfo component, normalized. - # - # source://addressable/lib/addressable/uri.rb#1068 - def normalized_userinfo; end - - # Omits components from a URI. - # - # @example - # uri = Addressable::URI.parse("http://example.com/path?query") - # #=> # - # uri.omit(:scheme, :authority) - # #=> # - # @param *components [Symbol] The components to be omitted. - # @return [Addressable::URI] The URI with components omitted. - # - # source://addressable/lib/addressable/uri.rb#2297 - def omit(*components); end - - # Destructive form of omit. - # - # @param *components [Symbol] The components to be omitted. - # @return [Addressable::URI] The URI with components omitted. - # @see Addressable::URI#omit - # - # source://addressable/lib/addressable/uri.rb#2324 - def omit!(*components); end - - # The origin for this URI, serialized to ASCII, as per - # RFC 6454, section 6.2. - # - # @return [String] The serialized origin. - # - # source://addressable/lib/addressable/uri.rb#1314 - def origin; end - - # Sets the origin for this URI, serialized to ASCII, as per - # RFC 6454, section 6.2. This assignment will reset the `userinfo` - # component. - # - # @param new_origin [String, #to_str] The new origin component. - # - # source://addressable/lib/addressable/uri.rb#1333 - def origin=(new_origin); end - - # The password component for this URI. - # - # @return [String] The password component. - # - # source://addressable/lib/addressable/uri.rb#996 - def password; end - - # Sets the password component for this URI. - # - # @param new_password [String, #to_str] The new password component. - # - # source://addressable/lib/addressable/uri.rb#1025 - def password=(new_password); end - - # The path component for this URI. - # - # @return [String] The path component. - # - # source://addressable/lib/addressable/uri.rb#1528 - def path; end - - # Sets the path component for this URI. - # - # @param new_path [String, #to_str] The new path component. - # - # source://addressable/lib/addressable/uri.rb#1567 - def path=(new_path); end - - # The port component for this URI. - # This is the port number actually given in the URI. This does not - # infer port numbers from default values. - # - # @return [Integer] The port component. - # - # source://addressable/lib/addressable/uri.rb#1386 - def port; end - - # Sets the port component for this URI. - # - # @param new_port [String, Integer, #to_s] The new port component. - # - # source://addressable/lib/addressable/uri.rb#1408 - def port=(new_port); end - - # The query component for this URI. - # - # @return [String] The query component. - # - # source://addressable/lib/addressable/uri.rb#1607 - def query; end - - # Sets the query component for this URI. - # - # @param new_query [String, #to_str] The new query component. - # - # source://addressable/lib/addressable/uri.rb#1641 - def query=(new_query); end - - # Converts the query component to a Hash value. - # - # @example - # Addressable::URI.parse("?one=1&two=2&three=3").query_values - # #=> {"one" => "1", "two" => "2", "three" => "3"} - # Addressable::URI.parse("?one=two&one=three").query_values(Array) - # #=> [["one", "two"], ["one", "three"]] - # Addressable::URI.parse("?one=two&one=three").query_values(Hash) - # #=> {"one" => "three"} - # Addressable::URI.parse("?").query_values - # #=> {} - # Addressable::URI.parse("").query_values - # #=> nil - # @param return_type [Class] The return type desired. Value must be either - # `Hash` or `Array`. - # @return [Hash, Array, nil] The query string parsed as a Hash or Array - # or nil if the query string is blank. - # - # source://addressable/lib/addressable/uri.rb#1672 - def query_values(return_type = T.unsafe(nil)); end - - # Sets the query component for this URI from a Hash object. - # An empty Hash or Array will result in an empty query string. - # - # @example - # uri.query_values = {:a => "a", :b => ["c", "d", "e"]} - # uri.query - # # => "a=a&b=c&b=d&b=e" - # uri.query_values = [['a', 'a'], ['b', 'c'], ['b', 'd'], ['b', 'e']] - # uri.query - # # => "a=a&b=c&b=d&b=e" - # uri.query_values = [['a', 'a'], ['b', ['c', 'd', 'e']]] - # uri.query - # # => "a=a&b=c&b=d&b=e" - # uri.query_values = [['flag'], ['key', 'value']] - # uri.query - # # => "flag&key=value" - # @param new_query_values [Hash, #to_hash, Array] The new query values. - # - # source://addressable/lib/addressable/uri.rb#1723 - def query_values=(new_query_values); end - - # Determines if the URI is relative. - # - # @return [TrueClass, FalseClass] true if the URI is relative. false - # otherwise. - # - # source://addressable/lib/addressable/uri.rb#1869 - def relative?; end - - # The HTTP request URI for this URI. This is the path and the - # query string. - # - # @return [String] The request URI required for an HTTP request. - # - # source://addressable/lib/addressable/uri.rb#1774 - def request_uri; end - - # Sets the HTTP request URI for this URI. - # - # @param new_request_uri [String, #to_str] The new HTTP request URI. - # - # source://addressable/lib/addressable/uri.rb#1786 - def request_uri=(new_request_uri); end - - # Returns the shortest normalized relative form of this URI that uses the - # supplied URI as a base for resolution. Returns an absolute URI if - # necessary. This is effectively the opposite of route_to. - # - # @param uri [String, Addressable::URI, #to_str] The URI to route from. - # @return [Addressable::URI] The normalized relative URI that is equivalent to the original URI. - # - # source://addressable/lib/addressable/uri.rb#2085 - def route_from(uri); end - - # Returns the shortest normalized relative form of the supplied URI that - # uses this URI as a base for resolution. Returns an absolute URI if - # necessary. This is effectively the opposite of route_from. - # - # @param uri [String, Addressable::URI, #to_str] The URI to route to. - # @return [Addressable::URI] The normalized relative URI that is equivalent to the supplied URI. - # - # source://addressable/lib/addressable/uri.rb#2150 - def route_to(uri); end - - # The scheme component for this URI. - # - # @return [String] The scheme component. - # - # source://addressable/lib/addressable/uri.rb#890 - def scheme; end - - # Sets the scheme component for this URI. - # - # @param new_scheme [String, #to_str] The new scheme component. - # - # source://addressable/lib/addressable/uri.rb#917 - def scheme=(new_scheme); end - - # The combination of components that represent a site. - # Combines the scheme, user, password, host, and port components. - # Primarily useful for HTTP and HTTPS. - # - # For example, "http://example.com/path?query" would have a - # site value of "http://example.com". - # - # @return [String] The components that identify a site. - # - # source://addressable/lib/addressable/uri.rb#1467 - def site; end - - # Sets the site value for this URI. - # - # @param new_site [String, #to_str] The new site value. - # - # source://addressable/lib/addressable/uri.rb#1506 - def site=(new_site); end - - # Returns the top-level domain for this host. - # - # @example - # Addressable::URI.parse("http://www.example.co.uk").tld # => "co.uk" - # - # source://addressable/lib/addressable/uri.rb#1207 - def tld; end - - # Sets the top-level domain for this URI. - # - # @param new_tld [String, #to_str] The new top-level domain. - # - # source://addressable/lib/addressable/uri.rb#1215 - def tld=(new_tld); end - - # Returns a Hash of the URI components. - # - # @return [Hash] The URI as a Hash of components. - # - # source://addressable/lib/addressable/uri.rb#2367 - def to_hash; end - - # Converts the URI to a String. - # - # @return [String] The URI's String representation. - # - # source://addressable/lib/addressable/uri.rb#2341 - def to_s; end - - # Converts the URI to a String. - # URI's are glorified Strings. Allow implicit conversion. - # - # @return [String] The URI's String representation. - # - # source://addressable/lib/addressable/uri.rb#2341 - def to_str; end - - # The user component for this URI. - # - # @return [String] The user component. - # - # source://addressable/lib/addressable/uri.rb#941 - def user; end - - # Sets the user component for this URI. - # - # @param new_user [String, #to_str] The new user component. - # - # source://addressable/lib/addressable/uri.rb#970 - def user=(new_user); end - - # The userinfo component for this URI. - # Combines the user and password components. - # - # @return [String] The userinfo component. - # - # source://addressable/lib/addressable/uri.rb#1052 - def userinfo; end - - # Sets the userinfo component for this URI. - # - # @param new_userinfo [String, #to_str] The new userinfo component. - # - # source://addressable/lib/addressable/uri.rb#1091 - def userinfo=(new_userinfo); end - - protected - - # Converts the string to be UTF-8 if it is not already UTF-8 - # - # @api private - # - # source://addressable/lib/addressable/uri.rb#2561 - def force_utf8_encoding_if_needed(str); end - - # Resets composite values for the entire URI - # - # @api private - # - # source://addressable/lib/addressable/uri.rb#2552 - def remove_composite_values; end - - # Replaces the internal state of self with the specified URI's state. - # Used in destructive operations to avoid massive code repetition. - # - # @param uri [Addressable::URI] The URI to replace self with. - # @return [Addressable::URI] self. - # - # source://addressable/lib/addressable/uri.rb#2519 - def replace_self(uri); end - - # Splits path string with "/" (slash). - # It is considered that there is empty string after last slash when - # path ends with slash. - # - # @param path [String] The path to split. - # @return [Array] An array of parts of path. - # - # source://addressable/lib/addressable/uri.rb#2542 - def split_path(path); end - - # Ensures that the URI is valid. - # - # source://addressable/lib/addressable/uri.rb#2476 - def validate; end - - private - - # Resets instance variables - # - # @api private - # - # source://addressable/lib/addressable/uri.rb#2573 - def reset_ivs; end - - class << self - # Converts a path to a file scheme URI. If the path supplied is - # relative, it will be returned as a relative URI. If the path supplied - # is actually a non-file URI, it will parse the URI as if it had been - # parsed with Addressable::URI.parse. Handles all of the - # various Microsoft-specific formats for specifying paths. - # - # @example - # base = Addressable::URI.convert_path("/absolute/path/") - # uri = Addressable::URI.convert_path("relative/path") - # (base + uri).to_s - # #=> "file:///absolute/path/relative/path" - # - # Addressable::URI.convert_path( - # "c:\\windows\\My Documents 100%20\\foo.txt" - # ).to_s - # #=> "file:///c:/windows/My%20Documents%20100%20/foo.txt" - # - # Addressable::URI.convert_path("http://example.com/").to_s - # #=> "http://example.com/" - # @param path [String, Addressable::URI, #to_str] Typically a String path to a file or directory, but - # will return a sensible return value if an absolute URI is supplied - # instead. - # @return [Addressable::URI] The parsed file scheme URI or the original URI if some other URI - # scheme was provided. - # - # source://addressable/lib/addressable/uri.rb#292 - def convert_path(path); end - - # Percent encodes any special characters in the URI. - # - # @param uri [String, Addressable::URI, #to_str] The URI to encode. - # @param return_type [Class] The type of object to return. - # This value may only be set to String or - # Addressable::URI. All other values are invalid. Defaults - # to String. - # @return [String, Addressable::URI] The encoded URI. - # The return type is determined by the return_type - # parameter. - # - # source://addressable/lib/addressable/uri.rb#616 - def encode(uri, return_type = T.unsafe(nil)); end - - # Percent encodes a URI component. - # - # '9' to be percent encoded. If a Regexp is passed, the - # value /[^b-zB-Z0-9]/ would have the same effect. A set of - # useful String values may be found in the - # Addressable::URI::CharacterClasses module. The default - # value is the reserved plus unreserved character classes specified in - # RFC 3986. - # - # @example - # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9") - # => "simple%2Fex%61mple" - # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/) - # => "simple%2Fex%61mple" - # Addressable::URI.encode_component( - # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED - # ) - # => "simple%2Fexample" - # @param component [String, #to_str] The URI component to encode. - # @param character_class [String, Regexp] The characters which are not percent encoded. If a String - # is passed, the String must be formatted as a regular - # expression character class. (Do not include the surrounding square - # brackets.) For example, "b-zB-Z0-9" would cause - # everything but the letters 'b' through 'z' and the numbers '0' through - # @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose - # encodings should be upcased. This allows normalization of percent - # encodings for characters not included in the - # character_class. - # @return [String] The encoded component. - # - # source://addressable/lib/addressable/uri.rb#403 - def encode_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end - - # Percent encodes any special characters in the URI. - # - # @param uri [String, Addressable::URI, #to_str] The URI to encode. - # @param return_type [Class] The type of object to return. - # This value may only be set to String or - # Addressable::URI. All other values are invalid. Defaults - # to String. - # @return [String, Addressable::URI] The encoded URI. - # The return type is determined by the return_type - # parameter. - # - # source://addressable/lib/addressable/uri.rb#616 - def escape(uri, return_type = T.unsafe(nil)); end - - # Percent encodes a URI component. - # - # '9' to be percent encoded. If a Regexp is passed, the - # value /[^b-zB-Z0-9]/ would have the same effect. A set of - # useful String values may be found in the - # Addressable::URI::CharacterClasses module. The default - # value is the reserved plus unreserved character classes specified in - # RFC 3986. - # - # @example - # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9") - # => "simple%2Fex%61mple" - # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/) - # => "simple%2Fex%61mple" - # Addressable::URI.encode_component( - # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED - # ) - # => "simple%2Fexample" - # @param component [String, #to_str] The URI component to encode. - # @param character_class [String, Regexp] The characters which are not percent encoded. If a String - # is passed, the String must be formatted as a regular - # expression character class. (Do not include the surrounding square - # brackets.) For example, "b-zB-Z0-9" would cause - # everything but the letters 'b' through 'z' and the numbers '0' through - # @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose - # encodings should be upcased. This allows normalization of percent - # encodings for characters not included in the - # character_class. - # @return [String] The encoded component. - # - # source://addressable/lib/addressable/uri.rb#403 - def escape_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end - - # Encodes a set of key/value pairs according to the rules for the - # application/x-www-form-urlencoded MIME type. - # - # @param form_values [#to_hash, #to_ary] The form values to encode. - # @param sort [TrueClass, FalseClass] Sort the key/value pairs prior to encoding. - # Defaults to false. - # @return [String] The encoded value. - # - # source://addressable/lib/addressable/uri.rb#740 - def form_encode(form_values, sort = T.unsafe(nil)); end - - # Decodes a String according to the rules for the - # application/x-www-form-urlencoded MIME type. - # - # @param encoded_value [String, #to_str] The form values to decode. - # @return [Array] The decoded values. - # This is not a Hash because of the possibility for - # duplicate keys. - # - # source://addressable/lib/addressable/uri.rb#793 - def form_unencode(encoded_value); end - - # Converts an input to a URI. The input does not have to be a valid - # URI — the method will use heuristics to guess what URI was intended. - # This is not standards-compliant, merely user-friendly. - # - # @param uri [String, Addressable::URI, #to_str] The URI string to parse. - # No parsing is performed if the object is already an - # Addressable::URI. - # @param hints [Hash] A Hash of hints to the heuristic parser. - # Defaults to {:scheme => "http"}. - # @return [Addressable::URI] The parsed URI. - # - # source://addressable/lib/addressable/uri.rb#191 - def heuristic_parse(uri, hints = T.unsafe(nil)); end - - # Returns an array of known ip-based schemes. These schemes typically - # use a similar URI form: - # //:@:/ - # - # source://addressable/lib/addressable/uri.rb#1369 - def ip_based_schemes; end - - # Joins several URIs together. - # - # @example - # base = "http://example.com/" - # uri = Addressable::URI.parse("relative/path") - # Addressable::URI.join(base, uri) - # #=> # - # @param *uris [String, Addressable::URI, #to_str] The URIs to join. - # @return [Addressable::URI] The joined URI. - # - # source://addressable/lib/addressable/uri.rb#343 - def join(*uris); end - - # Normalizes the encoding of a URI component. - # - # @example - # Addressable::URI.normalize_component("simpl%65/%65xampl%65", "b-zB-Z") - # => "simple%2Fex%61mple" - # Addressable::URI.normalize_component( - # "simpl%65/%65xampl%65", /[^b-zB-Z]/ - # ) - # => "simple%2Fex%61mple" - # Addressable::URI.normalize_component( - # "simpl%65/%65xampl%65", - # Addressable::URI::CharacterClasses::UNRESERVED - # ) - # => "simple%2Fexample" - # Addressable::URI.normalize_component( - # "one%20two%2fthree%26four", - # "0-9a-zA-Z &/", - # "/" - # ) - # => "one two%2Fthree&four" - # @param component [String, #to_str] The URI component to encode. - # @param character_class [String, Regexp] The characters which are not percent encoded. If a String - # is passed, the String must be formatted as a regular - # expression character class. (Do not include the surrounding square - # brackets.) For example, "b-zB-Z0-9" would cause - # everything but the letters 'b' through 'z' and the numbers '0' - # through '9' to be percent encoded. If a Regexp is passed, - # the value /[^b-zB-Z0-9]/ would have the same effect. A - # set of useful String values may be found in the - # Addressable::URI::CharacterClasses module. The default - # value is the reserved plus unreserved character classes specified in - # RFC 3986. - # @param leave_encoded [String] When character_class is a String then - # leave_encoded is a string of characters that should remain - # percent encoded while normalizing the component; if they appear percent - # encoded in the original component, then they will be upcased ("%2f" - # normalized to "%2F") but otherwise left alone. - # @return [String] The normalized component. - # - # source://addressable/lib/addressable/uri.rb#552 - def normalize_component(component, character_class = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end - - # Resolves paths to their simplest form. - # - # @param path [String] The path to normalize. - # @return [String] The normalized path. - # - # source://addressable/lib/addressable/uri.rb#2440 - def normalize_path(path); end - - # Normalizes the encoding of a URI. Characters within a hostname are - # not percent encoded to allow for internationalized domain names. - # - # @param uri [String, Addressable::URI, #to_str] The URI to encode. - # @param return_type [Class] The type of object to return. - # This value may only be set to String or - # Addressable::URI. All other values are invalid. Defaults - # to String. - # @return [String, Addressable::URI] The encoded URI. - # The return type is determined by the return_type - # parameter. - # - # source://addressable/lib/addressable/uri.rb#671 - def normalized_encode(uri, return_type = T.unsafe(nil)); end - - # Returns a URI object based on the parsed string. - # - # @param uri [String, Addressable::URI, #to_str] The URI string to parse. - # No parsing is performed if the object is already an - # Addressable::URI. - # @return [Addressable::URI] The parsed URI. - # - # source://addressable/lib/addressable/uri.rb#114 - def parse(uri); end - - # Returns a hash of common IP-based schemes and their default port - # numbers. Adding new schemes to this hash, as necessary, will allow - # for better URI normalization. - # - # source://addressable/lib/addressable/uri.rb#1376 - def port_mapping; end - - # Unencodes any percent encoded characters within a URI component. - # This method may be used for unencoding either components or full URIs, - # however, it is recommended to use the unencode_component - # alias when unencoding components. - # - # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. - # @param return_type [Class] The type of object to return. - # This value may only be set to String or - # Addressable::URI. All other values are invalid. Defaults - # to String. - # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character - # in this list is encountered then it will remain percent encoded. - # @return [String, Addressable::URI] The unencoded component or URI. - # The return type is determined by the return_type - # parameter. - # - # source://addressable/lib/addressable/uri.rb#472 - def unencode(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end - - # Unencodes any percent encoded characters within a URI component. - # This method may be used for unencoding either components or full URIs, - # however, it is recommended to use the unencode_component - # alias when unencoding components. - # - # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. - # @param return_type [Class] The type of object to return. - # This value may only be set to String or - # Addressable::URI. All other values are invalid. Defaults - # to String. - # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character - # in this list is encountered then it will remain percent encoded. - # @return [String, Addressable::URI] The unencoded component or URI. - # The return type is determined by the return_type - # parameter. - # - # source://addressable/lib/addressable/uri.rb#472 - def unencode_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end - - # Unencodes any percent encoded characters within a URI component. - # This method may be used for unencoding either components or full URIs, - # however, it is recommended to use the unencode_component - # alias when unencoding components. - # - # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. - # @param return_type [Class] The type of object to return. - # This value may only be set to String or - # Addressable::URI. All other values are invalid. Defaults - # to String. - # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character - # in this list is encountered then it will remain percent encoded. - # @return [String, Addressable::URI] The unencoded component or URI. - # The return type is determined by the return_type - # parameter. - # - # source://addressable/lib/addressable/uri.rb#472 - def unescape(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end - - # Unencodes any percent encoded characters within a URI component. - # This method may be used for unencoding either components or full URIs, - # however, it is recommended to use the unencode_component - # alias when unencoding components. - # - # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. - # @param return_type [Class] The type of object to return. - # This value may only be set to String or - # Addressable::URI. All other values are invalid. Defaults - # to String. - # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character - # in this list is encountered then it will remain percent encoded. - # @return [String, Addressable::URI] The unencoded component or URI. - # The return type is determined by the return_type - # parameter. - # - # source://addressable/lib/addressable/uri.rb#472 - def unescape_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end - end -end - -# Container for the character classes specified in -# RFC 3986. -# -# Note: Concatenated and interpolated `String`s are not affected by the -# `frozen_string_literal` directive and must be frozen explicitly. -# -# Interpolated `String`s *were* frozen this way before Ruby 3.0: -# https://bugs.ruby-lang.org/issues/17104 -# -# source://addressable/lib/addressable/uri.rb#46 -module Addressable::URI::CharacterClasses; end - -# source://addressable/lib/addressable/uri.rb#47 -Addressable::URI::CharacterClasses::ALPHA = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#57 -Addressable::URI::CharacterClasses::AUTHORITY = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#48 -Addressable::URI::CharacterClasses::DIGIT = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#60 -Addressable::URI::CharacterClasses::FRAGMENT = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#49 -Addressable::URI::CharacterClasses::GEN_DELIMS = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#56 -Addressable::URI::CharacterClasses::HOST = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#58 -Addressable::URI::CharacterClasses::PATH = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#54 -Addressable::URI::CharacterClasses::PCHAR = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#59 -Addressable::URI::CharacterClasses::QUERY = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#51 -Addressable::URI::CharacterClasses::RESERVED = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#53 -Addressable::URI::CharacterClasses::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#55 -Addressable::URI::CharacterClasses::SCHEME = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#50 -Addressable::URI::CharacterClasses::SUB_DELIMS = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#52 -Addressable::URI::CharacterClasses::UNRESERVED = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#72 -module Addressable::URI::CharacterClassesRegexps; end - -# source://addressable/lib/addressable/uri.rb#73 -Addressable::URI::CharacterClassesRegexps::AUTHORITY = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#74 -Addressable::URI::CharacterClassesRegexps::FRAGMENT = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#75 -Addressable::URI::CharacterClassesRegexps::HOST = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#76 -Addressable::URI::CharacterClassesRegexps::PATH = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#77 -Addressable::URI::CharacterClassesRegexps::QUERY = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#78 -Addressable::URI::CharacterClassesRegexps::RESERVED = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#79 -Addressable::URI::CharacterClassesRegexps::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#80 -Addressable::URI::CharacterClassesRegexps::SCHEME = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#81 -Addressable::URI::CharacterClassesRegexps::UNRESERVED = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#85 -Addressable::URI::EMPTY_STR = T.let(T.unsafe(nil), String) - -# Raised if something other than a uri is supplied. -# -# source://addressable/lib/addressable/uri.rb#34 -class Addressable::URI::InvalidURIError < ::StandardError; end - -# source://addressable/lib/addressable/uri.rb#2598 -module Addressable::URI::NONE; end - -# source://addressable/lib/addressable/uri.rb#1530 -Addressable::URI::NORMPATH = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#63 -module Addressable::URI::NormalizeCharacterClasses; end - -# source://addressable/lib/addressable/uri.rb#68 -Addressable::URI::NormalizeCharacterClasses::FRAGMENT = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#64 -Addressable::URI::NormalizeCharacterClasses::HOST = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#66 -Addressable::URI::NormalizeCharacterClasses::PCHAR = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#69 -Addressable::URI::NormalizeCharacterClasses::QUERY = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#67 -Addressable::URI::NormalizeCharacterClasses::SCHEME = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#65 -Addressable::URI::NormalizeCharacterClasses::UNRESERVED = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#2427 -Addressable::URI::PARENT = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#89 -Addressable::URI::PORT_MAPPING = T.let(T.unsafe(nil), Hash) - -# source://addressable/lib/addressable/uri.rb#2429 -Addressable::URI::RULE_2A = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#2430 -Addressable::URI::RULE_2B_2C = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#2431 -Addressable::URI::RULE_2D = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#2432 -Addressable::URI::RULE_PREFIXED_PARENT = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/uri.rb#2426 -Addressable::URI::SELF_REF = T.let(T.unsafe(nil), String) - -# Tables used to optimize encoding operations in `self.encode_component` -# and `self.normalize_component` -# -# source://addressable/lib/addressable/uri.rb#360 -Addressable::URI::SEQUENCE_ENCODING_TABLE = T.let(T.unsafe(nil), Array) - -# source://addressable/lib/addressable/uri.rb#364 -Addressable::URI::SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = T.let(T.unsafe(nil), Array) - -# source://addressable/lib/addressable/uri.rb#84 -Addressable::URI::SLASH = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/uri.rb#87 -Addressable::URI::URIREGEX = T.let(T.unsafe(nil), Regexp) - -# source://addressable/lib/addressable/version.rb#23 -module Addressable::VERSION; end - -# source://addressable/lib/addressable/version.rb#24 -Addressable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/version.rb#25 -Addressable::VERSION::MINOR = T.let(T.unsafe(nil), Integer) - -# source://addressable/lib/addressable/version.rb#28 -Addressable::VERSION::STRING = T.let(T.unsafe(nil), String) - -# source://addressable/lib/addressable/version.rb#26 -Addressable::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/crack@1.0.0.rbi b/sorbet/rbi/gems/crack@1.0.0.rbi deleted file mode 100644 index 9775093b..00000000 --- a/sorbet/rbi/gems/crack@1.0.0.rbi +++ /dev/null @@ -1,145 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `crack` gem. -# Please instead update this file by running `bin/tapioca gem crack`. - - -# source://crack/lib/crack/xml.rb#196 -module Crack; end - -# source://crack/lib/crack/xml.rb#197 -class Crack::REXMLParser - class << self - # source://crack/lib/crack/xml.rb#198 - def parse(xml); end - end -end - -# source://crack/lib/crack/xml.rb#225 -class Crack::XML - class << self - # source://crack/lib/crack/xml.rb#234 - def parse(xml); end - - # source://crack/lib/crack/xml.rb#226 - def parser; end - - # source://crack/lib/crack/xml.rb#230 - def parser=(parser); end - end -end - -# This is a slighly modified version of the XMLUtilityNode from -# http://merb.devjavu.com/projects/merb/ticket/95 (has.sox@gmail.com) -# It's mainly just adding vowels, as I ht cd wth n vwls :) -# This represents the hard part of the work, all I did was change the -# underlying parser. -# -# source://crack/lib/crack/xml.rb#23 -class REXMLUtilityNode - # @return [REXMLUtilityNode] a new instance of REXMLUtilityNode - # - # source://crack/lib/crack/xml.rb#56 - def initialize(name, normalized_attributes = T.unsafe(nil)); end - - # source://crack/lib/crack/xml.rb#73 - def add_node(node); end - - # source://crack/lib/crack/xml.rb#24 - def attributes; end - - # source://crack/lib/crack/xml.rb#24 - def attributes=(_arg0); end - - # source://crack/lib/crack/xml.rb#24 - def children; end - - # source://crack/lib/crack/xml.rb#24 - def children=(_arg0); end - - # Get the inner_html of the REXML node. - # - # source://crack/lib/crack/xml.rb#172 - def inner_html; end - - # source://crack/lib/crack/xml.rb#24 - def name; end - - # source://crack/lib/crack/xml.rb#24 - def name=(_arg0); end - - # source://crack/lib/crack/xml.rb#78 - def to_hash; end - - # Converts the node into a readable HTML node. - # - # @return [String] The HTML node in text form. - # - # source://crack/lib/crack/xml.rb#179 - def to_html; end - - # source://crack/lib/crack/xml.rb#185 - def to_s; end - - # source://crack/lib/crack/xml.rb#24 - def type; end - - # source://crack/lib/crack/xml.rb#24 - def type=(_arg0); end - - # Typecasts a value based upon its type. For instance, if - # +node+ has #type == "integer", - # {{[node.typecast_value("12") #=> 12]}} - # - # @note If +self+ does not have a "type" key, or if it's not one of the - # options specified above, the raw +value+ will be returned. - # @param value [String] The value that is being typecast. - # @return [Integer, TrueClass, FalseClass, Time, Date, Object] The result of typecasting +value+. - # - # source://crack/lib/crack/xml.rb#157 - def typecast_value(value); end - - # Take keys of the form foo-bar and convert them to foo_bar - # - # source://crack/lib/crack/xml.rb#164 - def undasherize_keys(params); end - - private - - # source://crack/lib/crack/xml.rb#191 - def unnormalize_xml_entities(value); end - - class << self - # source://crack/lib/crack/xml.rb#34 - def available_typecasts; end - - # source://crack/lib/crack/xml.rb#38 - def available_typecasts=(obj); end - - # source://crack/lib/crack/xml.rb#26 - def typecasts; end - - # source://crack/lib/crack/xml.rb#30 - def typecasts=(obj); end - end -end - -# The Reason behind redefining the String Class for this specific plugin is to -# avoid the dynamic insertion of stuff on it (see version previous to this commit). -# Doing that disables the possibility of efectuating a dump on the structure. This way it goes. -# -# source://crack/lib/crack/xml.rb#14 -class REXMLUtiliyNodeString < ::String - # Returns the value of attribute attributes. - # - # source://crack/lib/crack/xml.rb#15 - def attributes; end - - # Sets the attribute attributes - # - # @param value the value to set the attribute attributes to. - # - # source://crack/lib/crack/xml.rb#15 - def attributes=(_arg0); end -end diff --git a/sorbet/rbi/gems/hashdiff@1.1.0.rbi b/sorbet/rbi/gems/hashdiff@1.1.0.rbi deleted file mode 100644 index 72541dbd..00000000 --- a/sorbet/rbi/gems/hashdiff@1.1.0.rbi +++ /dev/null @@ -1,353 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `hashdiff` gem. -# Please instead update this file by running `bin/tapioca gem hashdiff`. - - -# This module provides methods to diff two hash, patch and unpatch hash -# -# source://hashdiff/lib/hashdiff/util.rb#3 -module Hashdiff - class << self - # Best diff two objects, which tries to generate the smallest change set using different similarity values. - # - # Hashdiff.best_diff is useful in case of comparing two objects which include similar hashes in arrays. - # - # @example - # a = {'x' => [{'a' => 1, 'c' => 3, 'e' => 5}, {'y' => 3}]} - # b = {'x' => [{'a' => 1, 'b' => 2, 'e' => 5}] } - # diff = Hashdiff.best_diff(a, b) - # diff.should == [['-', 'x[0].c', 3], ['+', 'x[0].b', 2], ['-', 'x[1].y', 3], ['-', 'x[1]', {}]] - # @param obj1 [Array, Hash] - # @param obj2 [Array, Hash] - # @param options [Hash] the options to use when comparing - # * :strict (Boolean) [true] whether numeric values will be compared on type as well as value. Set to false to allow comparing Integer, Float, BigDecimal to each other - # * :ignore_keys (Symbol, String or Array) [[]] a list of keys to ignore. No comparison is made for the specified key(s) - # * :indifferent (Boolean) [false] whether to treat hash keys indifferently. Set to true to ignore differences between symbol keys (ie. {a: 1} ~= {'a' => 1}) - # * :delimiter (String) ['.'] the delimiter used when returning nested key references - # * :numeric_tolerance (Numeric) [0] should be a positive numeric value. Value by which numeric differences must be greater than. By default, numeric values are compared exactly; with the :tolerance option, the difference between numeric values must be greater than the given value. - # * :strip (Boolean) [false] whether or not to call #strip on strings before comparing - # * :array_path (Boolean) [false] whether to return the path references for nested values in an array, can be used for patch compatibility with non string keys. - # * :use_lcs (Boolean) [true] whether or not to use an implementation of the Longest common subsequence algorithm for comparing arrays, produces better diffs but is slower. - # @return [Array] an array of changes. - # e.g. [[ '+', 'a.b', '45' ], [ '-', 'a.c', '5' ], [ '~', 'a.x', '45', '63']] - # @since 0.0.1 - # @yield [path, value1, value2] Optional block is used to compare each value, instead of default #==. If the block returns value other than true of false, then other specified comparison options will be used to do the comparison. - # - # source://hashdiff/lib/hashdiff/diff.rb#32 - def best_diff(obj1, obj2, options = T.unsafe(nil), &block); end - - # check if objects are comparable - # - # @private - # @return [Boolean] - # - # source://hashdiff/lib/hashdiff/util.rb#108 - def comparable?(obj1, obj2, strict = T.unsafe(nil)); end - - # check for equality or "closeness" within given tolerance - # - # @private - # - # source://hashdiff/lib/hashdiff/util.rb#86 - def compare_values(obj1, obj2, options = T.unsafe(nil)); end - - # count node differences - # - # @private - # - # source://hashdiff/lib/hashdiff/util.rb#25 - def count_diff(diffs); end - - # count total nodes for an object - # - # @private - # - # source://hashdiff/lib/hashdiff/util.rb#36 - def count_nodes(obj); end - - # try custom comparison - # - # @private - # - # source://hashdiff/lib/hashdiff/util.rb#119 - def custom_compare(method, key, obj1, obj2); end - - # decode property path into an array - # e.g. "a.b[3].c" => ['a', 'b', 3, 'c'] - # - # @param path [String] Property-string - # @param delimiter [String] Property-string delimiter - # @private - # - # source://hashdiff/lib/hashdiff/util.rb#58 - def decode_property_path(path, delimiter = T.unsafe(nil)); end - - # Compute the diff of two hashes or arrays - # - # @example - # a = {"a" => 1, "b" => {"b1" => 1, "b2" =>2}} - # b = {"a" => 1, "b" => {}} - # - # diff = Hashdiff.diff(a, b) - # diff.should == [['-', 'b.b1', 1], ['-', 'b.b2', 2]] - # @param obj1 [Array, Hash] - # @param obj2 [Array, Hash] - # @param options [Hash] the options to use when comparing - # * :strict (Boolean) [true] whether numeric values will be compared on type as well as value. Set to false to allow comparing Integer, Float, BigDecimal to each other - # * :ignore_keys (Symbol, String or Array) [[]] a list of keys to ignore. No comparison is made for the specified key(s) - # * :indifferent (Boolean) [false] whether to treat hash keys indifferently. Set to true to ignore differences between symbol keys (ie. {a: 1} ~= {'a' => 1}) - # * :similarity (Numeric) [0.8] should be between (0, 1]. Meaningful if there are similar hashes in arrays. See {best_diff}. - # * :delimiter (String) ['.'] the delimiter used when returning nested key references - # * :numeric_tolerance (Numeric) [0] should be a positive numeric value. Value by which numeric differences must be greater than. By default, numeric values are compared exactly; with the :tolerance option, the difference between numeric values must be greater than the given value. - # * :strip (Boolean) [false] whether or not to call #strip on strings before comparing - # * :array_path (Boolean) [false] whether to return the path references for nested values in an array, can be used for patch compatibility with non string keys. - # * :use_lcs (Boolean) [true] whether or not to use an implementation of the Longest common subsequence algorithm for comparing arrays, produces better diffs but is slower. - # @return [Array] an array of changes. - # e.g. [[ '+', 'a.b', '45' ], [ '-', 'a.c', '5' ], [ '~', 'a.x', '45', '63']] - # @since 0.0.1 - # @yield [path, value1, value2] Optional block is used to compare each value, instead of default #==. If the block returns value other than true of false, then other specified comparison options will be used to do the comparison. - # - # source://hashdiff/lib/hashdiff/diff.rb#80 - def diff(obj1, obj2, options = T.unsafe(nil), &block); end - - # diff array using LCS algorithm - # - # @private - # @yield [links] - # - # source://hashdiff/lib/hashdiff/diff.rb#124 - def diff_array_lcs(arraya, arrayb, options = T.unsafe(nil)); end - - # caculate array difference using LCS algorithm - # http://en.wikipedia.org/wiki/Longest_common_subsequence_problem - # - # @private - # - # source://hashdiff/lib/hashdiff/lcs.rb#8 - def lcs(arraya, arrayb, options = T.unsafe(nil)); end - - # get the node of hash by given path parts - # - # @private - # - # source://hashdiff/lib/hashdiff/util.rb#75 - def node(hash, parts); end - - # Apply patch to object - # - # @param obj [Hash, Array] the object to be patched, can be an Array or a Hash - # @param changes [Array] e.g. [[ '+', 'a.b', '45' ], [ '-', 'a.c', '5' ], [ '~', 'a.x', '45', '63']] - # @param options [Hash] supports following keys: - # * :delimiter (String) ['.'] delimiter string for representing nested keys in changes array - # @return the object after patch - # @since 0.0.1 - # - # source://hashdiff/lib/hashdiff/patch.rb#17 - def patch!(obj, changes, options = T.unsafe(nil)); end - - # source://hashdiff/lib/hashdiff/util.rb#137 - def prefix_append_array_index(prefix, array_index, opts); end - - # source://hashdiff/lib/hashdiff/util.rb#129 - def prefix_append_key(prefix, key, opts); end - - # judge whether two objects are similar - # - # @private - # @return [Boolean] - # - # source://hashdiff/lib/hashdiff/util.rb#7 - def similar?(obja, objb, options = T.unsafe(nil)); end - - # Unpatch an object - # - # @param obj [Hash, Array] the object to be unpatched, can be an Array or a Hash - # @param changes [Array] e.g. [[ '+', 'a.b', '45' ], [ '-', 'a.c', '5' ], [ '~', 'a.x', '45', '63']] - # @param options [Hash] supports following keys: - # * :delimiter (String) ['.'] delimiter string for representing nested keys in changes array - # @return the object after unpatch - # @since 0.0.1 - # - # source://hashdiff/lib/hashdiff/patch.rb#58 - def unpatch!(obj, changes, options = T.unsafe(nil)); end - - private - - # checks if both objects are Arrays or Hashes - # - # @private - # @return [Boolean] - # - # source://hashdiff/lib/hashdiff/util.rb#151 - def any_hash_or_array?(obja, objb); end - end -end - -# Used to compare hashes -# -# @private -# -# source://hashdiff/lib/hashdiff/compare_hashes.rb#6 -class Hashdiff::CompareHashes - class << self - # source://hashdiff/lib/hashdiff/compare_hashes.rb#8 - def call(obj1, obj2, opts = T.unsafe(nil)); end - end -end - -# Used to compare arrays using the lcs algorithm -# -# @private -# -# source://hashdiff/lib/hashdiff/lcs_compare_arrays.rb#6 -class Hashdiff::LcsCompareArrays - class << self - # source://hashdiff/lib/hashdiff/lcs_compare_arrays.rb#8 - def call(obj1, obj2, opts = T.unsafe(nil)); end - end -end - -# Used to compare arrays in a linear complexity, which produces longer diffs -# than using the lcs algorithm but is considerably faster -# -# @private -# -# source://hashdiff/lib/hashdiff/linear_compare_array.rb#8 -class Hashdiff::LinearCompareArray - # @return [LinearCompareArray] a new instance of LinearCompareArray - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#45 - def initialize(old_array, new_array, options); end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#14 - def call; end - - private - - # Returns the value of attribute additions. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#42 - def additions; end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#139 - def append_addition(item, index); end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#123 - def append_addititions_before_match(match_index); end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#144 - def append_deletion(item, index); end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#131 - def append_deletions_before_match(match_index); end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#149 - def append_differences(difference); end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#153 - def changes; end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#67 - def compare_at_index; end - - # Returns the value of attribute deletions. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#42 - def deletions; end - - # Returns the value of attribute differences. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#42 - def differences; end - - # Returns the value of attribute expected_additions. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#43 - def expected_additions; end - - # Sets the attribute expected_additions - # - # @param value the value to set the attribute expected_additions to. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#43 - def expected_additions=(_arg0); end - - # @return [Boolean] - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#59 - def extra_items_in_new_array?; end - - # @return [Boolean] - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#55 - def extra_items_in_old_array?; end - - # look ahead in the new array to see if the current item appears later - # thereby having new items added - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#89 - def index_of_match_after_additions; end - - # look ahead in the old array to see if the current item appears later - # thereby having items removed - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#107 - def index_of_match_after_deletions; end - - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#82 - def item_difference(old_item, new_item, item_index); end - - # @return [Boolean] - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#63 - def iterated_through_both_arrays?; end - - # Returns the value of attribute new_array. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#42 - def new_array; end - - # Returns the value of attribute new_index. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#43 - def new_index; end - - # Sets the attribute new_index - # - # @param value the value to set the attribute new_index to. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#43 - def new_index=(_arg0); end - - # Returns the value of attribute old_array. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#42 - def old_array; end - - # Returns the value of attribute old_index. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#43 - def old_index; end - - # Sets the attribute old_index - # - # @param value the value to set the attribute old_index to. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#43 - def old_index=(_arg0); end - - # Returns the value of attribute options. - # - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#42 - def options; end - - class << self - # source://hashdiff/lib/hashdiff/linear_compare_array.rb#9 - def call(old_array, new_array, options = T.unsafe(nil)); end - end -end - -# source://hashdiff/lib/hashdiff/version.rb#4 -Hashdiff::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/json@2.7.2.rbi b/sorbet/rbi/gems/json@2.7.6.rbi similarity index 91% rename from sorbet/rbi/gems/json@2.7.2.rbi rename to sorbet/rbi/gems/json@2.7.6.rbi index 43f4f56d..86bb1007 100644 --- a/sorbet/rbi/gems/json@2.7.2.rbi +++ b/sorbet/rbi/gems/json@2.7.6.rbi @@ -7,7 +7,7 @@ # Extends any Class to include _json_creatable?_ method. # -# source://json/lib/json/common.rb#690 +# source://json/lib/json/common.rb#726 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 @@ -16,7 +16,7 @@ class Class < ::Module # # @return [Boolean] # - # source://json/lib/json/common.rb#695 + # source://json/lib/json/common.rb#731 def json_creatable?; end end @@ -599,7 +599,7 @@ end # Without custom addition: "#" (String) # With custom addition: # (Foo) # -# source://json/lib/json/version.rb#2 +# source://json/lib/json/version.rb#3 module JSON private @@ -631,7 +631,7 @@ module JSON # Output: # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} # - # source://json/lib/json/common.rb#615 + # source://json/lib/json/common.rb#630 def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end # :call-seq: @@ -648,13 +648,13 @@ module JSON # # Raises SystemStackError (stack level too deep): # JSON.fast_generate(a) # - # source://json/lib/json/common.rb#329 + # source://json/lib/json/common.rb#337 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#329 + # source://json/lib/json/common.rb#337 def fast_unparse(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -693,7 +693,7 @@ module JSON # # Raises JSON::NestingError (nesting of 100 is too deep): # JSON.generate(a) # - # source://json/lib/json/common.rb#300 + # source://json/lib/json/common.rb#308 def generate(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -824,7 +824,7 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json/lib/json/common.rb#541 + # source://json/lib/json/common.rb#549 def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # :call-seq: @@ -835,7 +835,7 @@ module JSON # # See method #parse. # - # source://json/lib/json/common.rb#249 + # source://json/lib/json/common.rb#257 def load_file(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -846,10 +846,10 @@ module JSON # # See method #parse! # - # source://json/lib/json/common.rb#260 + # source://json/lib/json/common.rb#268 def load_file!(filespec, opts = T.unsafe(nil)); end - # source://json/lib/json/common.rb#643 + # source://json/lib/json/common.rb#674 def merge_dump_options(opts, strict: T.unsafe(nil)); end # :call-seq: @@ -900,7 +900,7 @@ module JSON # # Raises JSON::ParserError (783: unexpected token at ''): # JSON.parse('') # - # source://json/lib/json/common.rb#219 + # source://json/lib/json/common.rb#218 def parse(source, opts = T.unsafe(nil)); end # :call-seq: @@ -915,7 +915,7 @@ module JSON # which disables checking for nesting depth. # - Option +allow_nan+, if not provided, defaults to +true+. # - # source://json/lib/json/common.rb#234 + # source://json/lib/json/common.rb#242 def parse!(source, opts = T.unsafe(nil)); end # :call-seq: @@ -948,28 +948,28 @@ module JSON # } # } # - # source://json/lib/json/common.rb#374 + # source://json/lib/json/common.rb#382 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#374 + # source://json/lib/json/common.rb#382 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#559 + # source://json/lib/json/common.rb#575 def recurse_proc(result, &proc); end - # source://json/lib/json/common.rb#541 + # source://json/lib/json/common.rb#549 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#300 + # source://json/lib/json/common.rb#308 def unparse(obj, opts = T.unsafe(nil)); end class << self @@ -988,23 +988,23 @@ module JSON # source://json/lib/json/common.rb#22 def [](object, opts = T.unsafe(nil)); end - # source://json/lib/json/common.rb#85 + # source://json/lib/json/common.rb#90 def create_fast_state; end # Returns the current create identifier. # See also JSON.create_id=. # - # source://json/lib/json/common.rb#130 + # source://json/lib/json/common.rb#129 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#124 + # source://json/lib/json/common.rb#123 def create_id=(new_value); end - # source://json/lib/json/common.rb#95 + # source://json/lib/json/common.rb#100 def create_pretty_state; end # Return the constant located at _path_. The format of _path_ has to be @@ -1012,7 +1012,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#46 + # source://json/lib/json/common.rb#51 def deep_const_get(path); end # :call-seq: @@ -1043,23 +1043,23 @@ module JSON # Output: # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} # - # source://json/lib/json/common.rb#615 + # source://json/lib/json/common.rb#630 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. # Initially: # opts = JSON.dump_default_options - # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false} + # opts # => {:max_nesting=>false, :allow_nan=>true} # - # source://json/lib/json/common.rb#580 + # source://json/lib/json/common.rb#596 def dump_default_options; end # Sets or returns the default options for the JSON.dump method. # Initially: # opts = JSON.dump_default_options - # opts # => {:max_nesting=>false, :allow_nan=>true, :script_safe=>false} + # opts # => {:max_nesting=>false, :allow_nan=>true} # - # source://json/lib/json/common.rb#580 + # source://json/lib/json/common.rb#596 def dump_default_options=(_arg0); end # :call-seq: @@ -1076,13 +1076,13 @@ module JSON # # Raises SystemStackError (stack level too deep): # JSON.fast_generate(a) # - # source://json/lib/json/common.rb#329 + # source://json/lib/json/common.rb#337 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#329 + # source://json/lib/json/common.rb#337 def fast_unparse(obj, opts = T.unsafe(nil)); end # :call-seq: @@ -1121,24 +1121,24 @@ module JSON # # Raises JSON::NestingError (nesting of 100 is too deep): # JSON.generate(a) # - # source://json/lib/json/common.rb#300 + # source://json/lib/json/common.rb#308 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#107 + # source://json/lib/json/common.rb#112 def generator; end # Set the module _generator_ to be used by JSON. # - # source://json/lib/json/common.rb#62 + # source://json/lib/json/common.rb#67 def generator=(generator); end # Encodes string using String.encode. # - # source://json/lib/json/common.rb#639 + # source://json/lib/json/common.rb#670 def iconv(to, from, string); end # :call-seq: @@ -1269,7 +1269,7 @@ module JSON # #"Admin", "password"=>"0wn3d"}>} # - # source://json/lib/json/common.rb#541 + # source://json/lib/json/common.rb#549 def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end # Sets or returns default options for the JSON.load method. @@ -1277,7 +1277,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#404 + # source://json/lib/json/common.rb#412 def load_default_options; end # Sets or returns default options for the JSON.load method. @@ -1285,7 +1285,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#404 + # source://json/lib/json/common.rb#412 def load_default_options=(_arg0); end # :call-seq: @@ -1296,7 +1296,7 @@ module JSON # # See method #parse. # - # source://json/lib/json/common.rb#249 + # source://json/lib/json/common.rb#257 def load_file(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -1307,7 +1307,7 @@ module JSON # # See method #parse! # - # source://json/lib/json/common.rb#260 + # source://json/lib/json/common.rb#268 def load_file!(filespec, opts = T.unsafe(nil)); end # :call-seq: @@ -1358,7 +1358,7 @@ module JSON # # Raises JSON::ParserError (783: unexpected token at ''): # JSON.parse('') # - # source://json/lib/json/common.rb#219 + # source://json/lib/json/common.rb#218 def parse(source, opts = T.unsafe(nil)); end # :call-seq: @@ -1373,19 +1373,19 @@ module JSON # which disables checking for nesting depth. # - Option +allow_nan+, if not provided, defaults to +true+. # - # source://json/lib/json/common.rb#234 + # source://json/lib/json/common.rb#242 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#33 + # source://json/lib/json/common.rb#38 def parser; end # Set the JSON parser class _parser_ to be used by JSON. # - # source://json/lib/json/common.rb#36 + # source://json/lib/json/common.rb#41 def parser=(parser); end # :call-seq: @@ -1418,56 +1418,123 @@ module JSON # } # } # - # source://json/lib/json/common.rb#374 + # source://json/lib/json/common.rb#382 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#374 + # source://json/lib/json/common.rb#382 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#559 + # source://json/lib/json/common.rb#575 def recurse_proc(result, &proc); end - # source://json/lib/json/common.rb#541 + # source://json/lib/json/common.rb#549 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#112 + # source://json/lib/json/common.rb#117 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#112 + # source://json/lib/json/common.rb#117 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#300 + # source://json/lib/json/common.rb#308 def unparse(obj, opts = T.unsafe(nil)); end private - # source://json/lib/json/common.rb#643 + # source://json/lib/json/common.rb#674 def merge_dump_options(opts, strict: T.unsafe(nil)); end end end -# source://json/lib/json/common.rb#118 -JSON::CREATE_ID_TLS_KEY = T.let(T.unsafe(nil), String) +# source://json/lib/json/ext/generator/state.rb#6 +class JSON::Ext::Generator::State + # call-seq: new(opts = {}) + # + # Instantiates a new State object, configured by _opts_. + # + # _opts_ can have the following keys: + # + # * *indent*: a string used to indent levels (default: ''), + # * *space*: a string that is put after, a : or , delimiter (default: ''), + # * *space_before*: a string that is put before a : pair delimiter (default: ''), + # * *object_nl*: a string that is put at the end of a JSON object (default: ''), + # * *array_nl*: a string that is put at the end of a JSON array (default: ''), + # * *allow_nan*: true if NaN, Infinity, and -Infinity should be + # generated, otherwise an exception is thrown, if these values are + # encountered. This options defaults to false. + # * *ascii_only*: true if only ASCII characters should be generated. This + # option defaults to false. + # * *buffer_initial_length*: sets the initial length of the generator's + # internal buffer. + # + # @return [State] a new instance of State + # + # source://json/lib/json/ext/generator/state.rb#25 + def initialize(opts = T.unsafe(nil)); end + + # call-seq: [](name) + # + # Returns the value returned by method +name+. + # + # source://json/lib/json/ext/generator/state.rb#113 + def [](name); end + + # call-seq: []=(name, value) + # + # Sets the attribute name to value. + # + # source://json/lib/json/ext/generator/state.rb#125 + def []=(name, value); end -# source://json/lib/json/common.rb#115 -JSON::DEFAULT_CREATE_ID = T.let(T.unsafe(nil), String) + # call-seq: configure(opts) + # + # Configure this State instance with the Hash _opts_, and return + # itself. + # + # source://json/lib/json/ext/generator/state.rb#35 + def configure(opts); end + + # call-seq: configure(opts) + # + # Configure this State instance with the Hash _opts_, and return + # itself. + # + # source://json/lib/json/ext/generator/state.rb#35 + def merge(opts); end + + # call-seq: to_h + # + # Returns the configuration instance variables as a hash, that can be + # passed to the configure method. + # + # source://json/lib/json/ext/generator/state.rb#84 + def to_h; end + + # call-seq: to_h + # + # Returns the configuration instance variables as a hash, that can be + # passed to the configure method. + # + # source://json/lib/json/ext/generator/state.rb#84 + def to_hash; end +end # source://json/lib/json/generic_object.rb#9 class JSON::GenericObject < ::OpenStruct @@ -1512,10 +1579,10 @@ end # The base exception for JSON errors. # -# source://json/lib/json/common.rb#141 +# source://json/lib/json/common.rb#140 class JSON::JSONError < ::StandardError class << self - # source://json/lib/json/common.rb#142 + # source://json/lib/json/common.rb#141 def wrap(exception); end end end @@ -1523,18 +1590,18 @@ end # source://json/lib/json/common.rb#7 JSON::NOT_SET = T.let(T.unsafe(nil), Object) -# source://json/lib/json/common.rb#39 +# source://json/lib/json/common.rb#44 JSON::Parser = JSON::Ext::Parser -# source://json/lib/json/common.rb#77 +# source://json/lib/json/common.rb#82 JSON::State = JSON::Ext::Generator::State # For backwards compatibility # -# source://json/lib/json/common.rb#163 +# source://json/lib/json/common.rb#162 JSON::UnparserError = JSON::GeneratorError -# source://json/lib/json/common.rb#653 +# source://json/lib/json/common.rb#684 module Kernel private @@ -1545,18 +1612,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#680 + # source://json/lib/json/common.rb#711 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#658 + # source://json/lib/json/common.rb#689 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#667 + # source://json/lib/json/common.rb#698 def jj(*objs); end end diff --git a/sorbet/rbi/gems/parallel@1.24.0.rbi b/sorbet/rbi/gems/parallel@1.26.3.rbi similarity index 84% rename from sorbet/rbi/gems/parallel@1.24.0.rbi rename to sorbet/rbi/gems/parallel@1.26.3.rbi index d5bbc409..d1ef8b48 100644 --- a/sorbet/rbi/gems/parallel@1.24.0.rbi +++ b/sorbet/rbi/gems/parallel@1.26.3.rbi @@ -25,10 +25,10 @@ module Parallel def each_with_index(array, options = T.unsafe(nil), &block); end # source://parallel/lib/parallel.rb#307 - def filter_map(*args, &block); end + def filter_map(*_arg0, **_arg1, &_arg2); end # source://parallel/lib/parallel.rb#303 - def flat_map(*args, &block); end + def flat_map(*_arg0, **_arg1, &_arg2); end # source://parallel/lib/parallel.rb#228 def in_processes(options = T.unsafe(nil), &block); end @@ -47,70 +47,80 @@ module Parallel # source://parallel/lib/parallel.rb#312 def physical_processor_count; end - # Number of processors seen by the OS, used for process scheduling + # Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup, + # used for process scheduling # - # source://parallel/lib/parallel.rb#345 + # source://parallel/lib/parallel.rb#342 def processor_count; end - # source://parallel/lib/parallel.rb#350 + # source://parallel/lib/parallel.rb#346 def worker_number; end # TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed # - # source://parallel/lib/parallel.rb#355 + # source://parallel/lib/parallel.rb#351 def worker_number=(worker_num); end private - # source://parallel/lib/parallel.rb#361 + # source://parallel/lib/parallel.rb#384 def add_progress_bar!(job_factory, options); end - # source://parallel/lib/parallel.rb#624 + # source://parallel/lib/parallel.rb#699 + def available_processor_count; end + + # source://parallel/lib/parallel.rb#647 def call_with_index(item, index, options, &block); end - # source://parallel/lib/parallel.rb#556 + # source://parallel/lib/parallel.rb#579 def create_workers(job_factory, options, &block); end # options is either a Integer or a Hash with :count # - # source://parallel/lib/parallel.rb#614 + # source://parallel/lib/parallel.rb#637 def extract_count_from_options(options); end - # source://parallel/lib/parallel.rb#642 + # source://parallel/lib/parallel.rb#665 def instrument_finish(item, index, result, options); end # yield results in the order of the input items # needs to use `options` to store state between executions # needs to use `done` index since a nil result would also be valid # - # source://parallel/lib/parallel.rb#651 + # source://parallel/lib/parallel.rb#674 def instrument_finish_in_order(item, index, result, options); end - # source://parallel/lib/parallel.rb#671 + # source://parallel/lib/parallel.rb#694 def instrument_start(item, index, options); end - # source://parallel/lib/parallel.rb#590 + # source://parallel/lib/parallel.rb#357 + def physical_processor_count_windows; end + + # source://parallel/lib/parallel.rb#613 def process_incoming_jobs(read, write, job_factory, options, &block); end - # source://parallel/lib/parallel.rb#544 + # source://parallel/lib/parallel.rb#567 def replace_worker(job_factory, workers, index, options, blk); end - # source://parallel/lib/parallel.rb#635 + # source://parallel/lib/parallel.rb#378 + def run(command); end + + # source://parallel/lib/parallel.rb#658 def with_instrumentation(item, index, options); end - # source://parallel/lib/parallel.rb#386 + # source://parallel/lib/parallel.rb#409 def work_direct(job_factory, options, &block); end - # source://parallel/lib/parallel.rb#496 + # source://parallel/lib/parallel.rb#519 def work_in_processes(job_factory, options, &blk); end - # source://parallel/lib/parallel.rb#430 + # source://parallel/lib/parallel.rb#453 def work_in_ractors(job_factory, options); end - # source://parallel/lib/parallel.rb#405 + # source://parallel/lib/parallel.rb#428 def work_in_threads(job_factory, options, &block); end - # source://parallel/lib/parallel.rb#564 + # source://parallel/lib/parallel.rb#587 def worker(job_factory, options, &block); end end end diff --git a/sorbet/rbi/gems/parser@3.3.1.0.rbi b/sorbet/rbi/gems/parser@3.3.6.0.rbi similarity index 100% rename from sorbet/rbi/gems/parser@3.3.1.0.rbi rename to sorbet/rbi/gems/parser@3.3.6.0.rbi diff --git a/sorbet/rbi/gems/public_suffix@5.0.5.rbi b/sorbet/rbi/gems/public_suffix@5.0.5.rbi deleted file mode 100644 index 0b1ec490..00000000 --- a/sorbet/rbi/gems/public_suffix@5.0.5.rbi +++ /dev/null @@ -1,936 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `public_suffix` gem. -# Please instead update this file by running `bin/tapioca gem public_suffix`. - - -# PublicSuffix is a Ruby domain name parser based on the Public Suffix List. -# -# The [Public Suffix List](https://publicsuffix.org) is a cross-vendor initiative -# to provide an accurate list of domain name suffixes. -# -# The Public Suffix List is an initiative of the Mozilla Project, -# but is maintained as a community resource. It is available for use in any software, -# but was originally created to meet the needs of browser manufacturers. -# -# source://public_suffix/lib/public_suffix/domain.rb#9 -module PublicSuffix - class << self - # private - # - # source://public_suffix/lib/public_suffix.rb#149 - def decompose(name, rule); end - - # Attempt to parse the name and returns the domain, if valid. - # - # This method doesn't raise. Instead, it returns nil if the domain is not valid for whatever reason. - # - # @param name [#to_s] The domain name or fully qualified domain name to parse. - # @param list [PublicSuffix::List] The rule list to search, defaults to the default {PublicSuffix::List} - # @param ignore_private [Boolean] - # @return [String] - # - # source://public_suffix/lib/public_suffix.rb#140 - def domain(name, **options); end - - # Pretend we know how to deal with user input. - # - # source://public_suffix/lib/public_suffix.rb#164 - def normalize(name); end - - # Parses +name+ and returns the {PublicSuffix::Domain} instance. - # - # @example Parse a valid domain - # PublicSuffix.parse("google.com") - # # => # - # @example Parse a valid subdomain - # PublicSuffix.parse("www.google.com") - # # => # - # @example Parse a fully qualified domain - # PublicSuffix.parse("google.com.") - # # => # - # @example Parse a fully qualified domain (subdomain) - # PublicSuffix.parse("www.google.com.") - # # => # - # @example Parse an invalid (unlisted) domain - # PublicSuffix.parse("x.yz") - # # => # - # @example Parse an invalid (unlisted) domain with strict checking (without applying the default * rule) - # PublicSuffix.parse("x.yz", default_rule: nil) - # # => PublicSuffix::DomainInvalid: `x.yz` is not a valid domain - # @example Parse an URL (not supported, only domains) - # PublicSuffix.parse("http://www.google.com") - # # => PublicSuffix::DomainInvalid: http://www.google.com is not expected to contain a scheme - # @param name [#to_s] The domain name or fully qualified domain name to parse. - # @param list [PublicSuffix::List] The rule list to search, defaults to the default {PublicSuffix::List} - # @param ignore_private [Boolean] - # @raise [PublicSuffix::DomainInvalid] If domain is not a valid domain. - # @raise [PublicSuffix::DomainNotAllowed] If a rule for +domain+ is found, but the rule doesn't allow +domain+. - # @return [PublicSuffix::Domain] - # - # source://public_suffix/lib/public_suffix.rb#67 - def parse(name, list: T.unsafe(nil), default_rule: T.unsafe(nil), ignore_private: T.unsafe(nil)); end - - # Checks whether +domain+ is assigned and allowed, without actually parsing it. - # - # This method doesn't care whether domain is a domain or subdomain. - # The validation is performed using the default {PublicSuffix::List}. - # - # @example Validate a valid domain - # PublicSuffix.valid?("example.com") - # # => true - # @example Validate a valid subdomain - # PublicSuffix.valid?("www.example.com") - # # => true - # @example Validate a not-listed domain - # PublicSuffix.valid?("example.tldnotlisted") - # # => true - # @example Validate a not-listed domain with strict checking (without applying the default * rule) - # PublicSuffix.valid?("example.tldnotlisted") - # # => true - # PublicSuffix.valid?("example.tldnotlisted", default_rule: nil) - # # => false - # @example Validate a fully qualified domain - # PublicSuffix.valid?("google.com.") - # # => true - # PublicSuffix.valid?("www.google.com.") - # # => true - # @example Check an URL (which is not a valid domain) - # PublicSuffix.valid?("http://www.example.com") - # # => false - # @param name [#to_s] The domain name or fully qualified domain name to validate. - # @param ignore_private [Boolean] - # @return [Boolean] - # - # source://public_suffix/lib/public_suffix.rb#123 - def valid?(name, list: T.unsafe(nil), default_rule: T.unsafe(nil), ignore_private: T.unsafe(nil)); end - end -end - -# source://public_suffix/lib/public_suffix.rb#26 -PublicSuffix::BANG = T.let(T.unsafe(nil), String) - -# source://public_suffix/lib/public_suffix.rb#25 -PublicSuffix::DOT = T.let(T.unsafe(nil), String) - -# Domain represents a domain name, composed by a TLD, SLD and TRD. -# -# source://public_suffix/lib/public_suffix/domain.rb#12 -class PublicSuffix::Domain - # Creates and returns a new {PublicSuffix::Domain} instance. - # - # @example Initialize with a TLD and SLD - # PublicSuffix::Domain.new("com", "example") - # # => # - # @example Initialize with a TLD - # PublicSuffix::Domain.new("com") - # # => # - # @example Initialize with a TLD, SLD and TRD - # PublicSuffix::Domain.new("com", "example", "wwww") - # # => # - # @overload initialize - # @overload initialize - # @overload initialize - # @return [Domain] a new instance of Domain - # @yield [self] Yields on self. - # @yieldparam self [PublicSuffix::Domain] The newly creates instance - # - # source://public_suffix/lib/public_suffix/domain.rb#65 - def initialize(*args); end - - # Returns a domain-like representation of this object - # if the object is a {#domain?}, nil otherwise. - # - # PublicSuffix::Domain.new("com").domain - # # => nil - # - # PublicSuffix::Domain.new("com", "google").domain - # # => "google.com" - # - # PublicSuffix::Domain.new("com", "google", "www").domain - # # => "www.google.com" - # - # This method doesn't validate the input. It handles the domain - # as a valid domain name and simply applies the necessary transformations. - # - # This method returns a FQD, not just the domain part. - # To get the domain part, use #sld (aka second level domain). - # - # PublicSuffix::Domain.new("com", "google", "www").domain - # # => "google.com" - # - # PublicSuffix::Domain.new("com", "google", "www").sld - # # => "google" - # - # @return [String] - # @see #domain? - # @see #subdomain - # - # source://public_suffix/lib/public_suffix/domain.rb#137 - def domain; end - - # Checks whether self looks like a domain. - # - # This method doesn't actually validate the domain. - # It only checks whether the instance contains - # a value for the {#tld} and {#sld} attributes. - # - # @example - # - # PublicSuffix::Domain.new("com").domain? - # # => false - # - # PublicSuffix::Domain.new("com", "google").domain? - # # => true - # - # PublicSuffix::Domain.new("com", "google", "www").domain? - # # => true - # - # # This is an invalid domain, but returns true - # # because this method doesn't validate the content. - # PublicSuffix::Domain.new("com", nil).domain? - # # => true - # @return [Boolean] - # @see #subdomain? - # - # source://public_suffix/lib/public_suffix/domain.rb#198 - def domain?; end - - # Returns the full domain name. - # - # @example Gets the domain name of a domain - # PublicSuffix::Domain.new("com", "google").name - # # => "google.com" - # @example Gets the domain name of a subdomain - # PublicSuffix::Domain.new("com", "google", "www").name - # # => "www.google.com" - # @return [String] - # - # source://public_suffix/lib/public_suffix/domain.rb#105 - def name; end - - # Returns the value of attribute sld. - # - # source://public_suffix/lib/public_suffix/domain.rb#33 - def sld; end - - # Returns a subdomain-like representation of this object - # if the object is a {#subdomain?}, nil otherwise. - # - # PublicSuffix::Domain.new("com").subdomain - # # => nil - # - # PublicSuffix::Domain.new("com", "google").subdomain - # # => nil - # - # PublicSuffix::Domain.new("com", "google", "www").subdomain - # # => "www.google.com" - # - # This method doesn't validate the input. It handles the domain - # as a valid domain name and simply applies the necessary transformations. - # - # This method returns a FQD, not just the subdomain part. - # To get the subdomain part, use #trd (aka third level domain). - # - # PublicSuffix::Domain.new("com", "google", "www").subdomain - # # => "www.google.com" - # - # PublicSuffix::Domain.new("com", "google", "www").trd - # # => "www" - # - # @return [String] - # @see #subdomain? - # @see #domain - # - # source://public_suffix/lib/public_suffix/domain.rb#169 - def subdomain; end - - # Checks whether self looks like a subdomain. - # - # This method doesn't actually validate the subdomain. - # It only checks whether the instance contains - # a value for the {#tld}, {#sld} and {#trd} attributes. - # If you also want to validate the domain, - # use {#valid_subdomain?} instead. - # - # @example - # - # PublicSuffix::Domain.new("com").subdomain? - # # => false - # - # PublicSuffix::Domain.new("com", "google").subdomain? - # # => false - # - # PublicSuffix::Domain.new("com", "google", "www").subdomain? - # # => true - # - # # This is an invalid domain, but returns true - # # because this method doesn't validate the content. - # PublicSuffix::Domain.new("com", "example", nil).subdomain? - # # => true - # @return [Boolean] - # @see #domain? - # - # source://public_suffix/lib/public_suffix/domain.rb#229 - def subdomain?; end - - # Returns the value of attribute tld. - # - # source://public_suffix/lib/public_suffix/domain.rb#33 - def tld; end - - # Returns an array containing the domain parts. - # - # @example - # - # PublicSuffix::Domain.new("google.com").to_a - # # => [nil, "google", "com"] - # - # PublicSuffix::Domain.new("www.google.com").to_a - # # => [nil, "google", "com"] - # @return [Array] - # - # source://public_suffix/lib/public_suffix/domain.rb#89 - def to_a; end - - # Returns a string representation of this object. - # - # @return [String] - # - # source://public_suffix/lib/public_suffix/domain.rb#73 - def to_s; end - - # Returns the value of attribute trd. - # - # source://public_suffix/lib/public_suffix/domain.rb#33 - def trd; end - - class << self - # Splits a string into the labels, that is the dot-separated parts. - # - # The input is not validated, but it is assumed to be a valid domain name. - # - # @example - # - # name_to_labels('example.com') - # # => ['example', 'com'] - # - # name_to_labels('example.co.uk') - # # => ['example', 'co', 'uk'] - # @param name [String, #to_s] The domain name to split. - # @return [Array] - # - # source://public_suffix/lib/public_suffix/domain.rb#28 - def name_to_labels(name); end - end -end - -# Raised when trying to parse an invalid name. -# A name is considered invalid when no rule is found in the definition list. -# -# @example -# -# PublicSuffix.parse("nic.test") -# # => PublicSuffix::DomainInvalid -# -# PublicSuffix.parse("http://www.nic.it") -# # => PublicSuffix::DomainInvalid -# -# source://public_suffix/lib/public_suffix/errors.rb#25 -class PublicSuffix::DomainInvalid < ::PublicSuffix::Error; end - -# Raised when trying to parse a name that matches a suffix. -# -# @example -# -# PublicSuffix.parse("nic.do") -# # => PublicSuffix::DomainNotAllowed -# -# PublicSuffix.parse("www.nic.do") -# # => PublicSuffix::Domain -# -# source://public_suffix/lib/public_suffix/errors.rb#38 -class PublicSuffix::DomainNotAllowed < ::PublicSuffix::DomainInvalid; end - -# source://public_suffix/lib/public_suffix/errors.rb#11 -class PublicSuffix::Error < ::StandardError; end - -# A {PublicSuffix::List} is a collection of one -# or more {PublicSuffix::Rule}. -# -# Given a {PublicSuffix::List}, -# you can add or remove {PublicSuffix::Rule}, -# iterate all items in the list or search for the first rule -# which matches a specific domain name. -# -# # Create a new list -# list = PublicSuffix::List.new -# -# # Push two rules to the list -# list << PublicSuffix::Rule.factory("it") -# list << PublicSuffix::Rule.factory("com") -# -# # Get the size of the list -# list.size -# # => 2 -# -# # Search for the rule matching given domain -# list.find("example.com") -# # => # -# list.find("example.org") -# # => nil -# -# You can create as many {PublicSuffix::List} you want. -# The {PublicSuffix::List.default} rule list is used -# to tokenize and validate a domain. -# -# source://public_suffix/lib/public_suffix/list.rb#40 -class PublicSuffix::List - # Initializes an empty {PublicSuffix::List}. - # - # @return [List] a new instance of List - # @yield [self] Yields on self. - # @yieldparam self [PublicSuffix::List] The newly created instance. - # - # source://public_suffix/lib/public_suffix/list.rb#106 - def initialize; end - - # Adds the given object to the list and optionally refreshes the rule index. - # - # @param rule [PublicSuffix::Rule::*] the rule to add to the list - # @return [self] - # - # source://public_suffix/lib/public_suffix/list.rb#141 - def <<(rule); end - - # Checks whether two lists are equal. - # - # List one is equal to two, if two is an instance of - # {PublicSuffix::List} and each +PublicSuffix::Rule::*+ - # in list one is available in list two, in the same order. - # - # @param other [PublicSuffix::List] the List to compare - # @return [Boolean] - # - # source://public_suffix/lib/public_suffix/list.rb#120 - def ==(other); end - - # Adds the given object to the list and optionally refreshes the rule index. - # - # @param rule [PublicSuffix::Rule::*] the rule to add to the list - # @return [self] - # - # source://public_suffix/lib/public_suffix/list.rb#141 - def add(rule); end - - # Removes all rules. - # - # @return [self] - # - # source://public_suffix/lib/public_suffix/list.rb#164 - def clear; end - - # Gets the default rule. - # - # @return [PublicSuffix::Rule::*] - # @see PublicSuffix::Rule.default_rule - # - # source://public_suffix/lib/public_suffix/list.rb#226 - def default_rule; end - - # Iterates each rule in the list. - # - # source://public_suffix/lib/public_suffix/list.rb#128 - def each(&block); end - - # Checks whether the list is empty. - # - # @return [Boolean] - # - # source://public_suffix/lib/public_suffix/list.rb#157 - def empty?; end - - # Checks whether two lists are equal. - # - # List one is equal to two, if two is an instance of - # {PublicSuffix::List} and each +PublicSuffix::Rule::*+ - # in list one is available in list two, in the same order. - # - # @param other [PublicSuffix::List] the List to compare - # @return [Boolean] - # - # source://public_suffix/lib/public_suffix/list.rb#120 - def eql?(other); end - - # Finds and returns the rule corresponding to the longest public suffix for the hostname. - # - # @param name [#to_s] the hostname - # @param default [PublicSuffix::Rule::*] the default rule to return in case no rule matches - # @return [PublicSuffix::Rule::*] - # - # source://public_suffix/lib/public_suffix/list.rb#174 - def find(name, default: T.unsafe(nil), **options); end - - # Gets the number of rules in the list. - # - # @return [Integer] - # - # source://public_suffix/lib/public_suffix/list.rb#150 - def size; end - - protected - - # Returns the value of attribute rules. - # - # source://public_suffix/lib/public_suffix/list.rb#233 - def rules; end - - private - - # source://public_suffix/lib/public_suffix/list.rb#238 - def entry_to_rule(entry, value); end - - # source://public_suffix/lib/public_suffix/list.rb#242 - def rule_to_entry(rule); end - - # Selects all the rules matching given hostame. - # - # If `ignore_private` is set to true, the algorithm will skip the rules that are flagged as - # private domain. Note that the rules will still be part of the loop. - # If you frequently need to access lists ignoring the private domains, - # you should create a list that doesn't include these domains setting the - # `private_domains: false` option when calling {.parse}. - # - # Note that this method is currently private, as you should not rely on it. Instead, - # the public interface is {#find}. The current internal algorithm allows to return all - # matching rules, but different data structures may not be able to do it, and instead would - # return only the match. For this reason, you should rely on {#find}. - # - # @param name [#to_s] the hostname - # @param ignore_private [Boolean] - # @return [Array] - # - # source://public_suffix/lib/public_suffix/list.rb#199 - def select(name, ignore_private: T.unsafe(nil)); end - - class << self - # Gets the default rule list. - # - # Initializes a new {PublicSuffix::List} parsing the content - # of {PublicSuffix::List.default_list_content}, if required. - # - # @return [PublicSuffix::List] - # - # source://public_suffix/lib/public_suffix/list.rb#50 - def default(**options); end - - # Sets the default rule list to +value+. - # - # @param value [PublicSuffix::List] the new list - # @return [PublicSuffix::List] - # - # source://public_suffix/lib/public_suffix/list.rb#58 - def default=(value); end - - # Parse given +input+ treating the content as Public Suffix List. - # - # See http://publicsuffix.org/format/ for more details about input format. - # - # @param input [#each_line] the list to parse - # @param private_domains [Boolean] whether to ignore the private domains section - # @return [PublicSuffix::List] - # - # source://public_suffix/lib/public_suffix/list.rb#69 - def parse(input, private_domains: T.unsafe(nil)); end - end -end - -# source://public_suffix/lib/public_suffix/list.rb#42 -PublicSuffix::List::DEFAULT_LIST_PATH = T.let(T.unsafe(nil), String) - -# A Rule is a special object which holds a single definition -# of the Public Suffix List. -# -# There are 3 types of rules, each one represented by a specific -# subclass within the +PublicSuffix::Rule+ namespace. -# -# To create a new Rule, use the {PublicSuffix::Rule#factory} method. -# -# PublicSuffix::Rule.factory("ar") -# # => # -# -# source://public_suffix/lib/public_suffix/rule.rb#22 -module PublicSuffix::Rule - class << self - # The default rule to use if no rule match. - # - # The default rule is "*". From https://publicsuffix.org/list/: - # - # > If no rules match, the prevailing rule is "*". - # - # @return [PublicSuffix::Rule::Wildcard] The default rule. - # - # source://public_suffix/lib/public_suffix/rule.rb#344 - def default; end - - # Takes the +name+ of the rule, detects the specific rule class - # and creates a new instance of that class. - # The +name+ becomes the rule +value+. - # - # @example Creates a Normal rule - # PublicSuffix::Rule.factory("ar") - # # => # - # @example Creates a Wildcard rule - # PublicSuffix::Rule.factory("*.ar") - # # => # - # @example Creates an Exception rule - # PublicSuffix::Rule.factory("!congresodelalengua3.ar") - # # => # - # @param content [#to_s] the content of the rule - # @return [PublicSuffix::Rule::*] A rule instance. - # - # source://public_suffix/lib/public_suffix/rule.rb#326 - def factory(content, private: T.unsafe(nil)); end - end -end - -# = Abstract rule class -# -# This represent the base class for a Rule definition -# in the {Public Suffix List}[https://publicsuffix.org]. -# -# This is intended to be an Abstract class -# and you shouldn't create a direct instance. The only purpose -# of this class is to expose a common interface -# for all the available subclasses. -# -# * {PublicSuffix::Rule::Normal} -# * {PublicSuffix::Rule::Exception} -# * {PublicSuffix::Rule::Wildcard} -# -# ## Properties -# -# A rule is composed by 4 properties: -# -# value - A normalized version of the rule name. -# The normalization process depends on rule tpe. -# -# Here's an example -# -# PublicSuffix::Rule.factory("*.google.com") -# # -# -# ## Rule Creation -# -# The best way to create a new rule is passing the rule name -# to the PublicSuffix::Rule.factory method. -# -# PublicSuffix::Rule.factory("com") -# # => PublicSuffix::Rule::Normal -# -# PublicSuffix::Rule.factory("*.com") -# # => PublicSuffix::Rule::Wildcard -# -# This method will detect the rule type and create an instance -# from the proper rule class. -# -# ## Rule Usage -# -# A rule describes the composition of a domain name and explains how to tokenize -# the name into tld, sld and trd. -# -# To use a rule, you first need to be sure the name you want to tokenize -# can be handled by the current rule. -# You can use the #match? method. -# -# rule = PublicSuffix::Rule.factory("com") -# -# rule.match?("google.com") -# # => true -# -# rule.match?("google.com") -# # => false -# -# Rule order is significant. A name can match more than one rule. -# See the {Public Suffix Documentation}[http://publicsuffix.org/format/] -# to learn more about rule priority. -# -# When you have the right rule, you can use it to tokenize the domain name. -# -# rule = PublicSuffix::Rule.factory("com") -# -# rule.decompose("google.com") -# # => ["google", "com"] -# -# rule.decompose("www.google.com") -# # => ["www.google", "com"] -# -# @abstract -# -# source://public_suffix/lib/public_suffix/rule.rb#102 -class PublicSuffix::Rule::Base - # Initializes a new rule. - # - # @param value [String] - # @param private [Boolean] - # @return [Base] a new instance of Base - # - # source://public_suffix/lib/public_suffix/rule.rb#126 - def initialize(value:, length: T.unsafe(nil), private: T.unsafe(nil)); end - - # Checks whether this rule is equal to other. - # - # @param other [PublicSuffix::Rule::*] The rule to compare - # @return [Boolean] true if this rule and other are instances of the same class - # and has the same value, false otherwise. - # - # source://public_suffix/lib/public_suffix/rule.rb#137 - def ==(other); end - - # @abstract - # @param domain [#to_s] The domain name to decompose - # @raise [NotImplementedError] - # @return [Array] - # - # source://public_suffix/lib/public_suffix/rule.rb#180 - def decompose(*_arg0); end - - # Checks whether this rule is equal to other. - # - # @param other [PublicSuffix::Rule::*] The rule to compare - # @return [Boolean] true if this rule and other are instances of the same class - # and has the same value, false otherwise. - # - # source://public_suffix/lib/public_suffix/rule.rb#137 - def eql?(other); end - - # @return [String] the length of the rule - # - # source://public_suffix/lib/public_suffix/rule.rb#108 - def length; end - - # Checks if this rule matches +name+. - # - # A domain name is said to match a rule if and only if - # all of the following conditions are met: - # - # - When the domain and rule are split into corresponding labels, - # that the domain contains as many or more labels than the rule. - # - Beginning with the right-most labels of both the domain and the rule, - # and continuing for all labels in the rule, one finds that for every pair, - # either they are identical, or that the label from the rule is "*". - # - # @example - # PublicSuffix::Rule.factory("com").match?("example.com") - # # => true - # PublicSuffix::Rule.factory("com").match?("example.net") - # # => false - # @param name [String] the domain name to check - # @return [Boolean] - # @see https://publicsuffix.org/list/ - # - # source://public_suffix/lib/public_suffix/rule.rb#163 - def match?(name); end - - # @abstract - # @raise [NotImplementedError] - # - # source://public_suffix/lib/public_suffix/rule.rb#173 - def parts; end - - # @return [Boolean] true if the rule is a private domain - # - # source://public_suffix/lib/public_suffix/rule.rb#111 - def private; end - - # @return [String] the rule definition - # - # source://public_suffix/lib/public_suffix/rule.rb#105 - def value; end - - class << self - # Initializes a new rule from the content. - # - # @param content [String] the content of the rule - # @param private [Boolean] - # - # source://public_suffix/lib/public_suffix/rule.rb#118 - def build(content, private: T.unsafe(nil)); end - end -end - -# @api internal -# -# source://public_suffix/lib/public_suffix/rule.rb#25 -class PublicSuffix::Rule::Entry < ::Struct - # Returns the value of attribute length - # - # @return [Object] the current value of length - def length; end - - # Sets the attribute length - # - # @param value [Object] the value to set the attribute length to. - # @return [Object] the newly set value - def length=(_); end - - # Returns the value of attribute private - # - # @return [Object] the current value of private - def private; end - - # Sets the attribute private - # - # @param value [Object] the value to set the attribute private to. - # @return [Object] the newly set value - def private=(_); end - - # Returns the value of attribute type - # - # @return [Object] the current value of type - def type; end - - # Sets the attribute type - # - # @param value [Object] the value to set the attribute type to. - # @return [Object] the newly set value - def type=(_); end - - class << self - def [](*_arg0); end - def inspect; end - def keyword_init?; end - def members; end - def new(*_arg0); end - end -end - -# Exception represents an exception rule (e.g. !parliament.uk). -# -# source://public_suffix/lib/public_suffix/rule.rb#265 -class PublicSuffix::Rule::Exception < ::PublicSuffix::Rule::Base - # Decomposes the domain name according to rule properties. - # - # @param domain [#to_s] The domain name to decompose - # @return [Array] The array with [trd + sld, tld]. - # - # source://public_suffix/lib/public_suffix/rule.rb#286 - def decompose(domain); end - - # dot-split rule value and returns all rule parts - # in the order they appear in the value. - # The leftmost label is not considered a label. - # - # See http://publicsuffix.org/format/: - # If the prevailing rule is a exception rule, - # modify it by removing the leftmost label. - # - # @return [Array] - # - # source://public_suffix/lib/public_suffix/rule.rb#301 - def parts; end - - # Gets the original rule definition. - # - # @return [String] The rule definition. - # - # source://public_suffix/lib/public_suffix/rule.rb#278 - def rule; end - - class << self - # Initializes a new rule from the content. - # - # @param content [#to_s] the content of the rule - # @param private [Boolean] - # - # source://public_suffix/lib/public_suffix/rule.rb#271 - def build(content, private: T.unsafe(nil)); end - end -end - -# Normal represents a standard rule (e.g. com). -# -# source://public_suffix/lib/public_suffix/rule.rb#187 -class PublicSuffix::Rule::Normal < ::PublicSuffix::Rule::Base - # Decomposes the domain name according to rule properties. - # - # @param domain [#to_s] The domain name to decompose - # @return [Array] The array with [trd + sld, tld]. - # - # source://public_suffix/lib/public_suffix/rule.rb#200 - def decompose(domain); end - - # dot-split rule value and returns all rule parts - # in the order they appear in the value. - # - # @return [Array] - # - # source://public_suffix/lib/public_suffix/rule.rb#210 - def parts; end - - # Gets the original rule definition. - # - # @return [String] The rule definition. - # - # source://public_suffix/lib/public_suffix/rule.rb#192 - def rule; end -end - -# Wildcard represents a wildcard rule (e.g. *.co.uk). -# -# source://public_suffix/lib/public_suffix/rule.rb#217 -class PublicSuffix::Rule::Wildcard < ::PublicSuffix::Rule::Base - # Initializes a new rule. - # - # @param value [String] - # @param length [Integer] - # @param private [Boolean] - # @return [Wildcard] a new instance of Wildcard - # - # source://public_suffix/lib/public_suffix/rule.rb#232 - def initialize(value:, length: T.unsafe(nil), private: T.unsafe(nil)); end - - # Decomposes the domain name according to rule properties. - # - # @param domain [#to_s] The domain name to decompose - # @return [Array] The array with [trd + sld, tld]. - # - # source://public_suffix/lib/public_suffix/rule.rb#248 - def decompose(domain); end - - # dot-split rule value and returns all rule parts - # in the order they appear in the value. - # - # @return [Array] - # - # source://public_suffix/lib/public_suffix/rule.rb#258 - def parts; end - - # Gets the original rule definition. - # - # @return [String] The rule definition. - # - # source://public_suffix/lib/public_suffix/rule.rb#240 - def rule; end - - class << self - # Initializes a new rule from the content. - # - # @param content [String] the content of the rule - # @param private [Boolean] - # - # source://public_suffix/lib/public_suffix/rule.rb#223 - def build(content, private: T.unsafe(nil)); end - end -end - -# source://public_suffix/lib/public_suffix.rb#27 -PublicSuffix::STAR = T.let(T.unsafe(nil), String) - -# @return [String] the current library version -# -# source://public_suffix/lib/public_suffix/version.rb#12 -PublicSuffix::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/rack@3.1.7.rbi b/sorbet/rbi/gems/rack@3.1.7.rbi index 291783de..285a5a8d 100644 --- a/sorbet/rbi/gems/rack@3.1.7.rbi +++ b/sorbet/rbi/gems/rack@3.1.7.rbi @@ -2813,13 +2813,13 @@ class Rack::Request # source://rack/lib/rack/request.rb#71 def update_param(k, v); end - # source://yard/0.9.36lib/yard/server/rack_adapter.rb#94 + # source://yard/0.9.37lib/yard/server/rack_adapter.rb#94 def version_supplied; end - # source://yard/0.9.36lib/yard/server/rack_adapter.rb#94 + # source://yard/0.9.37lib/yard/server/rack_adapter.rb#94 def version_supplied=(_arg0); end - # source://yard/0.9.36lib/yard/server/rack_adapter.rb#96 + # source://yard/0.9.37lib/yard/server/rack_adapter.rb#96 def xhr?; end class << self diff --git a/sorbet/rbi/gems/rbi@0.2.0.rbi b/sorbet/rbi/gems/rbi@0.2.1.rbi similarity index 88% rename from sorbet/rbi/gems/rbi@0.2.0.rbi rename to sorbet/rbi/gems/rbi@0.2.1.rbi index e11d3f2f..a2725da7 100644 --- a/sorbet/rbi/gems/rbi@0.2.0.rbi +++ b/sorbet/rbi/gems/rbi@0.2.1.rbi @@ -475,6 +475,14 @@ class RBI::File end def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end + # source://rbi/lib/rbi/rbs_printer.rb#996 + sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void } + def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end + + # source://rbi/lib/rbi/rbs_printer.rb#1002 + sig { params(indent: ::Integer, print_locs: T::Boolean).returns(::String) } + def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end + # source://rbi/lib/rbi/model.rb#143 sig { returns(::RBI::Tree) } def root; end @@ -1133,6 +1141,14 @@ class RBI::Node end def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end + # source://rbi/lib/rbi/rbs_printer.rb#1013 + sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void } + def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end + + # source://rbi/lib/rbi/rbs_printer.rb#1019 + sig { params(indent: ::Integer, print_locs: T::Boolean).returns(::String) } + def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end + # @raise [ReplaceNodeError] # # source://rbi/lib/rbi/model.rb#35 @@ -1792,6 +1808,323 @@ class RBI::Public < ::RBI::Visibility def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end end +# source://rbi/lib/rbi/rbs_printer.rb#5 +class RBI::RBSPrinter < ::RBI::Visitor + # source://rbi/lib/rbi/rbs_printer.rb#18 + sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void } + def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end + + # source://rbi/lib/rbi/rbs_printer.rb#15 + sig { returns(::Integer) } + def current_indent; end + + # source://rbi/lib/rbi/rbs_printer.rb#35 + sig { void } + def dedent; end + + # @return [Boolean] + # + # source://rbi/lib/rbi/rbs_printer.rb#9 + def in_visibility_group; end + + # @return [Boolean] + # + # source://rbi/lib/rbi/rbs_printer.rb#9 + def in_visibility_group=(_arg0); end + + # Printing + # + # source://rbi/lib/rbi/rbs_printer.rb#30 + sig { void } + def indent; end + + # source://rbi/lib/rbi/rbs_printer.rb#12 + sig { returns(T.nilable(::RBI::Node)) } + def previous_node; end + + # Print a string without indentation nor `\n` at the end. + # + # source://rbi/lib/rbi/rbs_printer.rb#41 + sig { params(string: ::String).void } + def print(string); end + + # source://rbi/lib/rbi/rbs_printer.rb#275 + sig { params(node: ::RBI::Attr, sig: ::RBI::Sig).void } + def print_attr_sig(node, sig); end + + # source://rbi/lib/rbi/rbs_printer.rb#9 + sig { returns(T::Boolean) } + def print_locs; end + + # @return [Boolean] + # + # source://rbi/lib/rbi/rbs_printer.rb#9 + def print_locs=(_arg0); end + + # source://rbi/lib/rbi/rbs_printer.rb#350 + sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void } + def print_method_sig(node, sig); end + + # Print a string with indentation and `\n` at the end. + # + # source://rbi/lib/rbi/rbs_printer.rb#61 + sig { params(string: ::String).void } + def printl(string); end + + # Print a string without indentation but with a `\n` at the end. + # + # source://rbi/lib/rbi/rbs_printer.rb#47 + sig { params(string: T.nilable(::String)).void } + def printn(string = T.unsafe(nil)); end + + # Print a string with indentation but without a `\n` at the end. + # + # source://rbi/lib/rbi/rbs_printer.rb#54 + sig { params(string: T.nilable(::String)).void } + def printt(string = T.unsafe(nil)); end + + # source://rbi/lib/rbi/rbs_printer.rb#67 + sig { override.params(nodes: T::Array[::RBI::Node]).void } + def visit_all(nodes); end + + # source://rbi/lib/rbi/rbs_printer.rb#505 + sig { override.params(node: ::RBI::Arg).void } + def visit_arg(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#243 + sig { params(node: ::RBI::Attr).void } + def visit_attr(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#228 + sig { override.params(node: ::RBI::AttrAccessor).void } + def visit_attr_accessor(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#233 + sig { override.params(node: ::RBI::AttrReader).void } + def visit_attr_reader(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#238 + sig { override.params(node: ::RBI::AttrWriter).void } + def visit_attr_writer(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#106 + sig { override.params(node: ::RBI::BlankLine).void } + def visit_blank_line(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#444 + sig { override.params(node: ::RBI::BlockParam).void } + def visit_block_param(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#123 + sig { override.params(node: ::RBI::Class).void } + def visit_class(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#90 + sig { override.params(node: ::RBI::Comment).void } + def visit_comment(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#625 + sig { override.params(node: ::RBI::ConflictTree).void } + def visit_conflict_tree(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#213 + sig { override.params(node: ::RBI::Const).void } + def visit_const(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#454 + sig { override.params(node: ::RBI::Extend).void } + def visit_extend(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#78 + sig { override.params(file: ::RBI::File).void } + def visit_file(file); end + + # source://rbi/lib/rbi/rbs_printer.rb#601 + sig { override.params(node: ::RBI::Group).void } + def visit_group(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#591 + sig { override.params(node: ::RBI::Helper).void } + def visit_helper(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#449 + sig { override.params(node: ::RBI::Include).void } + def visit_include(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#510 + sig { override.params(node: ::RBI::KwArg).void } + def visit_kw_arg(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#434 + sig { override.params(node: ::RBI::KwOptParam).void } + def visit_kw_opt_param(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#429 + sig { override.params(node: ::RBI::KwParam).void } + def visit_kw_param(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#439 + sig { override.params(node: ::RBI::KwRestParam).void } + def visit_kw_rest_param(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#292 + sig { override.params(node: ::RBI::Method).void } + def visit_method(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#596 + sig { override.params(node: ::RBI::MixesInClassMethods).void } + def visit_mixes_in_class_methods(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#459 + sig { params(node: ::RBI::Mixin).void } + def visit_mixin(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#118 + sig { override.params(node: ::RBI::Module).void } + def visit_module(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#419 + sig { override.params(node: ::RBI::OptParam).void } + def visit_opt_param(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#486 + sig { override.params(node: ::RBI::Private).void } + def visit_private(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#481 + sig { override.params(node: ::RBI::Protected).void } + def visit_protected(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#476 + sig { override.params(node: ::RBI::Public).void } + def visit_public(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#414 + sig { override.params(node: ::RBI::ReqParam).void } + def visit_req_param(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#620 + sig { override.params(node: ::RBI::RequiresAncestor).void } + def visit_requires_ancestor(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#424 + sig { override.params(node: ::RBI::RestParam).void } + def visit_rest_param(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#138 + sig { params(node: ::RBI::Scope).void } + def visit_scope(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#201 + sig { params(node: ::RBI::Scope).void } + def visit_scope_body(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#634 + sig { override.params(node: ::RBI::ScopeConflict).void } + def visit_scope_conflict(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#148 + sig { params(node: ::RBI::Scope).void } + def visit_scope_header(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#500 + sig { override.params(node: ::RBI::Send).void } + def visit_send(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#133 + sig { override.params(node: ::RBI::SingletonClass).void } + def visit_singleton_class(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#128 + sig { override.params(node: ::RBI::Struct).void } + def visit_struct(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#563 + sig { override.params(node: ::RBI::TEnum).void } + def visit_tenum(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#568 + sig { override.params(node: ::RBI::TEnumBlock).void } + def visit_tenum_block(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#111 + sig { override.params(node: ::RBI::Tree).void } + def visit_tree(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#515 + sig { override.params(node: ::RBI::TStruct).void } + def visit_tstruct(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#549 + sig { override.params(node: ::RBI::TStructConst).void } + def visit_tstruct_const(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#556 + sig { override.params(node: ::RBI::TStructProp).void } + def visit_tstruct_prop(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#586 + sig { override.params(node: ::RBI::TypeMember).void } + def visit_type_member(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#491 + sig { params(node: ::RBI::Visibility).void } + def visit_visibility(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#607 + sig { override.params(node: ::RBI::VisibilityGroup).void } + def visit_visibility_group(node); end + + private + + # source://rbi/lib/rbi/rbs_printer.rb#782 + sig { params(node: ::RBI::Type).returns(T::Boolean) } + def bare_nilable_proc?(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#777 + sig { params(node: ::RBI::Type).returns(T::Boolean) } + def bare_proc?(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#725 + sig { params(node: ::RBI::Node).returns(T::Boolean) } + def oneline?(node); end + + # Parse a string containing a `T.let(x, X)` and extract the type + # + # Returns `nil` is the string is not a `T.let`. + # + # source://rbi/lib/rbi/rbs_printer.rb#759 + sig { params(code: T.nilable(::String)).returns(T.nilable(::String)) } + def parse_t_let(code); end + + # source://rbi/lib/rbi/rbs_printer.rb#747 + sig { params(type: T.any(::RBI::Type, ::String)).returns(::RBI::Type) } + def parse_type(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#650 + sig { params(node: ::RBI::Node).void } + def print_blank_line_before(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#669 + sig { params(node: ::RBI::Node).void } + def print_loc(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#699 + sig { params(node: ::RBI::Param, last: T::Boolean).void } + def print_param_comment_leading_space(node, last:); end + + # source://rbi/lib/rbi/rbs_printer.rb#675 + sig { params(node: ::RBI::Method, param: ::RBI::SigParam).void } + def print_sig_param(node, param); end + + # source://rbi/lib/rbi/rbs_printer.rb#717 + sig { params(node: ::RBI::SigParam, last: T::Boolean).void } + def print_sig_param_comment_leading_space(node, last:); end +end + +# source://rbi/lib/rbi/rbs_printer.rb#6 +class RBI::RBSPrinter::Error < ::RBI::Error; end + # source://rbi/lib/rbi/model.rb#5 class RBI::ReplaceNodeError < ::RBI::Error; end @@ -2164,7 +2497,7 @@ class RBI::Rewriters::Merge::Conflict < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -2409,7 +2742,7 @@ class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct def to_s; end class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -2955,7 +3288,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.16.2lib/tapioca/rbi_ext/model.rb#38 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#38 sig do params( name: ::String, @@ -2965,19 +3298,19 @@ class RBI::Tree < ::RBI::NodeWithComments end def create_class(name, superclass_name: T.unsafe(nil), &block); end - # source://tapioca/0.16.2lib/tapioca/rbi_ext/model.rb#45 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#45 sig { params(name: ::String, value: ::String).void } def create_constant(name, value:); end - # source://tapioca/0.16.2lib/tapioca/rbi_ext/model.rb#55 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#55 sig { params(name: ::String).void } def create_extend(name); end - # source://tapioca/0.16.2lib/tapioca/rbi_ext/model.rb#50 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#50 sig { params(name: ::String).void } def create_include(name); end - # source://tapioca/0.16.2lib/tapioca/rbi_ext/model.rb#90 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#90 sig do params( name: ::String, @@ -2991,19 +3324,19 @@ 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), &block); end - # source://tapioca/0.16.2lib/tapioca/rbi_ext/model.rb#60 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#60 sig { params(name: ::String).void } def create_mixes_in_class_methods(name); end - # source://tapioca/0.16.2lib/tapioca/rbi_ext/model.rb#25 + # source://tapioca/0.16.3lib/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.16.2lib/tapioca/rbi_ext/model.rb#9 + # source://tapioca/0.16.3lib/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.16.2lib/tapioca/rbi_ext/model.rb#74 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#74 sig do params( name: ::String, @@ -3081,11 +3414,11 @@ class RBI::Tree < ::RBI::NodeWithComments private - # source://tapioca/0.16.2lib/tapioca/rbi_ext/model.rb#123 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#123 sig { params(node: ::RBI::Node).returns(::RBI::Node) } def create_node(node); end - # source://tapioca/0.16.2lib/tapioca/rbi_ext/model.rb#118 + # source://tapioca/0.16.3lib/tapioca/rbi_ext/model.rb#118 sig { returns(T::Hash[::String, ::RBI::Node]) } def nodes_cache; end end @@ -3151,6 +3484,10 @@ class RBI::Type sig { returns(::RBI::Type) } def non_nilable; end + # source://rbi/lib/rbi/rbs_printer.rb#1030 + sig { returns(::String) } + def rbs_string; end + # @abstract # # source://rbi/lib/rbi/type.rb#758 @@ -3839,6 +4176,99 @@ class RBI::TypeMember < ::RBI::NodeWithComments def value; end end +# source://rbi/lib/rbi/rbs_printer.rb#787 +class RBI::TypePrinter + # source://rbi/lib/rbi/rbs_printer.rb#794 + sig { void } + def initialize; end + + # source://rbi/lib/rbi/rbs_printer.rb#791 + sig { returns(::String) } + def string; end + + # source://rbi/lib/rbi/rbs_printer.rb#799 + sig { params(node: ::RBI::Type).void } + def visit(node); end + + # source://rbi/lib/rbi/rbs_printer.rb#907 + sig { params(type: ::RBI::Type::All).void } + def visit_all(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#917 + sig { params(type: ::RBI::Type::Any).void } + def visit_any(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#864 + sig { params(type: ::RBI::Type::Anything).void } + def visit_anything(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#889 + sig { params(type: ::RBI::Type::AttachedClass).void } + def visit_attached_class(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#848 + sig { params(type: ::RBI::Type::Boolean).void } + def visit_boolean(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#969 + sig { params(type: ::RBI::Type::Class).void } + def visit_class(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#900 + sig { params(type: ::RBI::Type::ClassOf).void } + def visit_class_of(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#853 + sig { params(type: ::RBI::Type::Generic).void } + def visit_generic(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#894 + sig { params(type: ::RBI::Type::Nilable).void } + def visit_nilable(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#874 + sig { params(type: ::RBI::Type::NoReturn).void } + def visit_no_return(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#948 + sig { params(type: ::RBI::Type::Proc).void } + def visit_proc(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#884 + sig { params(type: ::RBI::Type::SelfType).void } + def visit_self_type(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#937 + sig { params(type: ::RBI::Type::Shape).void } + def visit_shape(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#843 + sig { params(type: ::RBI::Type::Simple).void } + def visit_simple(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#927 + sig { params(type: ::RBI::Type::Tuple).void } + def visit_tuple(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#964 + sig { params(type: ::RBI::Type::TypeParameter).void } + def visit_type_parameter(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#879 + sig { params(type: ::RBI::Type::Untyped).void } + def visit_untyped(type); end + + # source://rbi/lib/rbi/rbs_printer.rb#869 + sig { params(type: ::RBI::Type::Void).void } + def visit_void(type); end + + private + + # source://rbi/lib/rbi/rbs_printer.rb#978 + sig { params(type_name: ::String).returns(::String) } + def translate_t_type(type_name); end +end + # source://rbi/lib/rbi/rewriters/attr_to_methods.rb#5 class RBI::UnexpectedMultipleSigsError < ::RBI::Error # source://rbi/lib/rbi/rewriters/attr_to_methods.rb#10 diff --git a/sorbet/rbi/gems/regexp_parser@2.9.0.rbi b/sorbet/rbi/gems/regexp_parser@2.9.2.rbi similarity index 99% rename from sorbet/rbi/gems/regexp_parser@2.9.0.rbi rename to sorbet/rbi/gems/regexp_parser@2.9.2.rbi index 4be234e8..d714e938 100644 --- a/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +++ b/sorbet/rbi/gems/regexp_parser@2.9.2.rbi @@ -1133,7 +1133,7 @@ end # source://regexp_parser/lib/regexp_parser/expression/classes/keep.rb#2 module Regexp::Expression::Keep; end -# TOOD: in regexp_parser v3.0.0 this should possibly be a Subexpression +# TODO: in regexp_parser v3.0.0 this should possibly be a Subexpression # that contains all expressions to its left. # # source://regexp_parser/lib/regexp_parser/expression/classes/keep.rb#5 @@ -2369,7 +2369,7 @@ class Regexp::Parser # source://regexp_parser/lib/regexp_parser/parser.rb#262 def assign_effective_number(exp); end - # Assigns referenced expressions to refering expressions, e.g. if there is + # Assigns referenced expressions to referring expressions, e.g. if there is # an instance of Backreference::Number, its #referenced_expression is set to # the instance of Group::Capture that it refers to via its number. # diff --git a/sorbet/rbi/gems/rexml@3.3.8.rbi b/sorbet/rbi/gems/rexml@3.3.8.rbi deleted file mode 100644 index 9c67f05b..00000000 --- a/sorbet/rbi/gems/rexml@3.3.8.rbi +++ /dev/null @@ -1,4961 +0,0 @@ -# typed: false - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `rexml` gem. -# Please instead update this file by running `bin/tapioca gem rexml`. - - -# This class needs: -# * Documentation -# * Work! Not all types of attlists are intelligently parsed, so we just -# spew back out what we get in. This works, but it would be better if -# we formatted the output ourselves. -# -# AttlistDecls provide *just* enough support to allow namespace -# declarations. If you need some sort of generalized support, or have an -# interesting idea about how to map the hideous, terrible design of DTD -# AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate -# for anything to make DTDs more palateable. -# -# source://rexml/lib/rexml/attlistdecl.rb#18 -class REXML::AttlistDecl < ::REXML::Child - include ::Enumerable - - # Create an AttlistDecl, pulling the information from a Source. Notice - # that this isn't very convenient; to create an AttlistDecl, you basically - # have to format it yourself, and then have the initializer parse it. - # Sorry, but for the foreseeable future, DTD support in REXML is pretty - # weak on convenience. Have I mentioned how much I hate DTDs? - # - # @return [AttlistDecl] a new instance of AttlistDecl - # - # source://rexml/lib/rexml/attlistdecl.rb#29 - def initialize(source); end - - # Access the attlist attribute/value pairs. - # value = attlist_decl[ attribute_name ] - # - # source://rexml/lib/rexml/attlistdecl.rb#38 - def [](key); end - - # Iterate over the key/value pairs: - # attlist_decl.each { |attribute_name, attribute_value| ... } - # - # source://rexml/lib/rexml/attlistdecl.rb#50 - def each(&block); end - - # What is this? Got me. - # - # source://rexml/lib/rexml/attlistdecl.rb#22 - def element_name; end - - # Whether an attlist declaration includes the given attribute definition - # if attlist_decl.include? "xmlns:foobar" - # - # @return [Boolean] - # - # source://rexml/lib/rexml/attlistdecl.rb#44 - def include?(key); end - - # source://rexml/lib/rexml/attlistdecl.rb#59 - def node_type; end - - # Write out exactly what we got in. - # - # source://rexml/lib/rexml/attlistdecl.rb#55 - def write(out, indent = T.unsafe(nil)); end -end - -# Defines an Element Attribute; IE, a attribute=value pair, as in: -# . Attributes can be in their own -# namespaces. General users of REXML will not interact with the -# Attribute class much. -# -# source://rexml/lib/rexml/attribute.rb#10 -class REXML::Attribute - include ::REXML::Node - include ::REXML::XMLTokens - include ::REXML::Namespace - - # Constructor. - # FIXME: The parser doesn't catch illegal characters in attributes - # - # first:: - # Either: an Attribute, which this new attribute will become a - # clone of; or a String, which is the name of this attribute - # second:: - # If +first+ is an Attribute, then this may be an Element, or nil. - # If nil, then the Element parent of this attribute is the parent - # of the +first+ Attribute. If the first argument is a String, - # then this must also be a String, and is the content of the attribute. - # If this is the content, it must be fully normalized (contain no - # illegal characters). - # parent:: - # Ignored unless +first+ is a String; otherwise, may be the Element - # parent of this attribute, or nil. - # - # - # Attribute.new( attribute_to_clone ) - # Attribute.new( attribute_to_clone, parent_element ) - # Attribute.new( "attr", "attr_value" ) - # Attribute.new( "attr", "attr_value", parent_element ) - # - # @return [Attribute] a new instance of Attribute - # - # source://rexml/lib/rexml/attribute.rb#42 - def initialize(first, second = T.unsafe(nil), parent = T.unsafe(nil)); end - - # Returns true if other is an Attribute and has the same name and value, - # false otherwise. - # - # source://rexml/lib/rexml/attribute.rb#106 - def ==(other); end - - # Returns a copy of this attribute - # - # source://rexml/lib/rexml/attribute.rb#164 - def clone; end - - # source://rexml/lib/rexml/attribute.rb#132 - def doctype; end - - # The element to which this attribute belongs - # - # source://rexml/lib/rexml/attribute.rb#15 - def element; end - - # Sets the element of which this object is an attribute. Normally, this - # is not directly called. - # - # Returns this attribute - # - # source://rexml/lib/rexml/attribute.rb#172 - def element=(element); end - - # Creates (and returns) a hash from both the name and value - # - # source://rexml/lib/rexml/attribute.rb#111 - def hash; end - - # source://rexml/lib/rexml/attribute.rb#198 - def inspect; end - - # Returns the namespace URL, if defined, or nil otherwise - # - # e = Element.new("el") - # e.add_namespace("ns", "http://url") - # e.add_attribute("ns:a", "b") - # e.add_attribute("nsx:a", "c") - # e.attribute("ns:a").namespace # => "http://url" - # e.attribute("nsx:a").namespace # => nil - # - # This method always returns "" for no namespace attribute. Because - # the default namespace doesn't apply to attribute names. - # - # From https://www.w3.org/TR/xml-names/#uniqAttrs - # - # > the default namespace does not apply to attribute names - # - # e = REXML::Element.new("el") - # e.add_namespace("", "http://example.com/") - # e.namespace # => "http://example.com/" - # e.add_attribute("a", "b") - # e.attribute("a").namespace # => "" - # - # source://rexml/lib/rexml/attribute.rb#95 - def namespace(arg = T.unsafe(nil)); end - - # source://rexml/lib/rexml/attribute.rb#194 - def node_type; end - - # The normalized value of this attribute. That is, the attribute with - # entities intact. - # - # source://rexml/lib/rexml/attribute.rb#158 - def normalized=(new_normalized); end - - # Returns the namespace of the attribute. - # - # e = Element.new( "elns:myelement" ) - # e.add_attribute( "nsa:a", "aval" ) - # e.add_attribute( "b", "bval" ) - # e.attributes.get_attribute( "a" ).prefix # -> "nsa" - # e.attributes.get_attribute( "b" ).prefix # -> "" - # a = Attribute.new( "x", "y" ) - # a.prefix # -> "" - # - # source://rexml/lib/rexml/attribute.rb#70 - def prefix; end - - # Removes this Attribute from the tree, and returns true if successful - # - # This method is usually not called directly. - # - # source://rexml/lib/rexml/attribute.rb#185 - def remove; end - - # Returns the attribute value, with entities replaced - # - # source://rexml/lib/rexml/attribute.rb#140 - def to_s; end - - # Returns this attribute out as XML source, expanding the name - # - # a = Attribute.new( "x", "y" ) - # a.to_string # -> "x='y'" - # b = Attribute.new( "ns:x", "y" ) - # b.to_string # -> "ns:x='y'" - # - # source://rexml/lib/rexml/attribute.rb#121 - def to_string; end - - # Returns the UNNORMALIZED value of this attribute. That is, entities - # have been expanded to their values - # - # source://rexml/lib/rexml/attribute.rb#149 - def value; end - - # Writes this attribute (EG, puts 'key="value"' to the output) - # - # source://rexml/lib/rexml/attribute.rb#190 - def write(output, indent = T.unsafe(nil)); end - - # source://rexml/lib/rexml/attribute.rb#204 - def xpath; end -end - -# A class that defines the set of Attributes of an Element and provides -# operations for accessing elements in that set. -# -# source://rexml/lib/rexml/element.rb#2137 -class REXML::Attributes < ::Hash - # :call-seq: - # new(element) - # - # Creates and returns a new \REXML::Attributes object. - # The element given by argument +element+ is stored, - # but its own attributes are not modified: - # - # ele = REXML::Element.new('foo') - # attrs = REXML::Attributes.new(ele) - # attrs.object_id == ele.attributes.object_id # => false - # - # Other instance methods in class \REXML::Attributes may refer to: - # - # - +element.document+. - # - +element.prefix+. - # - +element.expanded_name+. - # - # @return [Attributes] a new instance of Attributes - # - # source://rexml/lib/rexml/element.rb#2156 - def initialize(element); end - - # :call-seq: - # add(attribute) -> attribute - # - # Adds attribute +attribute+, replacing the previous - # attribute of the same name if it exists; - # returns +attribute+: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # attrs = ele.attributes - # attrs # => {"att"=>{"foo"=>foo:att='1', "bar"=>bar:att='2', ""=>att='<'}} - # attrs.add(REXML::Attribute.new('foo:att', '2')) # => foo:att='2' - # attrs.add(REXML::Attribute.new('baz', '3')) # => baz='3' - # attrs.include?('baz') # => true - # - # source://rexml/lib/rexml/element.rb#2522 - def <<(attribute); end - - # :call-seq: - # [name] -> attribute_value or nil - # - # Returns the value for the attribute given by +name+, - # if it exists; otherwise +nil+. - # The value returned is the unnormalized attribute value, - # with entities expanded: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.elements['//ele'] # => - # ele.attributes['att'] # => "<" - # ele.attributes['bar:att'] # => "2" - # ele.attributes['nosuch'] # => nil - # - # Related: get_attribute (returns an \Attribute object). - # - # source://rexml/lib/rexml/element.rb#2181 - def [](name); end - - # :call-seq: - # [name] = value -> value - # - # When +value+ is non-+nil+, - # assigns that to the attribute for the given +name+, - # overwriting the previous value if it exists: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # attrs = ele.attributes - # attrs['foo:att'] = '2' # => "2" - # attrs['baz:att'] = '3' # => "3" - # - # When +value+ is +nil+, deletes the attribute if it exists: - # - # attrs['baz:att'] = nil - # attrs.include?('baz:att') # => false - # - # source://rexml/lib/rexml/element.rb#2365 - def []=(name, value); end - - # :call-seq: - # add(attribute) -> attribute - # - # Adds attribute +attribute+, replacing the previous - # attribute of the same name if it exists; - # returns +attribute+: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # attrs = ele.attributes - # attrs # => {"att"=>{"foo"=>foo:att='1', "bar"=>bar:att='2', ""=>att='<'}} - # attrs.add(REXML::Attribute.new('foo:att', '2')) # => foo:att='2' - # attrs.add(REXML::Attribute.new('baz', '3')) # => baz='3' - # attrs.include?('baz') # => true - # - # source://rexml/lib/rexml/element.rb#2522 - def add(attribute); end - - # :call-seq: - # delete(name) -> element - # delete(attribute) -> element - # - # Removes a specified attribute if it exists; - # returns the attributes' element. - # - # When string argument +name+ is given, - # removes the attribute of that name if it exists: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # attrs = ele.attributes - # attrs.delete('foo:att') # => - # attrs.delete('foo:att') # => - # - # When attribute argument +attribute+ is given, - # removes that attribute if it exists: - # - # attr = REXML::Attribute.new('bar:att', '2') - # attrs.delete(attr) # => # => - # attrs.delete(attr) # => # => - # - # source://rexml/lib/rexml/element.rb#2475 - def delete(attribute); end - - # :call-seq: - # delete_all(name) -> array_of_removed_attributes - # - # Removes all attributes matching the given +name+; - # returns an array of the removed attributes: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # attrs = ele.attributes - # attrs.delete_all('att') # => [att='<'] - # - # source://rexml/lib/rexml/element.rb#2544 - def delete_all(name); end - - # :call-seq: - # each {|expanded_name, value| ... } - # - # Calls the given block with each expanded-name/value pair: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # ele.attributes.each do |expanded_name, value| - # p [expanded_name, value] - # end - # - # Output: - # - # ["foo:att", "1"] - # ["bar:att", "2"] - # ["att", "<"] - # - # source://rexml/lib/rexml/element.rb#2283 - def each; end - - # :call-seq: - # each_attribute {|attr| ... } - # - # Calls the given block with each \REXML::Attribute object: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # ele.attributes.each_attribute do |attr| - # p [attr.class, attr] - # end - # - # Output: - # - # [REXML::Attribute, foo:att='1'] - # [REXML::Attribute, bar:att='2'] - # [REXML::Attribute, att='<'] - # - # source://rexml/lib/rexml/element.rb#2250 - def each_attribute; end - - # :call-seq: - # get_attribute(name) -> attribute_object or nil - # - # Returns the \REXML::Attribute object for the given +name+: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # attrs = ele.attributes - # attrs.get_attribute('foo:att') # => foo:att='1' - # attrs.get_attribute('foo:att').class # => REXML::Attribute - # attrs.get_attribute('bar:att') # => bar:att='2' - # attrs.get_attribute('att') # => att='<' - # attrs.get_attribute('nosuch') # => nil - # - # source://rexml/lib/rexml/element.rb#2309 - def get_attribute(name); end - - # :call-seq: - # get_attribute_ns(namespace, name) - # - # Returns the \REXML::Attribute object among the attributes - # that matches the given +namespace+ and +name+: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # attrs = ele.attributes - # attrs.get_attribute_ns('http://foo', 'att') # => foo:att='1' - # attrs.get_attribute_ns('http://foo', 'nosuch') # => nil - # - # source://rexml/lib/rexml/element.rb#2570 - def get_attribute_ns(namespace, name); end - - # :call-seq: - # length - # - # Returns the count of attributes: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # ele.attributes.length # => 3 - # - # source://rexml/lib/rexml/element.rb#2221 - def length; end - - # :call-seq: - # namespaces - # - # Returns a hash of name/value pairs for the namespaces: - # - # xml_string = '' - # d = REXML::Document.new(xml_string) - # d.root.attributes.namespaces # => {"xmlns"=>"foo", "x"=>"bar", "y"=>"twee"} - # - # source://rexml/lib/rexml/element.rb#2431 - def namespaces; end - - # :call-seq: - # prefixes -> array_of_prefix_strings - # - # Returns an array of prefix strings in the attributes. - # The array does not include the default - # namespace declaration, if one exists. - # - # xml_string = '' - # d = REXML::Document.new(xml_string) - # d.root.attributes.prefixes # => ["x", "y"] - # - # source://rexml/lib/rexml/element.rb#2406 - def prefixes; end - - # :call-seq: - # length - # - # Returns the count of attributes: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # ele.attributes.length # => 3 - # - # source://rexml/lib/rexml/element.rb#2221 - def size; end - - # :call-seq: - # to_a -> array_of_attribute_objects - # - # Returns an array of \REXML::Attribute objects representing - # the attributes: - # - # xml_string = <<-EOT - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # ele = d.root.elements['//ele'] # => - # attrs = ele.attributes.to_a # => [foo:att='1', bar:att='2', att='<'] - # attrs.first.class # => REXML::Attribute - # - # source://rexml/lib/rexml/element.rb#2203 - def to_a; end -end - -# source://rexml/lib/rexml/cdata.rb#5 -class REXML::CData < ::REXML::Text - # Constructor. CData is data between - # - # _Examples_ - # CData.new( source ) - # CData.new( "Here is some CDATA" ) - # CData.new( "Some unprocessed data", respect_whitespace_TF, parent_element ) - # - # @return [CData] a new instance of CData - # - # source://rexml/lib/rexml/cdata.rb#16 - def initialize(first, whitespace = T.unsafe(nil), parent = T.unsafe(nil)); end - - # Make a copy of this object - # - # _Examples_ - # c = CData.new( "Some text" ) - # d = c.clone - # d.to_s # -> "Some text" - # - # source://rexml/lib/rexml/cdata.rb#26 - def clone; end - - # Returns the content of this CData object - # - # _Examples_ - # c = CData.new( "Some text" ) - # c.to_s # -> "Some text" - # - # source://rexml/lib/rexml/cdata.rb#35 - def to_s; end - - # source://rexml/lib/rexml/cdata.rb#39 - def value; end - - # == DEPRECATED - # See the rexml/formatters package - # - # Generates XML output of this object - # - # output:: - # Where to write the string. Defaults to $stdout - # indent:: - # The amount to indent this node by - # transitive:: - # Ignored - # ie_hack:: - # Ignored - # - # _Examples_ - # c = CData.new( " Some text " ) - # c.write( $stdout ) #-> - # - # source://rexml/lib/rexml/cdata.rb#60 - def write(output = T.unsafe(nil), indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end -end - -# A Child object is something contained by a parent, and this class -# contains methods to support that. Most user code will not use this -# class directly. -# -# source://rexml/lib/rexml/child.rb#9 -class REXML::Child - include ::REXML::Node - - # Constructor. Any inheritors of this class should call super to make - # sure this method is called. - # parent:: - # if supplied, the parent of this child will be set to the - # supplied value, and self will be added to the parent - # - # @return [Child] a new instance of Child - # - # source://rexml/lib/rexml/child.rb#18 - def initialize(parent = T.unsafe(nil)); end - - # This doesn't yet handle encodings - # - # source://rexml/lib/rexml/child.rb#91 - def bytes; end - - # Returns:: the document this child belongs to, or nil if this child - # belongs to no document - # - # source://rexml/lib/rexml/child.rb#85 - def document; end - - # source://rexml/lib/rexml/node.rb#11 - def next_sibling; end - - # Sets the next sibling of this child. This can be used to insert a child - # after some other child. - # a = Element.new("a") - # b = a.add_element("b") - # c = Element.new("c") - # b.next_sibling = c - # # => - # - # source://rexml/lib/rexml/child.rb#68 - def next_sibling=(other); end - - # The Parent of this object - # - # source://rexml/lib/rexml/child.rb#11 - def parent; end - - # Sets the parent of this child to the supplied argument. - # - # other:: - # Must be a Parent object. If this object is the same object as the - # existing parent of this child, no action is taken. Otherwise, this - # child is removed from the current parent (if one exists), and is added - # to the new parent. - # Returns:: The parent added - # - # source://rexml/lib/rexml/child.rb#52 - def parent=(other); end - - # source://rexml/lib/rexml/node.rb#17 - def previous_sibling; end - - # Sets the previous sibling of this child. This can be used to insert a - # child before some other child. - # a = Element.new("a") - # b = a.add_element("b") - # c = Element.new("c") - # b.previous_sibling = c - # # => - # - # source://rexml/lib/rexml/child.rb#79 - def previous_sibling=(other); end - - # Removes this child from the parent. - # - # Returns:: self - # - # source://rexml/lib/rexml/child.rb#37 - def remove; end - - # Replaces this object with another object. Basically, calls - # Parent.replace_child - # - # Returns:: self - # - # source://rexml/lib/rexml/child.rb#29 - def replace_with(child); end -end - -# Represents an XML comment; that is, text between \ -# -# source://rexml/lib/rexml/comment.rb#7 -class REXML::Comment < ::REXML::Child - include ::Comparable - - # Constructor. The first argument can be one of three types: - # argument. If Comment, the argument is duplicated. If - # Source, the argument is scanned for a comment. - # should be nil, not supplied, or a Parent to be set as the parent - # of this object - # - # @param first If String, the contents of this comment are set to the - # @param second If the first argument is a Source, this argument - # @return [Comment] a new instance of Comment - # - # source://rexml/lib/rexml/comment.rb#24 - def initialize(first, second = T.unsafe(nil)); end - - # Compares this Comment to another; the contents of the comment are used - # in the comparison. - # - # source://rexml/lib/rexml/comment.rb#63 - def <=>(other); end - - # Compares this Comment to another; the contents of the comment are used - # in the comparison. - # - # source://rexml/lib/rexml/comment.rb#70 - def ==(other); end - - # source://rexml/lib/rexml/comment.rb#33 - def clone; end - - # source://rexml/lib/rexml/comment.rb#75 - def node_type; end - - # The content text - # - # source://rexml/lib/rexml/comment.rb#14 - def string; end - - # The content text - # - # source://rexml/lib/rexml/comment.rb#14 - def string=(_arg0); end - - # The content text - # - # source://rexml/lib/rexml/comment.rb#14 - def to_s; end - - # == DEPRECATED - # See REXML::Formatters - # - # output:: - # Where to write the string - # indent:: - # An integer. If -1, no indenting will be used; otherwise, the - # indentation will be this number of spaces, and children will be - # indented an additional amount. - # transitive:: - # Ignored by this class. The contents of comments are never modified. - # ie_hack:: - # Needed for conformity to the child API, but not used by this class. - # - # source://rexml/lib/rexml/comment.rb#50 - def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end -end - -# source://rexml/lib/rexml/xpath_parser.rb#11 -module REXML::DClonable; end - -# This is an abstract class. You never use this directly; it serves as a -# parent class for the specific declarations. -# -# source://rexml/lib/rexml/doctype.rb#242 -class REXML::Declaration < ::REXML::Child - # @return [Declaration] a new instance of Declaration - # - # source://rexml/lib/rexml/doctype.rb#243 - def initialize(src); end - - # source://rexml/lib/rexml/doctype.rb#248 - def to_s; end - - # == DEPRECATED - # See REXML::Formatters - # - # source://rexml/lib/rexml/doctype.rb#255 - def write(output, indent); end -end - -# Represents an XML DOCTYPE declaration; that is, the contents of . DOCTYPES can be used to declare the DTD of a document, as well as -# being used to declare entities used in the document. -# -# source://rexml/lib/rexml/doctype.rb#51 -class REXML::DocType < ::REXML::Parent - include ::REXML::XMLTokens - - # Constructor - # - # dt = DocType.new( 'foo', '-//I/Hate/External/IDs' ) - # # - # dt = DocType.new( doctype_to_clone ) - # # Incomplete. Shallow clone of doctype - # - # +Note+ that the constructor: - # - # Doctype.new( Source.new( "" ) ) - # - # is _deprecated_. Do not use it. It will probably disappear. - # - # @return [DocType] a new instance of DocType - # - # source://rexml/lib/rexml/doctype.rb#80 - def initialize(first, parent = T.unsafe(nil)); end - - # source://rexml/lib/rexml/doctype.rb#185 - def add(child); end - - # source://rexml/lib/rexml/doctype.rb#125 - def attribute_of(element, attribute); end - - # source://rexml/lib/rexml/doctype.rb#115 - def attributes_of(element); end - - # source://rexml/lib/rexml/doctype.rb#135 - def clone; end - - # source://rexml/lib/rexml/doctype.rb#173 - def context; end - - # name is the name of the doctype - # external_id is the referenced DTD, if given - # - # source://rexml/lib/rexml/doctype.rb#66 - def entities; end - - # source://rexml/lib/rexml/doctype.rb#181 - def entity(name); end - - # name is the name of the doctype - # external_id is the referenced DTD, if given - # - # source://rexml/lib/rexml/doctype.rb#66 - def external_id; end - - # name is the name of the doctype - # external_id is the referenced DTD, if given - # - # source://rexml/lib/rexml/doctype.rb#66 - def name; end - - # name is the name of the doctype - # external_id is the referenced DTD, if given - # - # source://rexml/lib/rexml/doctype.rb#66 - def namespaces; end - - # source://rexml/lib/rexml/doctype.rb#111 - def node_type; end - - # Retrieves a named notation. Only notations declared in the internal - # DTD subset can be retrieved. - # - # Method contributed by Henrik Martensson - # - # source://rexml/lib/rexml/doctype.rb#229 - def notation(name); end - - # This method returns a list of notations that have been declared in the - # _internal_ DTD subset. Notations in the external DTD subset are not - # listed. - # - # Method contributed by Henrik Martensson - # - # source://rexml/lib/rexml/doctype.rb#221 - def notations; end - - # This method retrieves the public identifier identifying the document's - # DTD. - # - # Method contributed by Henrik Martensson - # - # source://rexml/lib/rexml/doctype.rb#195 - def public; end - - # This method retrieves the system identifier identifying the document's DTD - # - # Method contributed by Henrik Martensson - # - # source://rexml/lib/rexml/doctype.rb#207 - def system; end - - # output:: - # Where to write the string - # indent:: - # An integer. If -1, no indentation will be used; otherwise, the - # indentation will be this number of spaces, and children will be - # indented an additional amount. - # transitive:: - # Ignored - # ie_hack:: - # Ignored - # - # source://rexml/lib/rexml/doctype.rb#149 - def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end -end - -# Represents an XML document. -# -# A document may have: -# -# - A single child that may be accessed via method #root. -# - An XML declaration. -# - A document type. -# - Processing instructions. -# -# == In a Hurry? -# -# If you're somewhat familiar with XML -# and have a particular task in mind, -# you may want to see the -# {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html], -# and in particular, the -# {tasks page for documents}[../doc/rexml/tasks/tocs/document_toc_rdoc.html]. -# -# source://rexml/lib/rexml/document.rb#35 -class REXML::Document < ::REXML::Element - # :call-seq: - # new(string = nil, context = {}) -> new_document - # new(io_stream = nil, context = {}) -> new_document - # new(document = nil, context = {}) -> new_document - # - # Returns a new \REXML::Document object. - # - # When no arguments are given, - # returns an empty document: - # - # d = REXML::Document.new - # d.to_s # => "" - # - # When argument +string+ is given, it must be a string - # containing a valid XML document: - # - # xml_string = 'FooBar' - # d = REXML::Document.new(xml_string) - # d.to_s # => "FooBar" - # - # When argument +io_stream+ is given, it must be an \IO object - # that is opened for reading, and when read must return a valid XML document: - # - # File.write('t.xml', xml_string) - # d = File.open('t.xml', 'r') do |io| - # REXML::Document.new(io) - # end - # d.to_s # => "FooBar" - # - # When argument +document+ is given, it must be an existing - # document object, whose context and attributes (but not children) - # are cloned into the new document: - # - # d = REXML::Document.new(xml_string) - # d.children # => [ ... ] - # d.context = {raw: :all, compress_whitespace: :all} - # d.add_attributes({'bar' => 0, 'baz' => 1}) - # d1 = REXML::Document.new(d) - # d1.children # => [] - # d1.context # => {:raw=>:all, :compress_whitespace=>:all} - # d1.attributes # => {"bar"=>bar='0', "baz"=>baz='1'} - # - # When argument +context+ is given, it must be a hash - # containing context entries for the document; - # see {Element Context}[../doc/rexml/context_rdoc.html]: - # - # context = {raw: :all, compress_whitespace: :all} - # d = REXML::Document.new(xml_string, context) - # d.context # => {:raw=>:all, :compress_whitespace=>:all} - # - # @return [Document] a new instance of Document - # - # source://rexml/lib/rexml/document.rb#92 - def initialize(source = T.unsafe(nil), context = T.unsafe(nil)); end - - # :call-seq: - # add(xml_decl) -> self - # add(doc_type) -> self - # add(object) -> self - # - # Adds an object to the document; returns +self+. - # - # When argument +xml_decl+ is given, - # it must be an REXML::XMLDecl object, - # which becomes the XML declaration for the document, - # replacing the previous XML declaration if any: - # - # d = REXML::Document.new - # d.xml_decl.to_s # => "" - # d.add(REXML::XMLDecl.new('2.0')) - # d.xml_decl.to_s # => "" - # - # When argument +doc_type+ is given, - # it must be an REXML::DocType object, - # which becomes the document type for the document, - # replacing the previous document type, if any: - # - # d = REXML::Document.new - # d.doctype.to_s # => "" - # d.add(REXML::DocType.new('foo')) - # d.doctype.to_s # => "" - # - # When argument +object+ (not an REXML::XMLDecl or REXML::DocType object) - # is given it is added as the last child: - # - # d = REXML::Document.new - # d.add(REXML::Element.new('foo')) - # d.to_s # => "" - # - # source://rexml/lib/rexml/document.rb#172 - def <<(child); end - - # :call-seq: - # add(xml_decl) -> self - # add(doc_type) -> self - # add(object) -> self - # - # Adds an object to the document; returns +self+. - # - # When argument +xml_decl+ is given, - # it must be an REXML::XMLDecl object, - # which becomes the XML declaration for the document, - # replacing the previous XML declaration if any: - # - # d = REXML::Document.new - # d.xml_decl.to_s # => "" - # d.add(REXML::XMLDecl.new('2.0')) - # d.xml_decl.to_s # => "" - # - # When argument +doc_type+ is given, - # it must be an REXML::DocType object, - # which becomes the document type for the document, - # replacing the previous document type, if any: - # - # d = REXML::Document.new - # d.doctype.to_s # => "" - # d.add(REXML::DocType.new('foo')) - # d.doctype.to_s # => "" - # - # When argument +object+ (not an REXML::XMLDecl or REXML::DocType object) - # is given it is added as the last child: - # - # d = REXML::Document.new - # d.add(REXML::Element.new('foo')) - # d.to_s # => "" - # - # source://rexml/lib/rexml/document.rb#172 - def add(child); end - - # :call-seq: - # add_element(name_or_element = nil, attributes = nil) -> new_element - # - # Adds an element to the document by calling REXML::Element.add_element: - # - # REXML::Element.add_element(name_or_element, attributes) - # - # source://rexml/lib/rexml/document.rb#211 - def add_element(arg = T.unsafe(nil), arg2 = T.unsafe(nil)); end - - # :call-seq: - # clone -> new_document - # - # Returns the new document resulting from executing - # Document.new(self). See Document.new. - # - # source://rexml/lib/rexml/document.rb#122 - def clone; end - - # :call-seq: - # doctype -> doc_type or nil - # - # Returns the DocType object for the document, if it exists, otherwise +nil+: - # - # d = REXML::Document.new('') - # d.doctype.class # => REXML::DocType - # d = REXML::Document.new('') - # d.doctype.class # => nil - # - # source://rexml/lib/rexml/document.rb#243 - def doctype; end - - # source://rexml/lib/rexml/document.rb#446 - def document; end - - # :call-seq: - # encoding -> encoding_string - # - # Returns the XMLDecl encoding of the document, - # - # d = REXML::Document.new('') - # d.encoding # => "UTF-16" - # d = REXML::Document.new('') - # d.encoding # => "UTF-8" - # - # source://rexml/lib/rexml/document.rb#292 - def encoding; end - - # Returns the value of attribute entity_expansion_count. - # - # source://rexml/lib/rexml/document.rb#435 - def entity_expansion_count; end - - # Sets the attribute entity_expansion_limit - # - # @param value the value to set the attribute entity_expansion_limit to. - # - # source://rexml/lib/rexml/document.rb#436 - def entity_expansion_limit=(_arg0); end - - # Returns the value of attribute entity_expansion_text_limit. - # - # source://rexml/lib/rexml/document.rb#437 - def entity_expansion_text_limit; end - - # Sets the attribute entity_expansion_text_limit - # - # @param value the value to set the attribute entity_expansion_text_limit to. - # - # source://rexml/lib/rexml/document.rb#437 - def entity_expansion_text_limit=(_arg0); end - - # :call-seq: - # expanded_name -> empty_string - # - # Returns an empty string. - # - # source://rexml/lib/rexml/document.rb#131 - def expanded_name; end - - # :call-seq: - # expanded_name -> empty_string - # - # Returns an empty string. - # d = doc_type - # d ? d.name : "UNDEFINED" - # - # source://rexml/lib/rexml/document.rb#131 - def name; end - - # :call-seq: - # node_type -> :document - # - # Returns the symbol +:document+. - # - # source://rexml/lib/rexml/document.rb#112 - def node_type; end - - # source://rexml/lib/rexml/document.rb#439 - def record_entity_expansion; end - - # :call-seq: - # root -> root_element or nil - # - # Returns the root element of the document, if it exists, otherwise +nil+: - # - # d = REXML::Document.new('') - # d.root # => - # d = REXML::Document.new('') - # d.root # => nil - # - # source://rexml/lib/rexml/document.rb#227 - def root; end - - # :call-seq: - # stand_alone? - # - # Returns the XMLDecl standalone value of the document as a string, - # if it has been set, otherwise the default standalone value: - # - # d = REXML::Document.new('') - # d.stand_alone? # => "yes" - # d = REXML::Document.new('') - # d.stand_alone? # => nil - # - # @return [Boolean] - # - # source://rexml/lib/rexml/document.rb#307 - def stand_alone?; end - - # :call-seq: - # version -> version_string - # - # Returns the XMLDecl version of this document as a string, - # if it has been set, otherwise the default version: - # - # d = REXML::Document.new('') - # d.version # => "2.0" - # d = REXML::Document.new('') - # d.version # => "1.0" - # - # source://rexml/lib/rexml/document.rb#277 - def version; end - - # :call-seq: - # doc.write(output=$stdout, indent=-1, transtive=false, ie_hack=false, encoding=nil) - # doc.write(options={:output => $stdout, :indent => -1, :transtive => false, :ie_hack => false, :encoding => nil}) - # - # Write the XML tree out, optionally with indent. This writes out the - # entire XML document, including XML declarations, doctype declarations, - # and processing instructions (if any are given). - # - # A controversial point is whether Document should always write the XML - # declaration () whether or not one is given by the - # user (or source document). REXML does not write one if one was not - # specified, because it adds unnecessary bandwidth to applications such - # as XML-RPC. - # - # Accept Nth argument style and options Hash style as argument. - # The recommended style is options Hash style for one or more - # arguments case. - # - # _Examples_ - # Document.new("").write - # - # output = "" - # Document.new("").write(output) - # - # output = "" - # Document.new("").write(:output => output, :indent => 2) - # - # See also the classes in the rexml/formatters package for the proper way - # to change the default formatting of XML output. - # - # _Examples_ - # - # output = "" - # tr = Transitive.new - # tr.write(Document.new(""), output) - # - # output:: - # output an object which supports '<< string'; this is where the - # document will be written. - # indent:: - # An integer. If -1, no indenting will be used; otherwise, the - # indentation will be twice this number of spaces, and children will be - # indented an additional amount. For a value of 3, every item will be - # indented 3 more levels, or 6 more spaces (2 * 3). Defaults to -1 - # transitive:: - # If transitive is true and indent is >= 0, then the output will be - # pretty-printed in such a way that the added whitespace does not affect - # the absolute *value* of the document -- that is, it leaves the value - # and number of Text nodes in the document unchanged. - # ie_hack:: - # This hack inserts a space before the /> on empty tags to address - # a limitation of Internet Explorer. Defaults to false - # Encoding name as String. Change output encoding to specified encoding - # instead of encoding in XML declaration. - # Defaults to nil. It means encoding in XML declaration is used. - # - # source://rexml/lib/rexml/document.rb#367 - def write(*arguments); end - - # :call-seq: - # xml_decl -> xml_decl - # - # Returns the XMLDecl object for the document, if it exists, - # otherwise the default XMLDecl object: - # - # d = REXML::Document.new('') - # d.xml_decl.class # => REXML::XMLDecl - # d.xml_decl.to_s # => "" - # d = REXML::Document.new('') - # d.xml_decl.class # => REXML::XMLDecl - # d.xml_decl.to_s # => "" - # - # source://rexml/lib/rexml/document.rb#260 - def xml_decl; end - - private - - # source://rexml/lib/rexml/document.rb#451 - def build(source); end - - class << self - # Get the entity expansion limit. By default the limit is set to 10000. - # - # Deprecated. Use REXML::Security.entity_expansion_limit= instead. - # - # source://rexml/lib/rexml/document.rb#417 - def entity_expansion_limit; end - - # Set the entity expansion limit. By default the limit is set to 10000. - # - # Deprecated. Use REXML::Security.entity_expansion_limit= instead. - # - # source://rexml/lib/rexml/document.rb#410 - def entity_expansion_limit=(val); end - - # Get the entity expansion limit. By default the limit is set to 10240. - # - # Deprecated. Use REXML::Security.entity_expansion_text_limit instead. - # - # source://rexml/lib/rexml/document.rb#431 - def entity_expansion_text_limit; end - - # Set the entity expansion limit. By default the limit is set to 10240. - # - # Deprecated. Use REXML::Security.entity_expansion_text_limit= instead. - # - # source://rexml/lib/rexml/document.rb#424 - def entity_expansion_text_limit=(val); end - - # source://rexml/lib/rexml/document.rb#403 - def parse_stream(source, listener); end - end -end - -# An \REXML::Element object represents an XML element. -# -# An element: -# -# - Has a name (string). -# - May have a parent (another element). -# - Has zero or more children -# (other elements, text, CDATA, processing instructions, and comments). -# - Has zero or more siblings -# (other elements, text, CDATA, processing instructions, and comments). -# - Has zero or more named attributes. -# -# == In a Hurry? -# -# If you're somewhat familiar with XML -# and have a particular task in mind, -# you may want to see the -# {tasks pages}[../doc/rexml/tasks/tocs/master_toc_rdoc.html], -# and in particular, the -# {tasks page for elements}[../doc/rexml/tasks/tocs/element_toc_rdoc.html]. -# -# === Name -# -# An element has a name, which is initially set when the element is created: -# -# e = REXML::Element.new('foo') -# e.name # => "foo" -# -# The name may be changed: -# -# e.name = 'bar' -# e.name # => "bar" -# -# -# === \Parent -# -# An element may have a parent. -# -# Its parent may be assigned explicitly when the element is created: -# -# e0 = REXML::Element.new('foo') -# e1 = REXML::Element.new('bar', e0) -# e1.parent # => ... -# -# Note: the representation of an element always shows the element's name. -# If the element has children, the representation indicates that -# by including an ellipsis (...). -# -# The parent may be assigned explicitly at any time: -# -# e2 = REXML::Element.new('baz') -# e1.parent = e2 -# e1.parent # => -# -# When an element is added as a child, its parent is set automatically: -# -# e1.add_element(e0) -# e0.parent # => ... -# -# For an element that has no parent, method +parent+ returns +nil+. -# -# === Children -# -# An element has zero or more children. -# The children are an ordered collection -# of all objects whose parent is the element itself. -# -# The children may include any combination of elements, text, comments, -# processing instructions, and CDATA. -# (This example keeps things clean by controlling whitespace -# via a +context+ setting.) -# -# xml_string = <<-EOT -# -# -# text 0 -# -# -# -# -# text 1 -# -# -# -# -# EOT -# context = {ignore_whitespace_nodes: :all, compress_whitespace: :all} -# d = REXML::Document.new(xml_string, context) -# root = d.root -# root.children.size # => 10 -# root.each {|child| p "#{child.class}: #{child}" } -# -# Output: -# -# "REXML::Element: " -# "REXML::Text: \n text 0\n " -# "REXML::Comment: comment 0" -# "REXML::Instruction: " -# "REXML::CData: cdata 0" -# "REXML::Element: " -# "REXML::Text: \n text 1\n " -# "REXML::Comment: comment 1" -# "REXML::Instruction: " -# "REXML::CData: cdata 1" -# -# A child may be added using inherited methods -# Parent#insert_before or Parent#insert_after: -# -# xml_string = '' -# d = REXML::Document.new(xml_string) -# root = d.root -# c = d.root[1] # => -# root.insert_before(c, REXML::Element.new('b')) -# root.to_a # => [, , , ] -# -# A child may be replaced using Parent#replace_child: -# -# root.replace_child(c, REXML::Element.new('x')) -# root.to_a # => [, , , ] -# -# A child may be removed using Parent#delete: -# -# x = root[2] # => -# root.delete(x) -# root.to_a # => [, , ] -# -# === Siblings -# -# An element has zero or more siblings, -# which are the other children of the element's parent. -# -# In the example above, element +ele_1+ is between a CDATA sibling -# and a text sibling: -# -# ele_1 = root[5] # => -# ele_1.previous_sibling # => "cdata 0" -# ele_1.next_sibling # => "\n text 1\n " -# -# === \Attributes -# -# An element has zero or more named attributes. -# -# A new element has no attributes: -# -# e = REXML::Element.new('foo') -# e.attributes # => {} -# -# Attributes may be added: -# -# e.add_attribute('bar', 'baz') -# e.add_attribute('bat', 'bam') -# e.attributes.size # => 2 -# e['bar'] # => "baz" -# e['bat'] # => "bam" -# -# An existing attribute may be modified: -# -# e.add_attribute('bar', 'bad') -# e.attributes.size # => 2 -# e['bar'] # => "bad" -# -# An existing attribute may be deleted: -# -# e.delete_attribute('bar') -# e.attributes.size # => 1 -# e['bar'] # => nil -# -# == What's Here -# -# To begin with, what's elsewhere? -# -# \Class \REXML::Element inherits from its ancestor classes: -# -# - REXML::Child -# - REXML::Parent -# -# \REXML::Element itself and its ancestors also include modules: -# -# - {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html] -# - REXML::Namespace -# - REXML::Node -# - REXML::XMLTokens -# -# === Methods for Creating an \Element -# -# ::new:: Returns a new empty element. -# #clone:: Returns a clone of another element. -# -# === Methods for Attributes -# -# {[attribute_name]}[#method-i-5B-5D]:: Returns an attribute value. -# #add_attribute:: Adds a new attribute. -# #add_attributes:: Adds multiple new attributes. -# #attribute:: Returns the attribute value for a given name and optional namespace. -# #delete_attribute:: Removes an attribute. -# -# === Methods for Children -# -# {[index]}[#method-i-5B-5D]:: Returns the child at the given offset. -# #add_element:: Adds an element as the last child. -# #delete_element:: Deletes a child element. -# #each_element:: Calls the given block with each child element. -# #each_element_with_attribute:: Calls the given block with each child element -# that meets given criteria, -# which can include the attribute name. -# #each_element_with_text:: Calls the given block with each child element -# that meets given criteria, -# which can include text. -# #get_elements:: Returns an array of element children that match a given xpath. -# -# === Methods for \Text Children -# -# #add_text:: Adds a text node to the element. -# #get_text:: Returns a text node that meets specified criteria. -# #text:: Returns the text string from the first node that meets specified criteria. -# #texts:: Returns an array of the text children of the element. -# #text=:: Adds, removes, or replaces the first text child of the element -# -# === Methods for Other Children -# -# #cdatas:: Returns an array of the cdata children of the element. -# #comments:: Returns an array of the comment children of the element. -# #instructions:: Returns an array of the instruction children of the element. -# -# === Methods for Namespaces -# -# #add_namespace:: Adds a namespace to the element. -# #delete_namespace:: Removes a namespace from the element. -# #namespace:: Returns the string namespace URI for the element. -# #namespaces:: Returns a hash of all defined namespaces in the element. -# #prefixes:: Returns an array of the string prefixes (names) -# of all defined namespaces in the element -# -# === Methods for Querying -# -# #document:: Returns the document, if any, that the element belongs to. -# #root:: Returns the most distant element (not document) ancestor of the element. -# #root_node:: Returns the most distant ancestor of the element. -# #xpath:: Returns the string xpath to the element -# relative to the most distant parent -# #has_attributes?:: Returns whether the element has attributes. -# #has_elements?:: Returns whether the element has elements. -# #has_text?:: Returns whether the element has text. -# #next_element:: Returns the next sibling that is an element. -# #previous_element:: Returns the previous sibling that is an element. -# #raw:: Returns whether raw mode is set for the element. -# #whitespace:: Returns whether whitespace is respected for the element. -# #ignore_whitespace_nodes:: Returns whether whitespace nodes -# are to be ignored for the element. -# #node_type:: Returns symbol :element. -# -# === One More Method -# -# #inspect:: Returns a string representation of the element. -# -# === Accessors -# -# #elements:: Returns the REXML::Elements object for the element. -# #attributes:: Returns the REXML::Attributes object for the element. -# #context:: Returns or sets the context hash for the element. -# -# source://rexml/lib/rexml/element.rb#271 -class REXML::Element < ::REXML::Parent - include ::REXML::XMLTokens - include ::REXML::Namespace - - # :call-seq: - # Element.new(name = 'UNDEFINED', parent = nil, context = nil) -> new_element - # Element.new(element, parent = nil, context = nil) -> new_element - # - # Returns a new \REXML::Element object. - # - # When no arguments are given, - # returns an element with name 'UNDEFINED': - # - # e = REXML::Element.new # => - # e.class # => REXML::Element - # e.name # => "UNDEFINED" - # - # When only argument +name+ is given, - # returns an element of the given name: - # - # REXML::Element.new('foo') # => - # - # When only argument +element+ is given, it must be an \REXML::Element object; - # returns a shallow copy of the given element: - # - # e0 = REXML::Element.new('foo') - # e1 = REXML::Element.new(e0) # => - # - # When argument +parent+ is also given, it must be an REXML::Parent object: - # - # e = REXML::Element.new('foo', REXML::Parent.new) - # e.parent # => #]> - # - # When argument +context+ is also given, it must be a hash - # representing the context for the element; - # see {Element Context}[../doc/rexml/context_rdoc.html]: - # - # e = REXML::Element.new('foo', nil, {raw: :all}) - # e.context # => {:raw=>:all} - # - # @return [Element] a new instance of Element - # - # source://rexml/lib/rexml/element.rb#319 - def initialize(arg = T.unsafe(nil), parent = T.unsafe(nil), context = T.unsafe(nil)); end - - # :call-seq: - # [index] -> object - # [attr_name] -> attr_value - # [attr_sym] -> attr_value - # - # With integer argument +index+ given, - # returns the child at offset +index+, or +nil+ if none: - # - # d = REXML::Document.new '>textmore' - # root = d.root - # (0..root.size).each do |index| - # node = root[index] - # p "#{index}: #{node} (#{node.class})" - # end - # - # Output: - # - # "0: (REXML::Element)" - # "1: text (REXML::Text)" - # "2: (REXML::Element)" - # "3: more (REXML::Text)" - # "4: (REXML::Element)" - # "5: (NilClass)" - # - # With string argument +attr_name+ given, - # returns the string value for the given attribute name if it exists, - # otherwise +nil+: - # - # d = REXML::Document.new('') - # root = d.root - # root['attr'] # => "value" - # root['nosuch'] # => nil - # - # With symbol argument +attr_sym+ given, - # returns [attr_sym.to_s]: - # - # root[:attr] # => "value" - # root[:nosuch] # => nil - # - # source://rexml/lib/rexml/element.rb#1246 - def [](name_or_index); end - - # :call-seq: - # add_attribute(name, value) -> value - # add_attribute(attribute) -> attribute - # - # Adds an attribute to this element, overwriting any existing attribute - # by the same name. - # - # With string argument +name+ and object +value+ are given, - # adds the attribute created with that name and value: - # - # e = REXML::Element.new - # e.add_attribute('attr', 'value') # => "value" - # e['attr'] # => "value" - # e.add_attribute('attr', 'VALUE') # => "VALUE" - # e['attr'] # => "VALUE" - # - # With only attribute object +attribute+ given, - # adds the given attribute: - # - # a = REXML::Attribute.new('attr', 'value') - # e.add_attribute(a) # => attr='value' - # e['attr'] # => "value" - # a = REXML::Attribute.new('attr', 'VALUE') - # e.add_attribute(a) # => attr='VALUE' - # e['attr'] # => "VALUE" - # - # source://rexml/lib/rexml/element.rb#1345 - def add_attribute(key, value = T.unsafe(nil)); end - - # :call-seq: - # add_attributes(hash) -> hash - # add_attributes(array) - # - # Adds zero or more attributes to the element; - # returns the argument. - # - # If hash argument +hash+ is given, - # each key must be a string; - # adds each attribute created with the key/value pair: - # - # e = REXML::Element.new - # h = {'foo' => 'bar', 'baz' => 'bat'} - # e.add_attributes(h) - # - # If argument +array+ is given, - # each array member must be a 2-element array [name, value]; - # each name must be a string: - # - # e = REXML::Element.new - # a = [['foo' => 'bar'], ['baz' => 'bat']] - # e.add_attributes(a) - # - # source://rexml/lib/rexml/element.rb#1376 - def add_attributes(hash); end - - # :call-seq: - # add_element(name, attributes = nil) -> new_element - # add_element(element, attributes = nil) -> element - # - # Adds a child element, optionally setting attributes - # on the added element; returns the added element. - # - # With string argument +name+, creates a new element with that name - # and adds the new element as a child: - # - # e0 = REXML::Element.new('foo') - # e0.add_element('bar') - # e0[0] # => - # - # - # With argument +name+ and hash argument +attributes+, - # sets attributes on the new element: - # - # e0.add_element('baz', {'bat' => '0', 'bam' => '1'}) - # e0[1] # => - # - # With element argument +element+, adds that element as a child: - # - # e0 = REXML::Element.new('foo') - # e1 = REXML::Element.new('bar') - # e0.add_element(e1) - # e0[0] # => - # - # With argument +element+ and hash argument +attributes+, - # sets attributes on the added element: - # - # e0.add_element(e1, {'bat' => '0', 'bam' => '1'}) - # e0[1] # => - # - # source://rexml/lib/rexml/element.rb#732 - def add_element(element, attrs = T.unsafe(nil)); end - - # :call-seq: - # add_namespace(prefix, uri = nil) -> self - # - # Adds a namespace to the element; returns +self+. - # - # With the single argument +prefix+, - # adds a namespace using the given +prefix+ and the namespace URI: - # - # e = REXML::Element.new('foo') - # e.add_namespace('bar') - # e.namespaces # => {"xmlns"=>"bar"} - # - # With both arguments +prefix+ and +uri+ given, - # adds a namespace using both arguments: - # - # e.add_namespace('baz', 'bat') - # e.namespaces # => {"xmlns"=>"bar", "baz"=>"bat"} - # - # source://rexml/lib/rexml/element.rb#655 - def add_namespace(prefix, uri = T.unsafe(nil)); end - - # :call-seq: - # add_text(string) -> nil - # add_text(text_node) -> self - # - # Adds text to the element. - # - # When string argument +string+ is given, returns +nil+. - # - # If the element has no child text node, - # creates a \REXML::Text object using the string, - # honoring the current settings for whitespace and raw, - # then adds that node to the element: - # - # d = REXML::Document.new('') - # a = d.root - # a.add_text('foo') - # a.to_a # => [, "foo"] - # - # If the element has child text nodes, - # appends the string to the _last_ text node: - # - # d = REXML::Document.new('foobar') - # a = d.root - # a.add_text('baz') - # a.to_a # => ["foo", , "barbaz"] - # a.add_text('baz') - # a.to_a # => ["foo", , "barbazbaz"] - # - # When text node argument +text_node+ is given, - # appends the node as the last text node in the element; - # returns +self+: - # - # d = REXML::Document.new('foobar') - # a = d.root - # a.add_text(REXML::Text.new('baz')) - # a.to_a # => ["foo", , "bar", "baz"] - # a.add_text(REXML::Text.new('baz')) - # a.to_a # => ["foo", , "bar", "baz", "baz"] - # - # source://rexml/lib/rexml/element.rb#1147 - def add_text(text); end - - # :call-seq: - # attribute(name, namespace = nil) - # - # Returns the string value for the given attribute name. - # - # With only argument +name+ given, - # returns the value of the named attribute if it exists, otherwise +nil+: - # - # xml_string = <<-EOT - # - # - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # root = d.root - # a = root[1] # => - # a.attribute('attr') # => attr='value' - # a.attribute('nope') # => nil - # - # With arguments +name+ and +namespace+ given, - # returns the value of the named attribute if it exists, otherwise +nil+: - # - # xml_string = "" - # document = REXML::Document.new(xml_string) - # document.root.attribute("x") # => x='x' - # document.root.attribute("x", "a") # => a:x='a:x' - # - # source://rexml/lib/rexml/element.rb#1287 - def attribute(name, namespace = T.unsafe(nil)); end - - # Mechanisms for accessing attributes and child elements of this - # element. - # - # source://rexml/lib/rexml/element.rb#278 - def attributes; end - - # :call-seq: - # cdatas -> array_of_cdata_children - # - # Returns a frozen array of the REXML::CData children of the element: - # - # xml_string = <<-EOT - # - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # cds = d.root.cdatas # => ["foo", "bar"] - # cds.frozen? # => true - # cds.map {|cd| cd.class } # => [REXML::CData, REXML::CData] - # - # source://rexml/lib/rexml/element.rb#1420 - def cdatas; end - - # :call-seq: - # clone -> new_element - # - # Returns a shallow copy of the element, containing the name and attributes, - # but not the parent or children: - # - # e = REXML::Element.new('foo') - # e.add_attributes({'bar' => 0, 'baz' => 1}) - # e.clone # => - # - # source://rexml/lib/rexml/element.rb#383 - def clone; end - - # :call-seq: - # comments -> array_of_comment_children - # - # Returns a frozen array of the REXML::Comment children of the element: - # - # xml_string = <<-EOT - # - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # cs = d.root.comments - # cs.frozen? # => true - # cs.map {|c| c.class } # => [REXML::Comment, REXML::Comment] - # cs.map {|c| c.to_s } # => ["foo", "bar"] - # - # source://rexml/lib/rexml/element.rb#1441 - def comments; end - - # The context holds information about the processing environment, such as - # whitespace handling. - # - # source://rexml/lib/rexml/element.rb#281 - def context; end - - # The context holds information about the processing environment, such as - # whitespace handling. - # - # source://rexml/lib/rexml/element.rb#281 - def context=(_arg0); end - - # :call-seq: - # delete_attribute(name) -> removed_attribute or nil - # - # Removes a named attribute if it exists; - # returns the removed attribute if found, otherwise +nil+: - # - # e = REXML::Element.new('foo') - # e.add_attribute('bar', 'baz') - # e.delete_attribute('bar') # => - # e.delete_attribute('bar') # => nil - # - # source://rexml/lib/rexml/element.rb#1395 - def delete_attribute(key); end - - # :call-seq: - # delete_element(index) -> removed_element or nil - # delete_element(element) -> removed_element or nil - # delete_element(xpath) -> removed_element or nil - # - # Deletes a child element. - # - # When 1-based integer argument +index+ is given, - # removes and returns the child element at that offset if it exists; - # indexing does not include text nodes; - # returns +nil+ if the element does not exist: - # - # d = REXML::Document.new 'text' - # a = d.root # => ... - # a.delete_element(1) # => - # a.delete_element(1) # => - # a.delete_element(1) # => nil - # - # When element argument +element+ is given, - # removes and returns that child element if it exists, - # otherwise returns +nil+: - # - # d = REXML::Document.new 'text' - # a = d.root # => ... - # c = a[2] # => - # a.delete_element(c) # => - # a.delete_element(c) # => nil - # - # When xpath argument +xpath+ is given, - # removes and returns the element at xpath if it exists, - # otherwise returns +nil+: - # - # d = REXML::Document.new 'text' - # a = d.root # => ... - # a.delete_element('//c') # => - # a.delete_element('//c') # => nil - # - # source://rexml/lib/rexml/element.rb#778 - def delete_element(element); end - - # :call-seq: - # delete_namespace(namespace = 'xmlns') -> self - # - # Removes a namespace from the element. - # - # With no argument, removes the default namespace: - # - # d = REXML::Document.new "" - # d.to_s # => "" - # d.root.delete_namespace # => - # d.to_s # => "" - # - # With argument +namespace+, removes the specified namespace: - # - # d.root.delete_namespace('foo') - # d.to_s # => "" - # - # Does nothing if no such namespace is found: - # - # d.root.delete_namespace('nosuch') - # d.to_s # => "" - # - # source://rexml/lib/rexml/element.rb#687 - def delete_namespace(namespace = T.unsafe(nil)); end - - # :call-seq: - # document -> document or nil - # - # If the element is part of a document, returns that document: - # - # d = REXML::Document.new('') - # top_element = d.first - # child = top_element.first - # top_element.document == d # => true - # child.document == d # => true - # - # If the element is not part of a document, returns +nil+: - # - # REXML::Element.new.document # => nil - # - # For a document, returns +self+: - # - # d.document == d # => true - # - # Related: #root, #root_node. - # - # source://rexml/lib/rexml/element.rb#475 - def document; end - - # :call-seq: - # each_element {|e| ... } - # - # Calls the given block with each child element: - # - # d = REXML::Document.new 'bbd' - # a = d.root - # a.each_element {|e| p e } - # - # Output: - # - # ... - # ... - # ... - # - # - # source://rexml/lib/rexml/element.rb#930 - def each_element(xpath = T.unsafe(nil), &block); end - - # :call-seq: - # each_element_with_attribute(attr_name, value = nil, max = 0, xpath = nil) {|e| ... } - # - # Calls the given block with each child element that meets given criteria. - # - # When only string argument +attr_name+ is given, - # calls the block with each child element that has that attribute: - # - # d = REXML::Document.new '' - # a = d.root - # a.each_element_with_attribute('id') {|e| p e } - # - # Output: - # - # - # - # - # - # With argument +attr_name+ and string argument +value+ given, - # calls the block with each child element that has that attribute - # with that value: - # - # a.each_element_with_attribute('id', '1') {|e| p e } - # - # Output: - # - # - # - # - # With arguments +attr_name+, +value+, and integer argument +max+ given, - # calls the block with at most +max+ child elements: - # - # a.each_element_with_attribute('id', '1', 1) {|e| p e } - # - # Output: - # - # - # - # With all arguments given, including +xpath+, - # calls the block with only those child elements - # that meet the first three criteria, - # and also match the given +xpath+: - # - # a.each_element_with_attribute('id', '1', 2, '//d') {|e| p e } - # - # Output: - # - # - # - # source://rexml/lib/rexml/element.rb#847 - def each_element_with_attribute(key, value = T.unsafe(nil), max = T.unsafe(nil), name = T.unsafe(nil), &block); end - - # :call-seq: - # each_element_with_text(text = nil, max = 0, xpath = nil) {|e| ... } - # - # Calls the given block with each child element that meets given criteria. - # - # With no arguments, calls the block with each child element that has text: - # - # d = REXML::Document.new 'bbd' - # a = d.root - # a.each_element_with_text {|e| p e } - # - # Output: - # - # ... - # ... - # ... - # - # With the single string argument +text+, - # calls the block with each element that has exactly that text: - # - # a.each_element_with_text('b') {|e| p e } - # - # Output: - # - # ... - # ... - # - # With argument +text+ and integer argument +max+, - # calls the block with at most +max+ elements: - # - # a.each_element_with_text('b', 1) {|e| p e } - # - # Output: - # - # ... - # - # With all arguments given, including +xpath+, - # calls the block with only those child elements - # that meet the first two criteria, - # and also match the given +xpath+: - # - # a.each_element_with_text('b', 2, '//c') {|e| p e } - # - # Output: - # - # ... - # - # source://rexml/lib/rexml/element.rb#904 - def each_element_with_text(text = T.unsafe(nil), max = T.unsafe(nil), name = T.unsafe(nil), &block); end - - # Mechanisms for accessing attributes and child elements of this - # element. - # - # source://rexml/lib/rexml/element.rb#278 - def elements; end - - # :call-seq: - # get_elements(xpath) - # - # Returns an array of the elements that match the given +xpath+: - # - # xml_string = <<-EOT - # - # - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # d.root.get_elements('//a') # => [ ... , ] - # - # source://rexml/lib/rexml/element.rb#949 - def get_elements(xpath); end - - # :call-seq: - # get_text(xpath = nil) -> text_node or nil - # - # Returns the first text node child in a specified element, if it exists, - # +nil+ otherwise. - # - # With no argument, returns the first text node from +self+: - # - # d = REXML::Document.new "

some text this is bold! more text

" - # d.root.get_text.class # => REXML::Text - # d.root.get_text # => "some text " - # - # With argument +xpath+, returns the first text node from the element - # that matches +xpath+: - # - # d.root.get_text(1) # => "this is bold!" - # - # source://rexml/lib/rexml/element.rb#1053 - def get_text(path = T.unsafe(nil)); end - - # :call-seq: - # has_attributes? -> true or false - # - # Returns +true+ if the element has attributes, +false+ otherwise: - # - # d = REXML::Document.new('
') - # a, b = *d.root - # a.has_attributes? # => true - # b.has_attributes? # => false - # - # @return [Boolean] - # - # source://rexml/lib/rexml/element.rb#1315 - def has_attributes?; end - - # :call-seq: - # has_elements? - # - # Returns +true+ if the element has one or more element children, - # +false+ otherwise: - # - # d = REXML::Document.new 'text' - # a = d.root # => ... - # a.has_elements? # => true - # b = a[0] # => - # b.has_elements? # => false - # - # @return [Boolean] - # - # source://rexml/lib/rexml/element.rb#794 - def has_elements?; end - - # :call-seq: - # has_text? -> true or false - # - # Returns +true+ if the element has one or more text noded, - # +false+ otherwise: - # - # d = REXML::Document.new 'text' - # a = d.root - # a.has_text? # => true - # b = a[0] - # b.has_text? # => false - # - # @return [Boolean] - # - # source://rexml/lib/rexml/element.rb#1002 - def has_text?; end - - # :call-seq: - # ignore_whitespace_nodes - # - # Returns +true+ if whitespace nodes are ignored for the element. - # - # See {Element Context}[../doc/rexml/context_rdoc.html]. - # - # source://rexml/lib/rexml/element.rb#513 - def ignore_whitespace_nodes; end - - # :call-seq: - # inspect -> string - # - # Returns a string representation of the element. - # - # For an element with no attributes and no children, shows the element name: - # - # REXML::Element.new.inspect # => "" - # - # Shows attributes, if any: - # - # e = REXML::Element.new('foo') - # e.add_attributes({'bar' => 0, 'baz' => 1}) - # e.inspect # => "" - # - # Shows an ellipsis (...), if there are child elements: - # - # e.add_element(REXML::Element.new('bar')) - # e.add_element(REXML::Element.new('baz')) - # e.inspect # => " ... " - # - # source://rexml/lib/rexml/element.rb#358 - def inspect; end - - # :call-seq: - # instructions -> array_of_instruction_children - # - # Returns a frozen array of the REXML::Instruction children of the element: - # - # xml_string = <<-EOT - # - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # is = d.root.instructions - # is.frozen? # => true - # is.map {|i| i.class } # => [REXML::Instruction, REXML::Instruction] - # is.map {|i| i.to_s } # => ["", ""] - # - # source://rexml/lib/rexml/element.rb#1462 - def instructions; end - - # :call-seq: - # namespace(prefix = nil) -> string_uri or nil - # - # Returns the string namespace URI for the element, - # possibly deriving from one of its ancestors. - # - # xml_string = <<-EOT - # - # - # - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # b = d.elements['//b'] - # b.namespace # => "1" - # b.namespace('y') # => "2" - # b.namespace('nosuch') # => nil - # - # source://rexml/lib/rexml/element.rb#618 - def namespace(prefix = T.unsafe(nil)); end - - # :call-seq: - # namespaces -> array_of_namespace_names - # - # Returns a hash of all defined namespaces - # in the element and its ancestors: - # - # xml_string = <<-EOT - # - # - # - # - # - # - # EOT - # d = REXML::Document.new(xml_string) - # d.elements['//a'].namespaces # => {"x"=>"1", "y"=>"2"} - # d.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"} - # d.elements['//c'].namespaces # => {"x"=>"1", "y"=>"2", "z"=>"3"} - # - # source://rexml/lib/rexml/element.rb#591 - def namespaces; end - - # :call-seq: - # next_element - # - # Returns the next sibling that is an element if it exists, - # +niL+ otherwise: - # - # d = REXML::Document.new 'text' - # d.root.elements['b'].next_element #-> - # d.root.elements['c'].next_element #-> nil - # - # source://rexml/lib/rexml/element.rb#963 - def next_element; end - - # :call-seq: - # node_type -> :element - # - # Returns symbol :element: - # - # d = REXML::Document.new('') - # a = d.root # => - # a.node_type # => :element - # - # source://rexml/lib/rexml/element.rb#1168 - def node_type; end - - # :call-seq: - # prefixes -> array_of_namespace_prefixes - # - # Returns an array of the string prefixes (names) of all defined namespaces - # in the element and its ancestors: - # - # xml_string = <<-EOT - # - # - # - # - # - # - # EOT - # d = REXML::Document.new(xml_string, {compress_whitespace: :all}) - # d.elements['//a'].prefixes # => ["x", "y"] - # d.elements['//b'].prefixes # => ["x", "y"] - # d.elements['//c'].prefixes # => ["x", "y", "z"] - # - # source://rexml/lib/rexml/element.rb#565 - def prefixes; end - - # :call-seq: - # previous_element - # - # Returns the previous sibling that is an element if it exists, - # +niL+ otherwise: - # - # d = REXML::Document.new 'text' - # d.root.elements['c'].previous_element #-> - # d.root.elements['b'].previous_element #-> nil - # - # source://rexml/lib/rexml/element.rb#979 - def previous_element; end - - # :call-seq: - # raw - # - # Returns +true+ if raw mode is set for the element. - # - # See {Element Context}[../doc/rexml/context_rdoc.html]. - # - # The evaluation is tested against +expanded_name+, and so is namespace - # sensitive. - # - # source://rexml/lib/rexml/element.rb#533 - def raw; end - - # :call-seq: - # root -> element - # - # Returns the most distant _element_ (not document) ancestor of the element: - # - # d = REXML::Document.new('') - # top_element = d.first - # child = top_element.first - # top_element.root == top_element # => true - # child.root == top_element # => true - # - # For a document, returns the topmost element: - # - # d.root == top_element # => true - # - # Related: #root_node, #document. - # - # source://rexml/lib/rexml/element.rb#443 - def root; end - - # :call-seq: - # root_node -> document or element - # - # Returns the most distant ancestor of +self+. - # - # When the element is part of a document, - # returns the root node of the document. - # Note that the root node is different from the document element; - # in this example +a+ is document element and the root node is its parent: - # - # d = REXML::Document.new('') - # top_element = d.first # => ... - # child = top_element.first # => ... - # d.root_node == d # => true - # top_element.root_node == d # => true - # child.root_node == d # => true - # - # When the element is not part of a document, but does have ancestor elements, - # returns the most distant ancestor element: - # - # e0 = REXML::Element.new('foo') - # e1 = REXML::Element.new('bar') - # e1.parent = e0 - # e2 = REXML::Element.new('baz') - # e2.parent = e1 - # e2.root_node == e0 # => true - # - # When the element has no ancestor elements, - # returns +self+: - # - # e = REXML::Element.new('foo') - # e.root_node == e # => true - # - # Related: #root, #document. - # - # source://rexml/lib/rexml/element.rb#422 - def root_node; end - - # :call-seq: - # text(xpath = nil) -> text_string or nil - # - # Returns the text string from the first text node child - # in a specified element, if it exists, +nil+ otherwise. - # - # With no argument, returns the text from the first text node in +self+: - # - # d = REXML::Document.new "

some text this is bold! more text

" - # d.root.text.class # => String - # d.root.text # => "some text " - # - # With argument +xpath+, returns text from the first text node - # in the element that matches +xpath+: - # - # d.root.text(1) # => "this is bold!" - # - # Note that an element may have multiple text nodes, - # possibly separated by other non-text children, as above. - # Even so, the returned value is the string text from the first such node. - # - # Note also that the text note is retrieved by method get_text, - # and so is always normalized text. - # - # source://rexml/lib/rexml/element.rb#1030 - def text(path = T.unsafe(nil)); end - - # :call-seq: - # text = string -> string - # text = nil -> nil - # - # Adds, replaces, or removes the first text node child in the element. - # - # With string argument +string+, - # creates a new \REXML::Text node containing that string, - # honoring the current settings for whitespace and row, - # then places the node as the first text child in the element; - # returns +string+. - # - # If the element has no text child, the text node is added: - # - # d = REXML::Document.new '
' - # d.root.text = 'foo' #-> 'foo' - # - # If the element has a text child, it is replaced: - # - # d.root.text = 'bar' #-> 'bar' - # - # With argument +nil+, removes the first text child: - # - # d.root.text = nil #-> '' - # - # source://rexml/lib/rexml/element.rb#1089 - def text=(text); end - - # :call-seq: - # texts -> array_of_text_children - # - # Returns a frozen array of the REXML::Text children of the element: - # - # xml_string = 'textmore' - # d = REXML::Document.new(xml_string) - # ts = d.root.texts - # ts.frozen? # => true - # ts.map {|t| t.class } # => [REXML::Text, REXML::Text] - # ts.map {|t| t.to_s } # => ["text", "more"] - # - # source://rexml/lib/rexml/element.rb#1478 - def texts; end - - # :call-seq: - # whitespace - # - # Returns +true+ if whitespace is respected for this element, - # +false+ otherwise. - # - # See {Element Context}[../doc/rexml/context_rdoc.html]. - # - # The evaluation is tested against the element's +expanded_name+, - # and so is namespace-sensitive. - # - # source://rexml/lib/rexml/element.rb#490 - def whitespace; end - - # == DEPRECATED - # See REXML::Formatters - # - # Writes out this element, and recursively, all children. - # output:: - # output an object which supports '<< string'; this is where the - # document will be written. - # indent:: - # An integer. If -1, no indenting will be used; otherwise, the - # indentation will be this number of spaces, and children will be - # indented an additional amount. Defaults to -1 - # transitive:: - # If transitive is true and indent is >= 0, then the output will be - # pretty-printed in such a way that the added whitespace does not affect - # the parse tree of the document - # ie_hack:: - # This hack inserts a space before the /> on empty tags to address - # a limitation of Internet Explorer. Defaults to false - # - # out = '' - # doc.write( out ) #-> doc is written to the string 'out' - # doc.write( $stdout ) #-> doc written to the console - # - # source://rexml/lib/rexml/element.rb#1504 - def write(output = T.unsafe(nil), indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end - - # :call-seq: - # xpath -> string_xpath - # - # Returns the string xpath to the element - # relative to the most distant parent: - # - # d = REXML::Document.new('') - # a = d.root # => ... - # b = a[0] # => ... - # c = b[0] # => - # d.xpath # => "" - # a.xpath # => "/a" - # b.xpath # => "/a/b" - # c.xpath # => "/a/b/c" - # - # If there is no parent, returns the expanded name of the element: - # - # e = REXML::Element.new('foo') - # e.xpath # => "foo" - # - # source://rexml/lib/rexml/element.rb#1192 - def xpath; end - - private - - # source://rexml/lib/rexml/element.rb#1521 - def __to_xpath_helper(node); end - - # A private helper method - # - # source://rexml/lib/rexml/element.rb#1536 - def each_with_something(test, max = T.unsafe(nil), name = T.unsafe(nil)); end -end - -# source://rexml/lib/rexml/doctype.rb#261 -class REXML::ElementDecl < ::REXML::Declaration - # @return [ElementDecl] a new instance of ElementDecl - # - # source://rexml/lib/rexml/doctype.rb#262 - def initialize(src); end -end - -# A class which provides filtering of children for Elements, and -# XPath search support. You are expected to only encounter this class as -# the element.elements object. Therefore, you are -# _not_ expected to instantiate this yourself. -# -# xml_string = <<-EOT -# -# -# -# Everyday Italian -# Giada De Laurentiis -# 2005 -# 30.00 -# -# -# Harry Potter -# J K. Rowling -# 2005 -# 29.99 -# -# -# XQuery Kick Start -# James McGovern -# Per Bothner -# Kurt Cagle -# James Linn -# Vaidyanathan Nagarajan -# 2003 -# 49.99 -# -# -# Learning XML -# Erik T. Ray -# 2003 -# 39.95 -# -# -# EOT -# d = REXML::Document.new(xml_string) -# elements = d.root.elements -# elements # => # ... > -# -# source://rexml/lib/rexml/element.rb#1591 -class REXML::Elements - include ::Enumerable - - # :call-seq: - # new(parent) -> new_elements_object - # - # Returns a new \Elements object with the given +parent+. - # Does _not_ assign parent.elements = self: - # - # d = REXML::Document.new(xml_string) - # eles = REXML::Elements.new(d.root) - # eles # => # ... > - # eles == d.root.elements # => false - # - # @return [Elements] a new instance of Elements - # - # source://rexml/lib/rexml/element.rb#1604 - def initialize(parent); end - - # :call-seq: - # add -> new_element - # add(name) -> new_element - # add(element) -> element - # - # Adds an element; returns the element added. - # - # With no argument, creates and adds a new element. - # The new element has: - # - # - No name. - # - \Parent from the \Elements object. - # - Context from the that parent. - # - # Example: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # parent = elements.parent # => ... - # parent.context = {raw: :all} - # elements.size # => 4 - # new_element = elements.add # => - # elements.size # => 5 - # new_element.name # => nil - # new_element.parent # => ... - # new_element.context # => {:raw=>:all} - # - # With string argument +name+, creates and adds a new element. - # The new element has: - # - # - Name +name+. - # - \Parent from the \Elements object. - # - Context from the that parent. - # - # Example: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # parent = elements.parent # => ... - # parent.context = {raw: :all} - # elements.size # => 4 - # new_element = elements.add('foo') # => - # elements.size # => 5 - # new_element.name # => "foo" - # new_element.parent # => ... - # new_element.context # => {:raw=>:all} - # - # With argument +element+, - # creates and adds a clone of the given +element+. - # The new element has name, parent, and context from the given +element+. - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # elements.size # => 4 - # e0 = REXML::Element.new('foo') - # e1 = REXML::Element.new('bar', e0, {raw: :all}) - # element = elements.add(e1) # => - # elements.size # => 5 - # element.name # => "bar" - # element.parent # => ... - # element.context # => {:raw=>:all} - # - # source://rexml/lib/rexml/element.rb#1921 - def <<(element = T.unsafe(nil)); end - - # :call-seq: - # elements[index] -> element or nil - # elements[xpath] -> element or nil - # elements[n, name] -> element or nil - # - # Returns the first \Element object selected by the arguments, - # if any found, or +nil+ if none found. - # - # Notes: - # - The +index+ is 1-based, not 0-based, so that: - # - The first element has index 1 - # - The _nth_ element has index +n+. - # - The selection ignores non-\Element nodes. - # - # When the single argument +index+ is given, - # returns the element given by the index, if any; otherwise, +nil+: - # - # d = REXML::Document.new(xml_string) - # eles = d.root.elements - # eles # => # ... > - # eles[1] # => ... - # eles.size # => 4 - # eles[4] # => ... - # eles[5] # => nil - # - # The node at this index is not an \Element, and so is not returned: - # - # eles = d.root.first.first # => ... </> - # eles.to_a # => ["Everyday Italian"] - # eles[1] # => nil - # - # When the single argument +xpath+ is given, - # returns the first element found via that +xpath+, if any; otherwise, +nil+: - # - # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>> - # eles['/bookstore'] # => <bookstore> ... </> - # eles['//book'] # => <book category='cooking'> ... </> - # eles['//book [@category="children"]'] # => <book category='children'> ... </> - # eles['/nosuch'] # => nil - # eles['//nosuch'] # => nil - # eles['//book [@category="nosuch"]'] # => nil - # eles['.'] # => <bookstore> ... </> - # eles['..'].class # => REXML::Document - # - # With arguments +n+ and +name+ given, - # returns the _nth_ found element that has the given +name+, - # or +nil+ if there is no such _nth_ element: - # - # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>> - # eles[1, 'book'] # => <book category='cooking'> ... </> - # eles[4, 'book'] # => <book category='web' cover='paperback'> ... </> - # eles[5, 'book'] # => nil - # - # source://rexml/lib/rexml/element.rb#1676 - def [](index, name = T.unsafe(nil)); end - - # :call-seq: - # elements[] = index, replacement_element -> replacement_element or nil - # - # Replaces or adds an element. - # - # When <tt>eles[index]</tt> exists, replaces it with +replacement_element+ - # and returns +replacement_element+: - # - # d = REXML::Document.new(xml_string) - # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>> - # eles[1] # => <book category='cooking'> ... </> - # eles[1] = REXML::Element.new('foo') - # eles[1] # => <foo/> - # - # Does nothing (or raises an exception) - # if +replacement_element+ is not an \Element: - # eles[2] # => <book category='web' cover='paperback'> ... </> - # eles[2] = REXML::Text.new('bar') - # eles[2] # => <book category='web' cover='paperback'> ... </> - # - # When <tt>eles[index]</tt> does not exist, - # adds +replacement_element+ to the element and returns - # - # d = REXML::Document.new(xml_string) - # eles = d.root.elements # => #<REXML::Elements @element=<bookstore> ... </>> - # eles.size # => 4 - # eles[50] = REXML::Element.new('foo') # => <foo/> - # eles.size # => 5 - # eles[5] # => <foo/> - # - # Does nothing (or raises an exception) - # if +replacement_element+ is not an \Element: - # - # eles[50] = REXML::Text.new('bar') # => "bar" - # eles.size # => 5 - # - # source://rexml/lib/rexml/element.rb#1731 - def []=(index, element); end - - # :call-seq: - # add -> new_element - # add(name) -> new_element - # add(element) -> element - # - # Adds an element; returns the element added. - # - # With no argument, creates and adds a new element. - # The new element has: - # - # - No name. - # - \Parent from the \Elements object. - # - Context from the that parent. - # - # Example: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # parent = elements.parent # => <bookstore> ... </> - # parent.context = {raw: :all} - # elements.size # => 4 - # new_element = elements.add # => </> - # elements.size # => 5 - # new_element.name # => nil - # new_element.parent # => <bookstore> ... </> - # new_element.context # => {:raw=>:all} - # - # With string argument +name+, creates and adds a new element. - # The new element has: - # - # - Name +name+. - # - \Parent from the \Elements object. - # - Context from the that parent. - # - # Example: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # parent = elements.parent # => <bookstore> ... </> - # parent.context = {raw: :all} - # elements.size # => 4 - # new_element = elements.add('foo') # => <foo/> - # elements.size # => 5 - # new_element.name # => "foo" - # new_element.parent # => <bookstore> ... </> - # new_element.context # => {:raw=>:all} - # - # With argument +element+, - # creates and adds a clone of the given +element+. - # The new element has name, parent, and context from the given +element+. - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # elements.size # => 4 - # e0 = REXML::Element.new('foo') - # e1 = REXML::Element.new('bar', e0, {raw: :all}) - # element = elements.add(e1) # => <bar/> - # elements.size # => 5 - # element.name # => "bar" - # element.parent # => <bookstore> ... </> - # element.context # => {:raw=>:all} - # - # source://rexml/lib/rexml/element.rb#1921 - def add(element = T.unsafe(nil)); end - - # :call-seq: - # collect(xpath = nil) {|element| ... } -> array - # - # Iterates over the elements; returns the array of block return values. - # - # With no argument, iterates over all elements: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # elements.collect {|element| element.size } # => [9, 9, 17, 9] - # - # With argument +xpath+, iterates over elements that match - # the given +xpath+: - # - # xpath = '//book [@category="web"]' - # elements.collect(xpath) {|element| element.size } # => [17, 9] - # - # source://rexml/lib/rexml/element.rb#1984 - def collect(xpath = T.unsafe(nil)); end - - # :call-seq: - # delete(index) -> removed_element or nil - # delete(element) -> removed_element or nil - # delete(xpath) -> removed_element or nil - # - # Removes an element; returns the removed element, or +nil+ if none removed. - # - # With integer argument +index+ given, - # removes the child element at that offset: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # elements.size # => 4 - # elements[2] # => <book category='children'> ... </> - # elements.delete(2) # => <book category='children'> ... </> - # elements.size # => 3 - # elements[2] # => <book category='web'> ... </> - # elements.delete(50) # => nil - # - # With element argument +element+ given, - # removes that child element: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # ele_1, ele_2, ele_3, ele_4 = *elements - # elements.size # => 4 - # elements[2] # => <book category='children'> ... </> - # elements.delete(ele_2) # => <book category='children'> ... </> - # elements.size # => 3 - # elements[2] # => <book category='web'> ... </> - # elements.delete(ele_2) # => nil - # - # With string argument +xpath+ given, - # removes the first element found via that xpath: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # elements.delete('//book') # => <book category='cooking'> ... </> - # elements.delete('//book [@category="children"]') # => <book category='children'> ... </> - # elements.delete('//nosuch') # => nil - # - # source://rexml/lib/rexml/element.rb#1821 - def delete(element); end - - # :call-seq: - # delete_all(xpath) - # - # Removes all elements found via the given +xpath+; - # returns the array of removed elements, if any, else +nil+. - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # elements.size # => 4 - # deleted_elements = elements.delete_all('//book [@category="web"]') - # deleted_elements.size # => 2 - # elements.size # => 2 - # deleted_elements = elements.delete_all('//book') - # deleted_elements.size # => 2 - # elements.size # => 0 - # elements.delete_all('//book') # => [] - # - # source://rexml/lib/rexml/element.rb#1847 - def delete_all(xpath); end - - # :call-seq: - # each(xpath = nil) {|element| ... } -> self - # - # Iterates over the elements. - # - # With no argument, calls the block with each element: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # elements.each {|element| p element } - # - # Output: - # - # <book category='cooking'> ... </> - # <book category='children'> ... </> - # <book category='web'> ... </> - # <book category='web' cover='paperback'> ... </> - # - # With argument +xpath+, calls the block with each element - # that matches the given +xpath+: - # - # elements.each('//book [@category="web"]') {|element| p element } - # - # Output: - # - # <book category='web'> ... </> - # <book category='web' cover='paperback'> ... </> - # - # source://rexml/lib/rexml/element.rb#1963 - def each(xpath = T.unsafe(nil)); end - - # :call-seq: - # empty? -> true or false - # - # Returns +true+ if there are no children, +false+ otherwise. - # - # d = REXML::Document.new('') - # d.elements.empty? # => true - # d = REXML::Document.new(xml_string) - # d.elements.empty? # => false - # - # @return [Boolean] - # - # source://rexml/lib/rexml/element.rb#1751 - def empty?; end - - # :call-seq: - # index(element) - # - # Returns the 1-based index of the given +element+, if found; - # otherwise, returns -1: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # ele_1, ele_2, ele_3, ele_4 = *elements - # elements.index(ele_4) # => 4 - # elements.delete(ele_3) - # elements.index(ele_4) # => 3 - # elements.index(ele_3) # => -1 - # - # source://rexml/lib/rexml/element.rb#1769 - def index(element); end - - # :call-seq: - # inject(xpath = nil, initial = nil) -> object - # - # Calls the block with elements; returns the last block return value. - # - # With no argument, iterates over the elements, calling the block - # <tt>elements.size - 1</tt> times. - # - # - The first call passes the first and second elements. - # - The second call passes the first block return value and the third element. - # - The third call passes the second block return value and the fourth element. - # - And so on. - # - # In this example, the block returns the passed element, - # which is then the object argument to the next call: - # - # d = REXML::Document.new(xml_string) - # elements = d.root.elements - # elements.inject do |object, element| - # p [elements.index(object), elements.index(element)] - # element - # end - # - # Output: - # - # [1, 2] - # [2, 3] - # [3, 4] - # - # With the single argument +xpath+, calls the block only with - # elements matching that xpath: - # - # elements.inject('//book [@category="web"]') do |object, element| - # p [elements.index(object), elements.index(element)] - # element - # end - # - # Output: - # - # [3, 4] - # - # With argument +xpath+ given as +nil+ - # and argument +initial+ also given, - # calls the block once for each element. - # - # - The first call passes the +initial+ and the first element. - # - The second call passes the first block return value and the second element. - # - The third call passes the second block return value and the third element. - # - And so on. - # - # In this example, the first object index is <tt>-1</tt> - # - # elements.inject(nil, 'Initial') do |object, element| - # p [elements.index(object), elements.index(element)] - # element - # end - # - # Output: - # - # [-1, 1] - # [1, 2] - # [2, 3] - # [3, 4] - # - # In this form the passed object can be used as an accumulator: - # - # elements.inject(nil, 0) do |total, element| - # total += element.size - # end # => 44 - # - # With both arguments +xpath+ and +initial+ are given, - # calls the block only with elements matching that xpath: - # - # elements.inject('//book [@category="web"]', 0) do |total, element| - # total += element.size - # end # => 26 - # - # source://rexml/lib/rexml/element.rb#2069 - def inject(xpath = T.unsafe(nil), initial = T.unsafe(nil)); end - - # :call-seq: - # parent - # - # Returns the parent element cited in creating the \Elements object. - # This element is also the default starting point for searching - # in the \Elements object. - # - # d = REXML::Document.new(xml_string) - # elements = REXML::Elements.new(d.root) - # elements.parent == d.root # => true - # - # source://rexml/lib/rexml/element.rb#1619 - def parent; end - - # :call-seq: - # size -> integer - # - # Returns the count of \Element children: - # - # d = REXML::Document.new '<a>sean<b/>elliott<b/>russell<b/></a>' - # d.root.elements.size # => 3 # Three elements. - # d.root.size # => 6 # Three elements plus three text nodes.. - # - # source://rexml/lib/rexml/element.rb#2093 - def size; end - - # :call-seq: - # to_a(xpath = nil) -> array_of_elements - # - # Returns an array of element children (not including non-element children). - # - # With no argument, returns an array of all element children: - # - # d = REXML::Document.new '<a>sean<b/>elliott<c/></a>' - # elements = d.root.elements - # elements.to_a # => [<b/>, <c/>] # Omits non-element children. - # children = d.root.children - # children # => ["sean", <b/>, "elliott", <c/>] # Includes non-element children. - # - # With argument +xpath+, returns an array of element children - # that match the xpath: - # - # elements.to_a('//c') # => [<c/>] - # - # source://rexml/lib/rexml/element.rb#2117 - def to_a(xpath = T.unsafe(nil)); end - - private - - # Private helper class. Removes quotes from quoted strings - # - # source://rexml/lib/rexml/element.rb#2125 - def literalize(name); end -end - -# source://rexml/lib/rexml/encoding.rb#4 -module REXML::Encoding - # source://rexml/lib/rexml/encoding.rb#29 - def decode(string); end - - # source://rexml/lib/rexml/encoding.rb#25 - def encode(string); end - - # ID ---> Encoding name - # - # source://rexml/lib/rexml/encoding.rb#6 - def encoding; end - - # source://rexml/lib/rexml/encoding.rb#7 - def encoding=(encoding); end - - private - - # source://rexml/lib/rexml/encoding.rb#34 - def find_encoding(name); end -end - -# source://rexml/lib/rexml/entity.rb#7 -class REXML::Entity < ::REXML::Child - include ::REXML::XMLTokens - - # Create a new entity. Simple entities can be constructed by passing a - # name, value to the constructor; this creates a generic, plain entity - # reference. For anything more complicated, you have to pass a Source to - # the constructor with the entity definition, or use the accessor methods. - # +WARNING+: There is no validation of entity state except when the entity - # is read from a stream. If you start poking around with the accessors, - # you can easily create a non-conformant Entity. - # - # e = Entity.new( 'amp', '&' ) - # - # @return [Entity] a new instance of Entity - # - # source://rexml/lib/rexml/entity.rb#34 - def initialize(stream, value = T.unsafe(nil), parent = T.unsafe(nil), reference = T.unsafe(nil)); end - - # Returns the value of attribute external. - # - # source://rexml/lib/rexml/entity.rb#23 - def external; end - - # Returns the value of attribute name. - # - # source://rexml/lib/rexml/entity.rb#23 - def name; end - - # Returns the value of attribute ndata. - # - # source://rexml/lib/rexml/entity.rb#23 - def ndata; end - - # Returns the value of this entity unprocessed -- raw. This is the - # normalized value; that is, with all %ent; and &ent; entities intact - # - # source://rexml/lib/rexml/entity.rb#86 - def normalized; end - - # Returns the value of attribute pubid. - # - # source://rexml/lib/rexml/entity.rb#23 - def pubid; end - - # Returns the value of attribute ref. - # - # source://rexml/lib/rexml/entity.rb#23 - def ref; end - - # Returns this entity as a string. See write(). - # - # source://rexml/lib/rexml/entity.rb#120 - def to_s; end - - # Evaluates to the unnormalized value of this entity; that is, replacing - # &ent; entities. - # - # source://rexml/lib/rexml/entity.rb#73 - def unnormalized; end - - # Returns the value of attribute value. - # - # source://rexml/lib/rexml/entity.rb#23 - def value; end - - # Write out a fully formed, correct entity definition (assuming the Entity - # object itself is valid.) - # - # out:: - # An object implementing <TT><<</TT> to which the entity will be - # output - # indent:: - # *DEPRECATED* and ignored - # - # source://rexml/lib/rexml/entity.rb#98 - def write(out, indent = T.unsafe(nil)); end - - class << self - # Evaluates whether the given string matches an entity definition, - # returning true if so, and false otherwise. - # - # @return [Boolean] - # - # source://rexml/lib/rexml/entity.rb#67 - def matches?(string); end - end -end - -# source://rexml/lib/rexml/doctype.rb#267 -class REXML::ExternalEntity < ::REXML::Child - # @return [ExternalEntity] a new instance of ExternalEntity - # - # source://rexml/lib/rexml/doctype.rb#268 - def initialize(src); end - - # source://rexml/lib/rexml/doctype.rb#272 - def to_s; end - - # source://rexml/lib/rexml/doctype.rb#275 - def write(output, indent); end -end - -# source://rexml/lib/rexml/formatters/default.rb#5 -class REXML::Formatters::Default - # Prints out the XML document with no formatting -- except if ie_hack is - # set. - # - # ie_hack:: - # If set to true, then inserts whitespace before the close of an empty - # tag, so that IE's bad XML parser doesn't choke. - # - # @return [Default] a new instance of Default - # - # source://rexml/lib/rexml/formatters/default.rb#12 - def initialize(ie_hack = T.unsafe(nil)); end - - # Writes the node to some output. - # - # node:: - # The node to write - # output:: - # A class implementing <TT><<</TT>. Pass in an Output object to - # change the output encoding. - # - # source://rexml/lib/rexml/formatters/default.rb#23 - def write(node, output); end - - protected - - # source://rexml/lib/rexml/formatters/default.rb#98 - def write_cdata(node, output); end - - # source://rexml/lib/rexml/formatters/default.rb#92 - def write_comment(node, output); end - - # source://rexml/lib/rexml/formatters/default.rb#61 - def write_document(node, output); end - - # source://rexml/lib/rexml/formatters/default.rb#65 - def write_element(node, output); end - - # source://rexml/lib/rexml/formatters/default.rb#104 - def write_instruction(node, output); end - - # source://rexml/lib/rexml/formatters/default.rb#88 - def write_text(node, output); end -end - -# Pretty-prints an XML document. This destroys whitespace in text nodes -# and will insert carriage returns and indentations. -# -# TODO: Add an option to print attributes on new lines -# -# source://rexml/lib/rexml/formatters/pretty.rb#10 -class REXML::Formatters::Pretty < ::REXML::Formatters::Default - # Create a new pretty printer. - # - # output:: - # An object implementing '<<(String)', to which the output will be written. - # indentation:: - # An integer greater than 0. The indentation of each level will be - # this number of spaces. If this is < 1, the behavior of this object - # is undefined. Defaults to 2. - # ie_hack:: - # If true, the printer will insert whitespace before closing empty - # tags, thereby allowing Internet Explorer's XML parser to - # function. Defaults to false. - # - # @return [Pretty] a new instance of Pretty - # - # source://rexml/lib/rexml/formatters/pretty.rb#30 - def initialize(indentation = T.unsafe(nil), ie_hack = T.unsafe(nil)); end - - # If compact is set to true, then the formatter will attempt to use as - # little space as possible - # - # source://rexml/lib/rexml/formatters/pretty.rb#14 - def compact; end - - # If compact is set to true, then the formatter will attempt to use as - # little space as possible - # - # source://rexml/lib/rexml/formatters/pretty.rb#14 - def compact=(_arg0); end - - # The width of a page. Used for formatting text - # - # source://rexml/lib/rexml/formatters/pretty.rb#16 - def width; end - - # The width of a page. Used for formatting text - # - # source://rexml/lib/rexml/formatters/pretty.rb#16 - def width=(_arg0); end - - protected - - # source://rexml/lib/rexml/formatters/pretty.rb#102 - def write_cdata(node, output); end - - # source://rexml/lib/rexml/formatters/pretty.rb#97 - def write_comment(node, output); end - - # source://rexml/lib/rexml/formatters/pretty.rb#107 - def write_document(node, output); end - - # source://rexml/lib/rexml/formatters/pretty.rb#39 - def write_element(node, output); end - - # source://rexml/lib/rexml/formatters/pretty.rb#88 - def write_text(node, output); end - - private - - # source://rexml/lib/rexml/formatters/pretty.rb#124 - def indent_text(string, level = T.unsafe(nil), style = T.unsafe(nil), indentfirstline = T.unsafe(nil)); end - - # source://rexml/lib/rexml/formatters/pretty.rb#129 - def wrap(string, width); end -end - -# A Source that wraps an IO. See the Source class for method -# documentation -# -# source://rexml/lib/rexml/source.rb#182 -class REXML::IOSource < ::REXML::Source - # block_size has been deprecated - # - # @return [IOSource] a new instance of IOSource - # - # source://rexml/lib/rexml/source.rb#186 - def initialize(arg, block_size = T.unsafe(nil), encoding = T.unsafe(nil)); end - - # @return the current line in the source - # - # source://rexml/lib/rexml/source.rb#274 - def current_line; end - - # @return [Boolean] - # - # source://rexml/lib/rexml/source.rb#269 - def empty?; end - - # source://rexml/lib/rexml/source.rb#246 - def ensure_buffer; end - - # source://rexml/lib/rexml/source.rb#250 - def match(pattern, cons = T.unsafe(nil)); end - - # source://rexml/lib/rexml/source.rb#207 - def read(term = T.unsafe(nil), min_bytes = T.unsafe(nil)); end - - # source://rexml/lib/rexml/source.rb#228 - def read_until(term); end - - private - - # source://rexml/lib/rexml/source.rb#316 - def encoding_updated; end - - # source://rexml/lib/rexml/source.rb#296 - def readline(term = T.unsafe(nil)); end -end - -# Represents an XML Instruction; IE, <? ... ?> -# TODO: Add parent arg (3rd arg) to constructor -# -# source://rexml/lib/rexml/instruction.rb#9 -class REXML::Instruction < ::REXML::Child - # Constructs a new Instruction - # the target of this instruction is set to this. If an Instruction, - # then the Instruction is shallowly cloned (target and content are - # copied). - # be a Parent if the target argument is a Source. Otherwise, this - # String is set as the content of this instruction. - # - # @param target can be one of a number of things. If String, then - # @param content Must be either a String, or a Parent. Can only - # @return [Instruction] a new instance of Instruction - # - # source://rexml/lib/rexml/instruction.rb#25 - def initialize(target, content = T.unsafe(nil)); end - - # of the other matches the target and content of this object. - # - # @return true if other is an Instruction, and the content and target - # - # source://rexml/lib/rexml/instruction.rb#65 - def ==(other); end - - # source://rexml/lib/rexml/instruction.rb#44 - def clone; end - - # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> - # content is everything else. - # - # source://rexml/lib/rexml/instruction.rb#15 - def content; end - - # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> - # content is everything else. - # - # source://rexml/lib/rexml/instruction.rb#15 - def content=(_arg0); end - - # source://rexml/lib/rexml/instruction.rb#75 - def inspect; end - - # source://rexml/lib/rexml/instruction.rb#71 - def node_type; end - - # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> - # content is everything else. - # - # source://rexml/lib/rexml/instruction.rb#15 - def target; end - - # target is the "name" of the Instruction; IE, the "tag" in <?tag ...?> - # content is everything else. - # - # source://rexml/lib/rexml/instruction.rb#15 - def target=(_arg0); end - - # == DEPRECATED - # See the rexml/formatters package - # - # source://rexml/lib/rexml/instruction.rb#51 - def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end -end - -# source://rexml/lib/rexml/light/node.rb#5 -module REXML::Light; end - -# Represents a tagged XML element. Elements are characterized by -# having children, attributes, and names, and can themselves be -# children. -# -# source://rexml/lib/rexml/light/node.rb#9 -class REXML::Light::Node - # Create a new element. - # - # @return [Node] a new instance of Node - # - # source://rexml/lib/rexml/light/node.rb#13 - def initialize(node = T.unsafe(nil)); end - - # Append a child to this element, optionally under a provided namespace. - # The namespace argument is ignored if the element argument is an Element - # object. Otherwise, the element argument is a string, the namespace (if - # provided) is the namespace the element is created in. - # - # source://rexml/lib/rexml/light/node.rb#114 - def <<(element); end - - # source://rexml/lib/rexml/light/node.rb#90 - def =~(path); end - - # source://rexml/lib/rexml/light/node.rb#78 - def [](reference, ns = T.unsafe(nil)); end - - # Doesn't handle namespaces yet - # - # source://rexml/lib/rexml/light/node.rb#95 - def []=(reference, ns, value = T.unsafe(nil)); end - - # source://rexml/lib/rexml/light/node.rb#143 - def children; end - - # source://rexml/lib/rexml/light/node.rb#36 - def each; end - - # @return [Boolean] - # - # source://rexml/lib/rexml/light/node.rb#139 - def has_name?(name, namespace = T.unsafe(nil)); end - - # source://rexml/lib/rexml/light/node.rb#54 - def local_name; end - - # source://rexml/lib/rexml/light/node.rb#59 - def local_name=(name_str); end - - # source://rexml/lib/rexml/light/node.rb#40 - def name; end - - # source://rexml/lib/rexml/light/node.rb#44 - def name=(name_str, ns = T.unsafe(nil)); end - - # source://rexml/lib/rexml/light/node.rb#67 - def namespace(prefix = T.unsafe(nil)); end - - # source://rexml/lib/rexml/light/node.rb#71 - def namespace=(namespace); end - - # source://rexml/lib/rexml/light/node.rb#125 - def node_type; end - - # source://rexml/lib/rexml/light/node.rb#147 - def parent; end - - # source://rexml/lib/rexml/light/node.rb#50 - def parent=(node); end - - # source://rexml/lib/rexml/light/node.rb#63 - def prefix(namespace = T.unsafe(nil)); end - - # source://rexml/lib/rexml/light/node.rb#134 - def root; end - - # source://rexml/lib/rexml/light/node.rb#28 - def size; end - - # source://rexml/lib/rexml/light/node.rb#129 - def text=(foo); end - - # source://rexml/lib/rexml/light/node.rb#151 - def to_s; end - - private - - # source://rexml/lib/rexml/light/node.rb#164 - def namespace_of(node, prefix = T.unsafe(nil)); end - - # source://rexml/lib/rexml/light/node.rb#157 - def namesplit; end - - # source://rexml/lib/rexml/light/node.rb#176 - def prefix_of(node, namespace = T.unsafe(nil)); end -end - -# source://rexml/lib/rexml/light/node.rb#10 -REXML::Light::Node::NAMESPLIT = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/light/node.rb#11 -REXML::Light::Node::PARENTS = T.let(T.unsafe(nil), Array) - -# Adds named attributes to an object. -# -# source://rexml/lib/rexml/namespace.rb#7 -module REXML::Namespace - include ::REXML::XMLTokens - - # The name of the object, valid if set - # - # source://rexml/lib/rexml/namespace.rb#9 - def expanded_name; end - - # Fully expand the name, even if the prefix wasn't specified in the - # source file. - # - # source://rexml/lib/rexml/namespace.rb#57 - def fully_expanded_name; end - - # Compares names optionally WITH namespaces - # - # @return [Boolean] - # - # source://rexml/lib/rexml/namespace.rb#43 - def has_name?(other, ns = T.unsafe(nil)); end - - # The name of the object, valid if set - # - # source://rexml/lib/rexml/namespace.rb#9 - def name; end - - # Sets the name and the expanded name - # - # source://rexml/lib/rexml/namespace.rb#17 - def name=(name); end - - # The expanded name of the object, valid if name is set - # - # source://rexml/lib/rexml/namespace.rb#11 - def prefix; end - - # The expanded name of the object, valid if name is set - # - # source://rexml/lib/rexml/namespace.rb#11 - def prefix=(_arg0); end -end - -# source://rexml/lib/rexml/namespace.rb#13 -REXML::Namespace::NAME_WITHOUT_NAMESPACE = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/doctype.rb#280 -class REXML::NotationDecl < ::REXML::Child - # @return [NotationDecl] a new instance of NotationDecl - # - # source://rexml/lib/rexml/doctype.rb#282 - def initialize(name, middle, pub, sys); end - - # This method retrieves the name of the notation. - # - # Method contributed by Henrik Martensson - # - # source://rexml/lib/rexml/doctype.rb#307 - def name; end - - # Returns the value of attribute public. - # - # source://rexml/lib/rexml/doctype.rb#281 - def public; end - - # Sets the attribute public - # - # @param value the value to set the attribute public to. - # - # source://rexml/lib/rexml/doctype.rb#281 - def public=(_arg0); end - - # Returns the value of attribute system. - # - # source://rexml/lib/rexml/doctype.rb#281 - def system; end - - # Sets the attribute system - # - # @param value the value to set the attribute system to. - # - # source://rexml/lib/rexml/doctype.rb#281 - def system=(_arg0); end - - # source://rexml/lib/rexml/doctype.rb#290 - def to_s; end - - # source://rexml/lib/rexml/doctype.rb#300 - def write(output, indent = T.unsafe(nil)); end -end - -# source://rexml/lib/rexml/output.rb#5 -class REXML::Output - include ::REXML::Encoding - - # @return [Output] a new instance of Output - # - # source://rexml/lib/rexml/output.rb#10 - def initialize(real_IO, encd = T.unsafe(nil)); end - - # source://rexml/lib/rexml/output.rb#22 - def <<(content); end - - # Returns the value of attribute encoding. - # - # source://rexml/lib/rexml/output.rb#8 - def encoding; end - - # source://rexml/lib/rexml/output.rb#26 - def to_s; end -end - -# A parent has children, and has methods for accessing them. The Parent -# class is never encountered except as the superclass for some other -# object. -# -# source://rexml/lib/rexml/parent.rb#8 -class REXML::Parent < ::REXML::Child - include ::Enumerable - - # Constructor - # - # @param parent if supplied, will be set as the parent of this object - # @return [Parent] a new instance of Parent - # - # source://rexml/lib/rexml/parent.rb#13 - def initialize(parent = T.unsafe(nil)); end - - # source://rexml/lib/rexml/parent.rb#18 - def <<(object); end - - # Fetches a child at a given index - # - # @param index the Integer index of the child to fetch - # - # source://rexml/lib/rexml/parent.rb#57 - def [](index); end - - # Set an index entry. See Array.[]= - # - # @param index the index of the element to set - # @param opt either the object to set, or an Integer length - # @param child if opt is an Integer, this is the child to set - # @return the parent (self) - # - # source://rexml/lib/rexml/parent.rb#70 - def []=(*args); end - - # source://rexml/lib/rexml/parent.rb#18 - def add(object); end - - # source://rexml/lib/rexml/parent.rb#115 - def children; end - - # Deeply clones this object. This creates a complete duplicate of this - # Parent, including all descendants. - # - # source://rexml/lib/rexml/parent.rb#148 - def deep_clone; end - - # source://rexml/lib/rexml/parent.rb#32 - def delete(object); end - - # source://rexml/lib/rexml/parent.rb#47 - def delete_at(index); end - - # source://rexml/lib/rexml/parent.rb#43 - def delete_if(&block); end - - # source://rexml/lib/rexml/parent.rb#39 - def each(&block); end - - # source://rexml/lib/rexml/parent.rb#39 - def each_child(&block); end - - # source://rexml/lib/rexml/parent.rb#51 - def each_index(&block); end - - # Fetches the index of a given child - # of this parent. - # - # @param child the child to get the index of - # @return the index of the child, or nil if the object is not a child - # - # source://rexml/lib/rexml/parent.rb#123 - def index(child); end - - # Inserts an child after another child - # child2 will be inserted after child1 in the child list of the parent. - # If an xpath, child2 will be inserted after the first child to match - # the xpath. - # - # @param child1 this is either an xpath or an Element. If an Element, - # @param child2 the child to insert - # @return the parent (self) - # - # source://rexml/lib/rexml/parent.rb#102 - def insert_after(child1, child2); end - - # Inserts an child before another child - # child2 will be inserted before child1 in the child list of the parent. - # If an xpath, child2 will be inserted before the first child to match - # the xpath. - # - # @param child1 this is either an xpath or an Element. If an Element, - # @param child2 the child to insert - # @return the parent (self) - # - # source://rexml/lib/rexml/parent.rb#82 - def insert_before(child1, child2); end - - # @return the number of children of this parent - # - # source://rexml/lib/rexml/parent.rb#130 - def length; end - - # @return [Boolean] - # - # source://rexml/lib/rexml/parent.rb#162 - def parent?; end - - # source://rexml/lib/rexml/parent.rb#18 - def push(object); end - - # Replaces one child with another, making sure the nodelist is correct - # Child) - # - # @param to_replace the child to replace (must be a Child) - # @param replacement the child to insert into the nodelist (must be a - # - # source://rexml/lib/rexml/parent.rb#140 - def replace_child(to_replace, replacement); end - - # @return the number of children of this parent - # - # source://rexml/lib/rexml/parent.rb#130 - def size; end - - # source://rexml/lib/rexml/parent.rb#115 - def to_a; end - - # source://rexml/lib/rexml/parent.rb#27 - def unshift(object); end -end - -# source://rexml/lib/rexml/parseexception.rb#3 -class REXML::ParseException < ::RuntimeError - # @return [ParseException] a new instance of ParseException - # - # source://rexml/lib/rexml/parseexception.rb#6 - def initialize(message, source = T.unsafe(nil), parser = T.unsafe(nil), exception = T.unsafe(nil)); end - - # source://rexml/lib/rexml/parseexception.rb#49 - def context; end - - # Returns the value of attribute continued_exception. - # - # source://rexml/lib/rexml/parseexception.rb#4 - def continued_exception; end - - # Sets the attribute continued_exception - # - # @param value the value to set the attribute continued_exception to. - # - # source://rexml/lib/rexml/parseexception.rb#4 - def continued_exception=(_arg0); end - - # source://rexml/lib/rexml/parseexception.rb#44 - def line; end - - # Returns the value of attribute parser. - # - # source://rexml/lib/rexml/parseexception.rb#4 - def parser; end - - # Sets the attribute parser - # - # @param value the value to set the attribute parser to. - # - # source://rexml/lib/rexml/parseexception.rb#4 - def parser=(_arg0); end - - # source://rexml/lib/rexml/parseexception.rb#39 - def position; end - - # Returns the value of attribute source. - # - # source://rexml/lib/rexml/parseexception.rb#4 - def source; end - - # Sets the attribute source - # - # @param value the value to set the attribute source to. - # - # source://rexml/lib/rexml/parseexception.rb#4 - def source=(_arg0); end - - # source://rexml/lib/rexml/parseexception.rb#13 - def to_s; end -end - -# = Using the Pull Parser -# <em>This API is experimental, and subject to change.</em> -# parser = PullParser.new( "<a>text<b att='val'/>txet</a>" ) -# while parser.has_next? -# res = parser.next -# puts res[1]['att'] if res.start_tag? and res[0] == 'b' -# end -# See the PullEvent class for information on the content of the results. -# The data is identical to the arguments passed for the various events to -# the StreamListener API. -# -# Notice that: -# parser = PullParser.new( "<a>BAD DOCUMENT" ) -# while parser.has_next? -# res = parser.next -# raise res[1] if res.error? -# end -# -# Nat Price gave me some good ideas for the API. -# -# source://rexml/lib/rexml/parsers/baseparser.rb#57 -class REXML::Parsers::BaseParser - # @return [BaseParser] a new instance of BaseParser - # - # source://rexml/lib/rexml/parsers/baseparser.rb#163 - def initialize(source); end - - # source://rexml/lib/rexml/parsers/baseparser.rb#172 - def add_listener(listener); end - - # Returns true if there are no more events - # - # @return [Boolean] - # - # source://rexml/lib/rexml/parsers/baseparser.rb#203 - def empty?; end - - # source://rexml/lib/rexml/parsers/baseparser.rb#535 - def entity(reference, entities); end - - # Returns the value of attribute entity_expansion_count. - # - # source://rexml/lib/rexml/parsers/baseparser.rb#177 - def entity_expansion_count; end - - # Sets the attribute entity_expansion_limit - # - # @param value the value to set the attribute entity_expansion_limit to. - # - # source://rexml/lib/rexml/parsers/baseparser.rb#178 - def entity_expansion_limit=(_arg0); end - - # Sets the attribute entity_expansion_text_limit - # - # @param value the value to set the attribute entity_expansion_text_limit to. - # - # source://rexml/lib/rexml/parsers/baseparser.rb#179 - def entity_expansion_text_limit=(_arg0); end - - # Returns true if there are more events. Synonymous with !empty? - # - # @return [Boolean] - # - # source://rexml/lib/rexml/parsers/baseparser.rb#208 - def has_next?; end - - # Escapes all possible entities - # - # source://rexml/lib/rexml/parsers/baseparser.rb#546 - def normalize(input, entities = T.unsafe(nil), entity_filter = T.unsafe(nil)); end - - # Peek at the +depth+ event in the stack. The first element on the stack - # is at depth 0. If +depth+ is -1, will parse to the end of the input - # stream and return the last event, which is always :end_document. - # Be aware that this causes the stream to be parsed up to the +depth+ - # event, so you can effectively pre-parse the entire document (pull the - # entire thing into memory) using this method. - # - # source://rexml/lib/rexml/parsers/baseparser.rb#224 - def peek(depth = T.unsafe(nil)); end - - # source://rexml/lib/rexml/parsers/baseparser.rb#193 - def position; end - - # Returns the next event. This is a +PullEvent+ object. - # - # source://rexml/lib/rexml/parsers/baseparser.rb#239 - def pull; end - - # Returns the value of attribute source. - # - # source://rexml/lib/rexml/parsers/baseparser.rb#176 - def source; end - - # source://rexml/lib/rexml/parsers/baseparser.rb#181 - def stream=(source); end - - # Unescapes all possible entities - # - # source://rexml/lib/rexml/parsers/baseparser.rb#562 - def unnormalize(string, entities = T.unsafe(nil), filter = T.unsafe(nil)); end - - # Push an event back on the head of the stream. This method - # has (theoretically) infinite depth. - # - # source://rexml/lib/rexml/parsers/baseparser.rb#214 - def unshift(token); end - - private - - # source://rexml/lib/rexml/parsers/baseparser.rb#607 - def add_namespace(prefix, uri); end - - # @return [Boolean] - # - # source://rexml/lib/rexml/parsers/baseparser.rb#640 - def need_source_encoding_update?(xml_declaration_encoding); end - - # source://rexml/lib/rexml/parsers/baseparser.rb#760 - def parse_attributes(prefixes); end - - # source://rexml/lib/rexml/parsers/baseparser.rb#659 - def parse_id(base_error_message, accept_external_id:, accept_public_id:); end - - # source://rexml/lib/rexml/parsers/baseparser.rb#687 - def parse_id_invalid_details(accept_external_id:, accept_public_id:); end - - # source://rexml/lib/rexml/parsers/baseparser.rb#646 - def parse_name(base_error_message); end - - # source://rexml/lib/rexml/parsers/baseparser.rb#622 - def pop_namespaces_restore; end - - # source://rexml/lib/rexml/parsers/baseparser.rb#725 - def process_instruction; end - - # source://rexml/lib/rexml/parsers/baseparser.rb#249 - def pull_event; end - - # source://rexml/lib/rexml/parsers/baseparser.rb#616 - def push_namespaces_restore; end - - # source://rexml/lib/rexml/parsers/baseparser.rb#633 - def record_entity_expansion(delta = T.unsafe(nil)); end -end - -# source://rexml/lib/rexml/parsers/baseparser.rb#130 -REXML::Parsers::BaseParser::EXTERNAL_ID_PUBLIC = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#131 -REXML::Parsers::BaseParser::EXTERNAL_ID_SYSTEM = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#132 -REXML::Parsers::BaseParser::PUBLIC_ID = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#143 -module REXML::Parsers::BaseParser::Private; end - -# source://rexml/lib/rexml/parsers/baseparser.rb#147 -REXML::Parsers::BaseParser::Private::ATTLISTDECL_END = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#152 -REXML::Parsers::BaseParser::Private::CARRIAGE_RETURN_NEWLINE_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#153 -REXML::Parsers::BaseParser::Private::CHARACTER_REFERENCES = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#146 -REXML::Parsers::BaseParser::Private::CLOSE_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#154 -REXML::Parsers::BaseParser::Private::DEFAULT_ENTITIES_PATTERNS = T.let(T.unsafe(nil), Hash) - -# source://rexml/lib/rexml/parsers/baseparser.rb#151 -REXML::Parsers::BaseParser::Private::ENTITYDECL_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#149 -REXML::Parsers::BaseParser::Private::GEDECL_PATTERN = T.let(T.unsafe(nil), String) - -# source://rexml/lib/rexml/parsers/baseparser.rb#148 -REXML::Parsers::BaseParser::Private::NAME_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#150 -REXML::Parsers::BaseParser::Private::PEDECL_PATTERN = T.let(T.unsafe(nil), String) - -# source://rexml/lib/rexml/parsers/baseparser.rb#144 -REXML::Parsers::BaseParser::Private::PEREFERENCE_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#145 -REXML::Parsers::BaseParser::Private::TAG_PATTERN = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#159 -REXML::Parsers::BaseParser::Private::XML_PREFIXED_NAMESPACE = T.let(T.unsafe(nil), String) - -# source://rexml/lib/rexml/parsers/baseparser.rb#66 -REXML::Parsers::BaseParser::QNAME = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/parsers/baseparser.rb#65 -REXML::Parsers::BaseParser::QNAME_STR = T.let(T.unsafe(nil), String) - -# source://rexml/lib/rexml/parsers/streamparser.rb#6 -class REXML::Parsers::StreamParser - # @return [StreamParser] a new instance of StreamParser - # - # source://rexml/lib/rexml/parsers/streamparser.rb#7 - def initialize(source, listener); end - - # source://rexml/lib/rexml/parsers/streamparser.rb#13 - def add_listener(listener); end - - # source://rexml/lib/rexml/parsers/streamparser.rb#17 - def entity_expansion_count; end - - # source://rexml/lib/rexml/parsers/streamparser.rb#21 - def entity_expansion_limit=(limit); end - - # source://rexml/lib/rexml/parsers/streamparser.rb#25 - def entity_expansion_text_limit=(limit); end - - # source://rexml/lib/rexml/parsers/streamparser.rb#29 - def parse; end -end - -# source://rexml/lib/rexml/parsers/treeparser.rb#7 -class REXML::Parsers::TreeParser - # @return [TreeParser] a new instance of TreeParser - # - # source://rexml/lib/rexml/parsers/treeparser.rb#8 - def initialize(source, build_context = T.unsafe(nil)); end - - # source://rexml/lib/rexml/parsers/treeparser.rb#13 - def add_listener(listener); end - - # source://rexml/lib/rexml/parsers/treeparser.rb#17 - def parse; end -end - -# You don't want to use this class. Really. Use XPath, which is a wrapper -# for this class. Believe me. You don't want to poke around in here. -# There is strange, dark magic at work in this code. Beware. Go back! Go -# back while you still can! -# -# source://rexml/lib/rexml/parsers/xpathparser.rb#12 -class REXML::Parsers::XPathParser - include ::REXML::XMLTokens - - # source://rexml/lib/rexml/parsers/xpathparser.rb#42 - def abbreviate(path_or_parsed); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#132 - def expand(path_or_parsed); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#16 - def namespaces=(namespaces); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#21 - def parse(path); end - - # For backward compatibility - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#174 - def preciate_to_string(parsed, &block); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#36 - def predicate(path); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#174 - def predicate_to_path(parsed, &block); end - - private - - # | AdditiveExpr ('+' | '-') MultiplicativeExpr - # | MultiplicativeExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#505 - def AdditiveExpr(path, parsed); end - - # | AndExpr S 'and' S EqualityExpr - # | EqualityExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#438 - def AndExpr(path, parsed); end - - # | EqualityExpr ('=' | '!=') RelationalExpr - # | RelationalExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#457 - def EqualityExpr(path, parsed); end - - # | FilterExpr Predicate - # | PrimaryExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#608 - def FilterExpr(path, parsed); end - - # | FUNCTION_NAME '(' ( expr ( ',' expr )* )? ')' - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#663 - def FunctionCall(rest, parsed); end - - # LocationPath - # | RelativeLocationPath - # | '/' RelativeLocationPath? - # | '//' RelativeLocationPath - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#243 - def LocationPath(path, parsed); end - - # | MultiplicativeExpr ('*' | S ('div' | 'mod') S) UnaryExpr - # | UnaryExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#528 - def MultiplicativeExpr(path, parsed); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#343 - def NodeTest(path, parsed); end - - # | OrExpr S 'or' S AndExpr - # | AndExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#419 - def OrExpr(path, parsed); end - - # | LocationPath - # | FilterExpr ('/' | '//') RelativeLocationPath - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#590 - def PathExpr(path, parsed); end - - # Filters the supplied nodeset on the predicate(s) - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#395 - def Predicate(path, parsed); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#626 - def PrimaryExpr(path, parsed); end - - # | RelationalExpr ('<' | '>' | '<=' | '>=') AdditiveExpr - # | AdditiveExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#480 - def RelationalExpr(path, parsed); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#267 - def RelativeLocationPath(path, parsed); end - - # | '-' UnaryExpr - # | UnionExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#553 - def UnaryExpr(path, parsed); end - - # | UnionExpr '|' PathExpr - # | PathExpr - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#571 - def UnionExpr(path, parsed); end - - # get_group( '[foo]bar' ) -> ['bar', '[foo]'] - # - # source://rexml/lib/rexml/parsers/xpathparser.rb#676 - def get_group(string); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#694 - def parse_args(string); end - - # source://rexml/lib/rexml/parsers/xpathparser.rb#224 - def quote_literal(literal); end -end - -# source://rexml/lib/rexml/parsers/xpathparser.rb#339 -REXML::Parsers::XPathParser::LOCAL_NAME_WILDCARD = T.let(T.unsafe(nil), Regexp) - -# Returns a 1-1 map of the nodeset -# The contents of the resulting array are either: -# true/false, if a positive match -# String, if a name match -# NodeTest -# | ('*' | NCNAME ':' '*' | QNAME) NameTest -# | '*' ':' NCNAME NameTest since XPath 2.0 -# | NODE_TYPE '(' ')' NodeType -# | PI '(' LITERAL ')' PI -# | '[' expr ']' Predicate -# -# source://rexml/lib/rexml/parsers/xpathparser.rb#338 -REXML::Parsers::XPathParser::PREFIX_WILDCARD = T.let(T.unsafe(nil), Regexp) - -# source://rexml/lib/rexml/doctype.rb#10 -class REXML::ReferenceWriter - # @return [ReferenceWriter] a new instance of ReferenceWriter - # - # source://rexml/lib/rexml/doctype.rb#11 - def initialize(id_type, public_id_literal, system_literal, context = T.unsafe(nil)); end - - # source://rexml/lib/rexml/doctype.rb#25 - def write(output); end -end - -# A Source can be searched for patterns, and wraps buffers and other -# objects and provides consumption of text -# -# source://rexml/lib/rexml/source.rb#51 -class REXML::Source - include ::REXML::Encoding - - # Constructor - # value, overriding all encoding detection - # - # @param arg must be a String, and should be a valid XML document - # @param encoding if non-null, sets the encoding of the source to this - # @return [Source] a new instance of Source - # - # source://rexml/lib/rexml/source.rb#71 - def initialize(arg, encoding = T.unsafe(nil)); end - - # The current buffer (what we're going to read next) - # - # source://rexml/lib/rexml/source.rb#83 - def buffer; end - - # source://rexml/lib/rexml/source.rb#93 - def buffer_encoding=(encoding); end - - # @return the current line in the source - # - # source://rexml/lib/rexml/source.rb#142 - def current_line; end - - # source://rexml/lib/rexml/source.rb#87 - def drop_parsed_content; end - - # @return [Boolean] true if the Source is exhausted - # - # source://rexml/lib/rexml/source.rb#137 - def empty?; end - - # Returns the value of attribute encoding. - # - # source://rexml/lib/rexml/source.rb#55 - def encoding; end - - # Inherited from Encoding - # Overridden to support optimized en/decoding - # - # source://rexml/lib/rexml/source.rb#99 - def encoding=(enc); end - - # source://rexml/lib/rexml/source.rb#117 - def ensure_buffer; end - - # The line number of the last consumed text - # - # source://rexml/lib/rexml/source.rb#54 - def line; end - - # source://rexml/lib/rexml/source.rb#120 - def match(pattern, cons = T.unsafe(nil)); end - - # source://rexml/lib/rexml/source.rb#128 - def position; end - - # source://rexml/lib/rexml/source.rb#132 - def position=(pos); end - - # source://rexml/lib/rexml/source.rb#104 - def read(term = T.unsafe(nil)); end - - # source://rexml/lib/rexml/source.rb#107 - def read_until(term); end - - private - - # source://rexml/lib/rexml/source.rb#151 - def detect_encoding; end - - # source://rexml/lib/rexml/source.rb#169 - def encoding_updated; end -end - -# source://rexml/lib/rexml/source.rb#57 -module REXML::Source::Private; end - -# source://rexml/lib/rexml/source.rb#59 -REXML::Source::Private::PRE_DEFINED_TERM_PATTERNS = T.let(T.unsafe(nil), Hash) - -# source://rexml/lib/rexml/source.rb#58 -REXML::Source::Private::SCANNER_RESET_SIZE = T.let(T.unsafe(nil), Integer) - -# Represents text nodes in an XML document -# -# source://rexml/lib/rexml/text.rb#11 -class REXML::Text < ::REXML::Child - include ::Comparable - - # Constructor - # +arg+ if a String, the content is set to the String. If a Text, - # the object is shallowly cloned. - # - # +respect_whitespace+ (boolean, false) if true, whitespace is - # respected - # - # +parent+ (nil) if this is a Parent object, the parent - # will be set to this. - # - # +raw+ (nil) This argument can be given three values. - # If true, then the value of used to construct this object is expected to - # contain no unescaped XML markup, and REXML will not change the text. If - # this value is false, the string may contain any characters, and REXML will - # escape any and all defined entities whose values are contained in the - # text. If this value is nil (the default), then the raw value of the - # parent will be used as the raw value for this node. If there is no raw - # value for the parent, and no value is supplied, the default is false. - # Use this field if you have entities defined for some text, and you don't - # want REXML to escape that text in output. - # Text.new( "<&", false, nil, false ) #-> "<&" - # Text.new( "<&", false, nil, false ) #-> "&lt;&amp;" - # Text.new( "<&", false, nil, true ) #-> Parse exception - # Text.new( "<&", false, nil, true ) #-> "<&" - # # Assume that the entity "s" is defined to be "sean" - # # and that the entity "r" is defined to be "russell" - # Text.new( "sean russell" ) #-> "&s; &r;" - # Text.new( "sean russell", false, nil, true ) #-> "sean russell" - # - # +entity_filter+ (nil) This can be an array of entities to match in the - # supplied text. This argument is only useful if +raw+ is set to false. - # Text.new( "sean russell", false, nil, false, ["s"] ) #-> "&s; russell" - # Text.new( "sean russell", false, nil, true, ["s"] ) #-> "sean russell" - # In the last example, the +entity_filter+ argument is ignored. - # - # +illegal+ INTERNAL USE ONLY - # - # @return [Text] a new instance of Text - # - # source://rexml/lib/rexml/text.rb#94 - def initialize(arg, respect_whitespace = T.unsafe(nil), parent = T.unsafe(nil), raw = T.unsafe(nil), entity_filter = T.unsafe(nil), illegal = T.unsafe(nil)); end - - # Appends text to this text node. The text is appended in the +raw+ mode - # of this text node. - # - # +returns+ the text itself to enable method chain like - # 'text << "XXX" << "YYY"'. - # - # source://rexml/lib/rexml/text.rb#214 - def <<(to_append); end - - # +other+ a String or a Text - # +returns+ the result of (to_s <=> arg.to_s) - # - # source://rexml/lib/rexml/text.rb#223 - def <=>(other); end - - # source://rexml/lib/rexml/text.rb#204 - def clone; end - - # source://rexml/lib/rexml/text.rb#227 - def doctype; end - - # @return [Boolean] - # - # source://rexml/lib/rexml/text.rb#199 - def empty?; end - - # source://rexml/lib/rexml/text.rb#299 - def indent_text(string, level = T.unsafe(nil), style = T.unsafe(nil), indentfirstline = T.unsafe(nil)); end - - # source://rexml/lib/rexml/text.rb#253 - def inspect; end - - # source://rexml/lib/rexml/text.rb#195 - def node_type; end - - # source://rexml/lib/rexml/text.rb#125 - def parent=(parent); end - - # If +raw+ is true, then REXML leaves the value alone - # - # source://rexml/lib/rexml/text.rb#21 - def raw; end - - # If +raw+ is true, then REXML leaves the value alone - # - # source://rexml/lib/rexml/text.rb#21 - def raw=(_arg0); end - - # Returns the string value of this text node. This string is always - # escaped, meaning that it is a valid XML text node string, and all - # entities that can be escaped, have been inserted. This method respects - # the entity filter set in the constructor. - # - # # Assume that the entity "s" is defined to be "sean", and that the - # # entity "r" is defined to be "russell" - # t = Text.new( "< & sean russell", false, nil, false, ['s'] ) - # t.to_s #-> "< & &s; russell" - # t = Text.new( "< & &s; russell", false, nil, false ) - # t.to_s #-> "< & &s; russell" - # u = Text.new( "sean russell", false, nil, true ) - # u.to_s #-> "sean russell" - # - # source://rexml/lib/rexml/text.rb#248 - def to_s; end - - # Returns the string value of this text. This is the text without - # entities, as it might be used programmatically, or printed to the - # console. This ignores the 'raw' attribute setting, and any - # entity_filter. - # - # # Assume that the entity "s" is defined to be "sean", and that the - # # entity "r" is defined to be "russell" - # t = Text.new( "< & sean russell", false, nil, false, ['s'] ) - # t.value #-> "< & sean russell" - # t = Text.new( "< & &s; russell", false, nil, false ) - # t.value #-> "< & sean russell" - # u = Text.new( "sean russell", false, nil, true ) - # u.value #-> "sean russell" - # - # source://rexml/lib/rexml/text.rb#270 - def value; end - - # Sets the contents of this text node. This expects the text to be - # unnormalized. It returns self. - # - # e = Element.new( "a" ) - # e.add_text( "foo" ) # <a>foo</a> - # e[0].value = "bar" # <a>bar</a> - # e[0].value = "<a>" # <a><a></a> - # - # source://rexml/lib/rexml/text.rb#282 - def value=(val); end - - # source://rexml/lib/rexml/text.rb#288 - def wrap(string, width, addnewline = T.unsafe(nil)); end - - # == DEPRECATED - # See REXML::Formatters - # - # source://rexml/lib/rexml/text.rb#314 - def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end - - # Writes out text, substituting special characters beforehand. - # +out+ A String, IO, or any other object supporting <<( String ) - # +input+ the text to substitute and the write out - # - # z=utf8.unpack("U*") - # ascOut="" - # z.each{|r| - # if r < 0x100 - # ascOut.concat(r.chr) - # else - # ascOut.concat(sprintf("&#x%x;", r)) - # end - # } - # puts ascOut - # - # source://rexml/lib/rexml/text.rb#346 - def write_with_substitution(out, input); end - - # FIXME - # This probably won't work properly - # - # source://rexml/lib/rexml/text.rb#326 - def xpath; end - - private - - # source://rexml/lib/rexml/text.rb#359 - def clear_cache; end - - class << self - # check for illegal characters - # - # source://rexml/lib/rexml/text.rb#131 - def check(string, pattern, doctype); end - - # source://rexml/lib/rexml/text.rb#429 - def expand(ref, doctype, filter); end - - # Escapes all possible entities - # - # source://rexml/lib/rexml/text.rb#391 - def normalize(input, doctype = T.unsafe(nil), entity_filter = T.unsafe(nil)); end - - # Reads text, substituting entities - # - # source://rexml/lib/rexml/text.rb#365 - def read_with_substitution(input, illegal = T.unsafe(nil)); end - - # Unescapes all possible entities - # - # source://rexml/lib/rexml/text.rb#415 - def unnormalize(string, doctype = T.unsafe(nil), filter = T.unsafe(nil), illegal = T.unsafe(nil), entity_expansion_text_limit: T.unsafe(nil)); end - end -end - -# source://rexml/lib/rexml/undefinednamespaceexception.rb#4 -class REXML::UndefinedNamespaceException < ::REXML::ParseException - # @return [UndefinedNamespaceException] a new instance of UndefinedNamespaceException - # - # source://rexml/lib/rexml/undefinednamespaceexception.rb#5 - def initialize(prefix, source, parser); end -end - -# source://rexml/lib/rexml/validation/validationexception.rb#4 -class REXML::Validation::ValidationException < ::RuntimeError - # @return [ValidationException] a new instance of ValidationException - # - # source://rexml/lib/rexml/validation/validationexception.rb#5 - def initialize(msg); end -end - -# NEEDS DOCUMENTATION -# -# source://rexml/lib/rexml/xmldecl.rb#8 -class REXML::XMLDecl < ::REXML::Child - include ::REXML::Encoding - - # @return [XMLDecl] a new instance of XMLDecl - # - # source://rexml/lib/rexml/xmldecl.rb#20 - def initialize(version = T.unsafe(nil), encoding = T.unsafe(nil), standalone = T.unsafe(nil)); end - - # source://rexml/lib/rexml/xmldecl.rb#56 - def ==(other); end - - # source://rexml/lib/rexml/xmldecl.rb#39 - def clone; end - - # source://rexml/lib/rexml/xmldecl.rb#102 - def dowrite; end - - # source://rexml/lib/rexml/xmldecl.rb#76 - def encoding=(enc); end - - # source://rexml/lib/rexml/xmldecl.rb#106 - def inspect; end - - # source://rexml/lib/rexml/xmldecl.rb#69 - def node_type; end - - # source://rexml/lib/rexml/xmldecl.rb#98 - def nowrite; end - - # source://rexml/lib/rexml/encoding.rb#7 - def old_enc=(encoding); end - - # Returns the value of attribute standalone. - # - # source://rexml/lib/rexml/xmldecl.rb#17 - def stand_alone?; end - - # Returns the value of attribute standalone. - # - # source://rexml/lib/rexml/xmldecl.rb#17 - def standalone; end - - # Sets the attribute standalone - # - # @param value the value to set the attribute standalone to. - # - # source://rexml/lib/rexml/xmldecl.rb#17 - def standalone=(_arg0); end - - # Returns the value of attribute version. - # - # source://rexml/lib/rexml/xmldecl.rb#17 - def version; end - - # Sets the attribute version - # - # @param value the value to set the attribute version to. - # - # source://rexml/lib/rexml/xmldecl.rb#17 - def version=(_arg0); end - - # indent:: - # Ignored. There must be no whitespace before an XML declaration - # transitive:: - # Ignored - # ie_hack:: - # Ignored - # - # source://rexml/lib/rexml/xmldecl.rb#49 - def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end - - # Returns the value of attribute writeencoding. - # - # source://rexml/lib/rexml/xmldecl.rb#18 - def writeencoding; end - - # Returns the value of attribute writethis. - # - # source://rexml/lib/rexml/xmldecl.rb#18 - def writethis; end - - # source://rexml/lib/rexml/xmldecl.rb#63 - def xmldecl(version, encoding, standalone); end - - private - - # source://rexml/lib/rexml/xmldecl.rb#111 - def content(enc); end - - class << self - # Only use this if you do not want the XML declaration to be written; - # this object is ignored by the XML writer. Otherwise, instantiate your - # own XMLDecl and add it to the document. - # - # Note that XML 1.1 documents *must* include an XML declaration - # - # source://rexml/lib/rexml/xmldecl.rb#92 - def default; end - end -end - -# @private -# -# source://rexml/lib/rexml/xpath_parser.rb#963 -class REXML::XPathNode - # @return [XPathNode] a new instance of XPathNode - # - # source://rexml/lib/rexml/xpath_parser.rb#965 - def initialize(node, context = T.unsafe(nil)); end - - # Returns the value of attribute context. - # - # source://rexml/lib/rexml/xpath_parser.rb#964 - def context; end - - # source://rexml/lib/rexml/xpath_parser.rb#974 - def position; end - - # Returns the value of attribute raw_node. - # - # source://rexml/lib/rexml/xpath_parser.rb#964 - def raw_node; end -end - -# You don't want to use this class. Really. Use XPath, which is a wrapper -# for this class. Believe me. You don't want to poke around in here. -# There is strange, dark magic at work in this code. Beware. Go back! Go -# back while you still can! -# -# source://rexml/lib/rexml/xpath_parser.rb#54 -class REXML::XPathParser - include ::REXML::XMLTokens - - # @return [XPathParser] a new instance of XPathParser - # - # source://rexml/lib/rexml/xpath_parser.rb#60 - def initialize(strict: T.unsafe(nil)); end - - # source://rexml/lib/rexml/xpath_parser.rb#94 - def []=(variable_name, value); end - - # Performs a depth-first (document order) XPath search, and returns the - # first match. This is the fastest, lightest way to return a single result. - # - # FIXME: This method is incomplete! - # - # source://rexml/lib/rexml/xpath_parser.rb#103 - def first(path_stack, node); end - - # source://rexml/lib/rexml/xpath_parser.rb#84 - def get_first(path, nodeset); end - - # source://rexml/lib/rexml/xpath_parser.rb#139 - def match(path_stack, nodeset); end - - # source://rexml/lib/rexml/xpath_parser.rb#69 - def namespaces=(namespaces = T.unsafe(nil)); end - - # source://rexml/lib/rexml/xpath_parser.rb#79 - def parse(path, nodeset); end - - # source://rexml/lib/rexml/xpath_parser.rb#89 - def predicate(path, nodeset); end - - # source://rexml/lib/rexml/xpath_parser.rb#74 - def variables=(vars = T.unsafe(nil)); end - - private - - # source://rexml/lib/rexml/xpath_parser.rb#779 - def child(nodeset); end - - # source://rexml/lib/rexml/xpath_parser.rb#920 - def compare(a, operator, b); end - - # source://rexml/lib/rexml/xpath_parser.rb#682 - def descendant(nodeset, include_self); end - - # source://rexml/lib/rexml/xpath_parser.rb#693 - def descendant_recursive(raw_node, new_nodeset, new_nodes, include_self); end - - # source://rexml/lib/rexml/xpath_parser.rb#942 - def each_unnode(nodeset); end - - # source://rexml/lib/rexml/xpath_parser.rb#641 - def enter(tag, *args); end - - # source://rexml/lib/rexml/xpath_parser.rb#819 - def equality_relational_compare(set1, op, set2); end - - # source://rexml/lib/rexml/xpath_parser.rb#591 - def evaluate_predicate(expression, nodesets); end - - # Expr takes a stack of path elements and a set of nodes (either a Parent - # or an Array and returns an Array of matching nodes - # - # source://rexml/lib/rexml/xpath_parser.rb#175 - def expr(path_stack, nodeset, context = T.unsafe(nil)); end - - # source://rexml/lib/rexml/xpath_parser.rb#582 - def filter_nodeset(nodeset); end - - # source://rexml/lib/rexml/xpath_parser.rb#749 - def following(node); end - - # source://rexml/lib/rexml/xpath_parser.rb#760 - def following_node_of(node); end - - # Returns a String namespace for a node, given a prefix - # The rules are: - # - # 1. Use the supplied namespace mapping first. - # 2. If no mapping was supplied, use the context node to look up the namespace - # - # source://rexml/lib/rexml/xpath_parser.rb#163 - def get_namespace(node, prefix); end - - # source://rexml/lib/rexml/xpath_parser.rb#646 - def leave(tag, *args); end - - # source://rexml/lib/rexml/xpath_parser.rb#767 - def next_sibling_node(node); end - - # source://rexml/lib/rexml/xpath_parser.rb#477 - def node_test(path_stack, nodesets, any_type: T.unsafe(nil)); end - - # source://rexml/lib/rexml/xpath_parser.rb#806 - def norm(b); end - - # source://rexml/lib/rexml/xpath_parser.rb#894 - def normalize_compare_values(a, operator, b); end - - # Builds a nodeset of all of the preceding nodes of the supplied node, - # in reverse document order - # preceding:: includes every element in the document that precedes this node, - # except for ancestors - # - # source://rexml/lib/rexml/xpath_parser.rb#712 - def preceding(node); end - - # source://rexml/lib/rexml/xpath_parser.rb#734 - def preceding_node_of(node); end - - # Reorders an array of nodes so that they are in document order - # It tries to do this efficiently. - # - # FIXME: I need to get rid of this, but the issue is that most of the XPath - # interpreter functions as a filter, which means that we lose context going - # in and out of function calls. If I knew what the index of the nodes was, - # I wouldn't have to do this. Maybe add a document IDX for each node? - # Problems with mutable documents. Or, rewrite everything. - # - # source://rexml/lib/rexml/xpath_parser.rb#659 - def sort(array_of_nodes, order); end - - # source://rexml/lib/rexml/xpath_parser.rb#441 - def step(path_stack, any_type: T.unsafe(nil), order: T.unsafe(nil)); end - - # @return [Boolean] - # - # source://rexml/lib/rexml/xpath_parser.rb#154 - def strict?; end - - # source://rexml/lib/rexml/xpath_parser.rb#634 - def trace(*args); end - - # source://rexml/lib/rexml/xpath_parser.rb#954 - def unnode(nodeset); end - - # source://rexml/lib/rexml/xpath_parser.rb#881 - def value_type(value); end -end - -# source://rexml/lib/rexml/xpath_parser.rb#58 -REXML::XPathParser::DEBUG = T.let(T.unsafe(nil), FalseClass) diff --git a/sorbet/rbi/gems/rubocop-ast@1.31.3.rbi b/sorbet/rbi/gems/rubocop-ast@1.34.0.rbi similarity index 78% rename from sorbet/rbi/gems/rubocop-ast@1.31.3.rbi rename to sorbet/rbi/gems/rubocop-ast@1.34.0.rbi index b5956722..f88a06d1 100644 --- a/sorbet/rbi/gems/rubocop-ast@1.31.3.rbi +++ b/sorbet/rbi/gems/rubocop-ast@1.34.0.rbi @@ -160,12 +160,16 @@ class RuboCop::AST::ArrayNode < ::RuboCop::AST::Node # # @return [Boolean] whether the array is enclosed in percent or square # - # source://rubocop-ast/lib/rubocop/ast/node/array_node.rb#60 + # source://rubocop-ast/lib/rubocop/ast/node/array_node.rb#64 def bracketed?; end - # @deprecated Use `values.each` (a.k.a. `children.each`) + # Calls the given block for each `value` node in the `array` literal. + # If no block is given, an `Enumerator` is returned. + # + # @return [self] if a block is given + # @return [Enumerator] if no block is given # - # source://rubocop-ast/lib/rubocop/ast/node/array_node.rb#21 + # source://rubocop-ast/lib/rubocop/ast/node/array_node.rb#25 def each_value(&block); end # Checks whether the `array` literal is delimited by percent brackets. @@ -174,14 +178,14 @@ class RuboCop::AST::ArrayNode < ::RuboCop::AST::Node # @overload percent_literal? # @return [Boolean] whether the array is enclosed in percent brackets # - # source://rubocop-ast/lib/rubocop/ast/node/array_node.rb#47 + # source://rubocop-ast/lib/rubocop/ast/node/array_node.rb#51 def percent_literal?(type = T.unsafe(nil)); end # Checks whether the `array` literal is delimited by square brackets. # # @return [Boolean] whether the array is enclosed in square brackets # - # source://rubocop-ast/lib/rubocop/ast/node/array_node.rb#32 + # source://rubocop-ast/lib/rubocop/ast/node/array_node.rb#36 def square_brackets?; end # Returns an array of all value nodes in the `array` literal. @@ -205,19 +209,33 @@ class RuboCop::AST::AsgnNode < ::RuboCop::AST::Node # # @return [Node] the expression being assigned. # - # source://rubocop-ast/lib/rubocop/ast/node/asgn_node.rb#19 + # source://rubocop-ast/lib/rubocop/ast/node/asgn_node.rb#20 def expression; end + # The name of the variable being assigned as a symbol. + # + # @return [Symbol] the name of the variable being assigned + # + # source://rubocop-ast/lib/rubocop/ast/node/asgn_node.rb#12 + def lhs; end + # The name of the variable being assigned as a symbol. # # @return [Symbol] the name of the variable being assigned # # source://rubocop-ast/lib/rubocop/ast/node/asgn_node.rb#12 def name; end + + # The expression being assigned to the variable. + # + # @return [Node] the expression being assigned. + # + # source://rubocop-ast/lib/rubocop/ast/node/asgn_node.rb#20 + def rhs; end end # Common functionality for primitive literal nodes: `sym`, `str`, -# `int`, `float`, ... +# `int`, `float`, `rational`... # # source://rubocop-ast/lib/rubocop/ast/node/mixin/basic_literal_node.rb#7 module RuboCop::AST::BasicLiteralNode @@ -439,18 +457,18 @@ class RuboCop::AST::Builder < ::Parser::Builders::Default # # @return [Node] the generated node # - # source://rubocop-ast/lib/rubocop/ast/builder.rb#98 + # source://rubocop-ast/lib/rubocop/ast/builder.rb#105 def n(type, children, source_map); end # TODO: Figure out what to do about literal encoding handling... # More details here https://github.com/whitequark/parser/issues/283 # - # source://rubocop-ast/lib/rubocop/ast/builder.rb#104 + # source://rubocop-ast/lib/rubocop/ast/builder.rb#111 def string_value(token); end private - # source://rubocop-ast/lib/rubocop/ast/builder.rb#110 + # source://rubocop-ast/lib/rubocop/ast/builder.rb#117 def node_klass(type); end end @@ -570,26 +588,27 @@ end # # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#8 class RuboCop::AST::CasgnNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConstantNode + # The expression being assigned to the variable. # # @return [Node] the expression being assigned. # - # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#26 + # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#17 def expression; end - # The name of the variable being assigned as a symbol. - # - # @return [Symbol] the name of the variable being assigned - # - # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#19 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#14 + def lhs; end + + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#14 def name; end - # The namespace of the constant being assigned. + # The expression being assigned to the variable. # - # @return [Node, nil] the node associated with the scope (e.g. cbase, const, ...) + # @return [Node] the expression being assigned. # - # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#12 - def namespace; end + # source://rubocop-ast/lib/rubocop/ast/node/casgn_node.rb#17 + def rhs; end end # A node extension for `class` nodes. This will be used in place of a plain @@ -624,475 +643,475 @@ end # # source://rubocop-ast/lib/rubocop/ast/node/mixin/collection_node.rb#6 module RuboCop::AST::CollectionNode - extend ::Forwardable + extend ::RuboCop::SimpleForwardable - # source://forwardable/1.3.3forwardable.rb#231 - def &(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def &(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def *(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def *(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def +(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def +(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def -(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def -(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def <<(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def <<(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def [](*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def [](*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def []=(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def []=(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def all?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def all?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def any?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def any?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def append(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def append(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def assoc(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def assoc(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def at(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def at(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def bsearch(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def bsearch(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def bsearch_index(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def bsearch_index(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def chain(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def chain(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def chunk(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def chunk(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def chunk_while(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def chunk_while(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def clear(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def clear(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def collect(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def collect(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def collect!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def collect!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def collect_concat(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def collect_concat(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def combination(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def combination(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def compact(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def compact(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def compact!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def compact!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def compact_blank(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def compact_blank(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def compact_blank!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def compact_blank!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def concat(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def concat(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def count(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def count(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def cycle(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def cycle(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def deconstruct(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def deconstruct(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def delete(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def delete(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def delete_at(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def delete_at(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def delete_if(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def delete_if(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def detect(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def detect(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def difference(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def difference(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def dig(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def dig(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def drop(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def drop(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def drop_while(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def drop_while(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def each(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def each_cons(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each_cons(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def each_entry(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each_entry(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def each_index(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each_index(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def each_slice(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each_slice(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def each_with_index(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each_with_index(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def each_with_object(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each_with_object(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def empty?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def empty?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def entries(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def entries(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def exclude?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def exclude?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def excluding(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def excluding(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def extract!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def extract!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def extract_options!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def extract_options!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def fetch(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def fetch(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def fill(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def fill(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def filter(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def filter(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def filter!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def filter!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def filter_map(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def filter_map(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def find(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def find(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def find_all(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def find_all(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def find_index(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def find_index(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def first(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def first(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def flat_map(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def flat_map(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def flatten(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def flatten(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def flatten!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def flatten!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def grep(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def grep(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def grep_v(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def grep_v(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def group_by(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def group_by(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def in_order_of(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def in_order_of(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def include?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def include?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def including(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def including(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def index(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def index(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def index_by(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def index_by(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def index_with(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def index_with(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def inject(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def inject(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def insert(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def insert(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def intersect?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def intersect?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def intersection(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def intersection(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def join(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def join(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def keep_if(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def keep_if(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def last(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def last(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def lazy(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def lazy(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def length(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def length(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def many?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def many?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def map(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def map(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def map!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def map!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def max(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def max(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def max_by(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def max_by(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def maximum(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def maximum(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def member?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def member?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def min(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def min(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def min_by(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def min_by(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def minimum(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def minimum(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def minmax(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def minmax(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def minmax_by(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def minmax_by(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def none?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def none?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def one?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def one?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def pack(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def pack(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def partition(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def partition(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def permutation(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def permutation(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def pick(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def pick(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def place(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def place(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def pluck(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def pluck(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def pop(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def pop(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def prepend(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def prepend(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def product(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def product(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def push(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def push(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def rassoc(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def rassoc(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def reduce(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def reduce(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def reject(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def reject(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def reject!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def reject!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def repeated_combination(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def repeated_combination(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def repeated_permutation(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def repeated_permutation(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def replace(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def replace(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def reverse(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def reverse(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def reverse!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def reverse!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def reverse_each(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def reverse_each(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def rindex(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def rindex(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def rotate(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def rotate(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def rotate!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def rotate!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def sample(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def sample(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def select(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def select(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def select!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def select!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def shelljoin(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def shelljoin(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def shift(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def shift(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def shuffle(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def shuffle(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def shuffle!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def shuffle!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def size(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def size(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def slice(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def slice(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def slice!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def slice!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def slice_after(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def slice_after(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def slice_before(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def slice_before(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def slice_when(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def slice_when(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def sole(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def sole(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def sort(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def sort(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def sort!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def sort!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def sort_by(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def sort_by(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def sort_by!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def sort_by!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def sum(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def sum(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def take(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def take(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def take_while(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def take_while(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def tally(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def tally(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_ary(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_ary(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_formatted_s(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_formatted_s(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_fs(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_fs(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_h(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_h(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_sentence(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_sentence(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_set(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_set(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_xml(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_xml(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def transpose(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def transpose(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def union(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def union(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def uniq(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def uniq(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def uniq!(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def uniq!(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def unshift(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def unshift(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def values_at(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def values_at(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def without(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def without(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def zip(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def zip(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def |(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def |(*_arg0, **_arg1, &_arg2); end end # source://rubocop-ast/lib/rubocop/ast/node/mixin/collection_node.rb#9 @@ -1143,16 +1162,24 @@ end # # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#6 class RuboCop::AST::ConstNode < ::RuboCop::AST::Node + include ::RuboCop::AST::ConstantNode +end + +# Common functionality for nodes that deal with constants: +# `const`, `casgn`. +# +# source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#7 +module RuboCop::AST::ConstantNode # @return [Boolean] if the constant starts with `::` (aka s(:cbase)) # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#26 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#27 def absolute?; end # @return [Boolean] if the constant is a Module / Class, according to the standard convention. # Note: some classes might have uppercase in which case this method # returns false # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#20 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#21 def class_name?; end # Yield nodes for the namespace @@ -1162,29 +1189,29 @@ class RuboCop::AST::ConstNode < ::RuboCop::AST::Node # s(:const, :Foo), then # s(:const, s(:const, :Foo), :Bar) # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#43 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#44 def each_path(&block); end # @return [Boolean] if the constant is a Module / Class, according to the standard convention. # Note: some classes might have uppercase in which case this method # returns false # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#20 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#21 def module_name?; end # @return [Node, nil] the node associated with the scope (e.g. cbase, const, ...) # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#8 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#9 def namespace; end # @return [Boolean] if the constant does not start with `::` (aka s(:cbase)) # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#33 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#34 def relative?; end # @return [Symbol] the demodulized name of the constant: "::Foo::Bar" => :Bar # - # source://rubocop-ast/lib/rubocop/ast/node/const_node.rb#13 + # source://rubocop-ast/lib/rubocop/ast/node/mixin/constant_node.rb#14 def short_name; end end @@ -1374,6 +1401,14 @@ class RuboCop::AST::EnsureNode < ::RuboCop::AST::Node # # source://rubocop-ast/lib/rubocop/ast/node/ensure_node.rb#12 def body; end + + # Checks whether this node body is a void context. + # Always `true` for `ensure`. + # + # @return [true] whether the `ensure` node body is a void context + # + # source://rubocop-ast/lib/rubocop/ast/node/ensure_node.rb#20 + def void_context?; end end # source://rubocop-ast/lib/rubocop/ast/ext/range.rb#5 @@ -1401,11 +1436,6 @@ module RuboCop::AST::Ext::Range def line_span(exclude_end: T.unsafe(nil)); end end -# Refinement to circumvent broken `Range#minmax` for infinity ranges in 2.6- -# -# source://rubocop-ast/lib/rubocop/ast/ext/range_min_max.rb#7 -module RuboCop::AST::Ext::RangeMinMax; end - # A node extension for `float` nodes. This will be used in place of a plain # node when the builder constructs the AST, making its methods available to # all `float` nodes within RuboCop. @@ -2102,6 +2132,71 @@ class RuboCop::AST::LambdaNode < ::RuboCop::AST::Node def first_argument_index; end end +# A node extension for `masgn` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#8 +class RuboCop::AST::MasgnNode < ::RuboCop::AST::Node + # @return [Array<Node>] the assignment nodes of the multiple assignment + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#16 + def assignments; end + + # The RHS (right hand side) of the multiple assignment. This returns + # the nodes as parsed: either a single node if the RHS has a single value, + # or an `array` node containing multiple nodes. + # + # NOTE: Due to how parsing works, `expression` will return the same for + # `a, b = x, y` and `a, b = [x, y]`. + # + # @return [Node] the right hand side of a multiple assignment. + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#39 + def expression; end + + # @return [MlhsNode] the `mlhs` node + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#10 + def lhs; end + + # @return [Array<Symbol>] names of all the variables being assigned + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#21 + def names; end + + # The RHS (right hand side) of the multiple assignment. This returns + # the nodes as parsed: either a single node if the RHS has a single value, + # or an `array` node containing multiple nodes. + # + # NOTE: Due to how parsing works, `expression` will return the same for + # `a, b = x, y` and `a, b = [x, y]`. + # + # @return [Node] the right hand side of a multiple assignment. + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#39 + def rhs; end + + # In contrast to `expression`, `values` always returns a Ruby array + # containing all the nodes being assigned on the RHS. + # + # Literal arrays are considered a singular value; but unlike `expression`, + # implied `array` nodes from assigning multiple values on the RHS are treated + # as separate. + # + # @return [Array<Node>] individual values being assigned on the RHS of the multiple assignment + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#52 + def values; end + + private + + # @return [Boolean] + # + # source://rubocop-ast/lib/rubocop/ast/node/masgn_node.rb#58 + def multiple_rhs?; end +end + # Common functionality for nodes that are a kind of method dispatch: # `send`, `csend`, `super`, `zsuper`, `yield`, `defined?`, # and (modern only): `index`, `indexasgn`, `lambda` @@ -2534,6 +2629,22 @@ RuboCop::AST::MethodIdentifierPredicates::NONMUTATING_UNARY_OPERATOR_METHODS = T # source://rubocop-ast/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb#20 RuboCop::AST::MethodIdentifierPredicates::OPERATOR_METHODS = T.let(T.unsafe(nil), Set) +# A node extension for `mlhs` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# source://rubocop-ast/lib/rubocop/ast/node/mlhs_node.rb#8 +class RuboCop::AST::MlhsNode < ::RuboCop::AST::Node + # Returns all the assignment nodes on the left hand side (LHS) of a multiple assignment. + # These are generally assignment nodes (`lvasgn`, `ivasgn`, `cvasgn`, `gvasgn`, `casgn`) + # but can also be `send` nodes in case of `foo.bar, ... =` or `foo[:bar], ... =`. + # + # @return [Array<Node>] the assignment nodes of the multiple assignment LHS + # + # source://rubocop-ast/lib/rubocop/ast/node/mlhs_node.rb#14 + def assignments; end +end + # Common functionality for nodes that can be used as modifiers: # `if`, `while`, `until` # @@ -2604,19 +2715,19 @@ class RuboCop::AST::Node < ::Parser::AST::Node # @return [Node] a new instance of Node # @see https://www.rubydoc.info/gems/ast/AST/Node:initialize # - # source://rubocop-ast/lib/rubocop/ast/node.rb#92 + # source://rubocop-ast/lib/rubocop/ast/node.rb#113 def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def __ENCODING___type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def __FILE___type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def __LINE___type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def alias_type?; end # Returns an array of ancestor nodes. @@ -2624,173 +2735,173 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Array<Node>] an array of ancestor nodes # - # source://rubocop-ast/lib/rubocop/ast/node.rb#247 + # source://rubocop-ast/lib/rubocop/ast/node.rb#268 def ancestors; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def and_asgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def and_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def arg_expr_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def arg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def args_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#464 + # source://rubocop-ast/lib/rubocop/ast/node.rb#474 def argument?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#468 + # source://rubocop-ast/lib/rubocop/ast/node.rb#478 def argument_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def array_pattern_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def array_pattern_with_tail_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def array_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#416 + # source://rubocop-ast/lib/rubocop/ast/node.rb#426 def assignment?; end # Some cops treat the shovel operator as a kind of assignment. # - # source://rubocop-ast/lib/rubocop/ast/node.rb#355 + # source://rubocop-ast/lib/rubocop/ast/node.rb#376 def assignment_or_similar?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def back_ref_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#420 + # source://rubocop-ast/lib/rubocop/ast/node.rb#430 def basic_conditional?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#363 + # source://rubocop-ast/lib/rubocop/ast/node.rb#384 def basic_literal?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def begin_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def block_pass_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def block_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def blockarg_expr_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def blockarg_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#472 + # source://rubocop-ast/lib/rubocop/ast/node.rb#482 def boolean_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def break_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#456 + # source://rubocop-ast/lib/rubocop/ast/node.rb#466 def call_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def case_match_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def case_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def casgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def cbase_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#460 + # source://rubocop-ast/lib/rubocop/ast/node.rb#470 def chained?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#512 + # source://rubocop-ast/lib/rubocop/ast/node.rb#522 def class_constructor?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#530 + # source://rubocop-ast/lib/rubocop/ast/node.rb#540 def class_definition?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def class_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#144 + # source://rubocop-ast/lib/rubocop/ast/node.rb#165 def complete!; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#149 + # source://rubocop-ast/lib/rubocop/ast/node.rb#170 def complete?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def complex_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#424 + # source://rubocop-ast/lib/rubocop/ast/node.rb#434 def conditional?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#293 + # source://rubocop-ast/lib/rubocop/ast/node.rb#314 def const_name; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def const_pattern_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def const_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def csend_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def cvar_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def cvasgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def def_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#314 + # source://rubocop-ast/lib/rubocop/ast/node.rb#335 def defined_module; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#319 + # source://rubocop-ast/lib/rubocop/ast/node.rb#340 def defined_module_name; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def defined_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def defs_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def dstr_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def dsym_type?; end # Calls the given block for each ancestor node from parent to root. @@ -2803,163 +2914,163 @@ class RuboCop::AST::Node < ::Parser::AST::Node # @return [Enumerator] if no block is given # @yieldparam node [Node] each ancestor node # - # source://rubocop-ast/lib/rubocop/ast/node.rb#235 + # source://rubocop-ast/lib/rubocop/ast/node.rb#256 def each_ancestor(*types, &block); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def eflipflop_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def empty_else_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#349 + # source://rubocop-ast/lib/rubocop/ast/node.rb#370 def empty_source?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def ensure_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#408 + # source://rubocop-ast/lib/rubocop/ast/node.rb#418 def equals_asgn?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def erange_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def false_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#371 + # source://rubocop-ast/lib/rubocop/ast/node.rb#392 def falsey_literal?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def find_pattern_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#261 + # source://rubocop-ast/lib/rubocop/ast/node.rb#282 def first_line; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def float_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def for_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def forward_arg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def forward_args_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def forwarded_args_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def forwarded_kwrestarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def forwarded_restarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#509 + # source://rubocop-ast/lib/rubocop/ast/node.rb#519 def global_const?(param0 = T.unsafe(nil), param1); end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#484 + # source://rubocop-ast/lib/rubocop/ast/node.rb#494 def guard_clause?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def gvar_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def gvasgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def hash_pattern_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def hash_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def ident_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def if_guard_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def if_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def iflipflop_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#379 + # source://rubocop-ast/lib/rubocop/ast/node.rb#400 def immutable_literal?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def in_match_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def in_pattern_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def index_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def indexasgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def int_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def irange_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def ivar_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def ivasgn_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#437 + # source://rubocop-ast/lib/rubocop/ast/node.rb#447 def keyword?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def kwarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def kwargs_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def kwbegin_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def kwnilarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def kwoptarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def kwrestarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def kwsplat_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#503 + # source://rubocop-ast/lib/rubocop/ast/node.rb#513 def lambda?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#506 + # source://rubocop-ast/lib/rubocop/ast/node.rb#516 def lambda_or_proc?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def lambda_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#265 + # source://rubocop-ast/lib/rubocop/ast/node.rb#286 def last_line; end # Use is discouraged, this is a potentially slow method and can lead @@ -2967,7 +3078,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Node, nil] the left (aka previous) sibling # - # source://rubocop-ast/lib/rubocop/ast/node.rb#187 + # source://rubocop-ast/lib/rubocop/ast/node.rb#208 def left_sibling; end # Use is discouraged, this is a potentially slow method and can lead @@ -2975,94 +3086,94 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Array<Node>] the left (aka previous) siblings # - # source://rubocop-ast/lib/rubocop/ast/node.rb#197 + # source://rubocop-ast/lib/rubocop/ast/node.rb#218 def left_siblings; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#269 + # source://rubocop-ast/lib/rubocop/ast/node.rb#290 def line_count; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#359 + # source://rubocop-ast/lib/rubocop/ast/node.rb#380 def literal?; end # NOTE: `loop { }` is a normal method call and thus not a loop keyword. # # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#433 + # source://rubocop-ast/lib/rubocop/ast/node.rb#443 def loop_keyword?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def lvar_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def lvasgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def masgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_alt_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_as_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_current_line_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#491 + # source://rubocop-ast/lib/rubocop/ast/node.rb#501 def match_guard_clause?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_nil_pattern_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_pattern_p_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_pattern_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_rest_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_var_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_with_lvasgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def match_with_trailing_comma_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def mlhs_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#537 + # source://rubocop-ast/lib/rubocop/ast/node.rb#547 def module_definition?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def module_type?; end # Predicates # # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#341 + # source://rubocop-ast/lib/rubocop/ast/node.rb#362 def multiline?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#375 + # source://rubocop-ast/lib/rubocop/ast/node.rb#396 def mutable_literal?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#671 + # source://rubocop-ast/lib/rubocop/ast/node.rb#679 def new_class_or_module_block?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def next_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def nil_type?; end # Common destructuring method. This can be used to normalize @@ -3075,95 +3186,95 @@ class RuboCop::AST::Node < ::Parser::AST::Node # source://ast/2.4.2lib/ast/node.rb#56 def node_parts; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#275 + # source://rubocop-ast/lib/rubocop/ast/node.rb#296 def nonempty_line_count; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def not_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def nth_ref_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def numargs_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def numblock_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#476 + # source://rubocop-ast/lib/rubocop/ast/node.rb#486 def numeric_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def objc_kwarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def objc_restarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def objc_varargs_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def op_asgn_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#448 + # source://rubocop-ast/lib/rubocop/ast/node.rb#458 def operator_keyword?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def optarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def or_asgn_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def or_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def pair_type?; end # Returns the parent node, or `nil` if the receiver is a root node. # # @return [Node, nil] the parent node or `nil` # - # source://rubocop-ast/lib/rubocop/ast/node.rb#126 + # source://rubocop-ast/lib/rubocop/ast/node.rb#147 def parent; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#135 + # source://rubocop-ast/lib/rubocop/ast/node.rb#156 def parent?; end # Searching the AST # - # source://rubocop-ast/lib/rubocop/ast/node.rb#325 + # source://rubocop-ast/lib/rubocop/ast/node.rb#346 def parent_module_name; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#452 + # source://rubocop-ast/lib/rubocop/ast/node.rb#462 def parenthesized_call?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def pin_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#428 + # source://rubocop-ast/lib/rubocop/ast/node.rb#438 def post_condition_loop?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def postexe_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def preexe_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#496 + # source://rubocop-ast/lib/rubocop/ast/node.rb#506 def proc?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def procarg0_type?; end # Some expressions are evaluated for their value, some for their side @@ -3176,56 +3287,60 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#582 + # source://rubocop-ast/lib/rubocop/ast/node.rb#590 def pure?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#480 + # source://rubocop-ast/lib/rubocop/ast/node.rb#490 def range_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def rational_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#286 + # source://rubocop-ast/lib/rubocop/ast/node.rb#307 def receiver(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#386 + # @return [Boolean] + # + # source://rubocop-ast/lib/rubocop/ast/node.rb#97 def recursive_basic_literal?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#386 + # @return [Boolean] + # + # source://rubocop-ast/lib/rubocop/ast/node.rb#97 def recursive_literal?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def redo_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#404 + # source://rubocop-ast/lib/rubocop/ast/node.rb#414 def reference?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def regexp_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def regopt_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def resbody_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def rescue_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def restarg_expr_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def restarg_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def retry_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def return_type?; end # Use is discouraged, this is a potentially slow method and can lead @@ -3233,7 +3348,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Node, nil] the right (aka next) sibling # - # source://rubocop-ast/lib/rubocop/ast/node.rb#178 + # source://rubocop-ast/lib/rubocop/ast/node.rb#199 def right_sibling; end # Use is discouraged, this is a potentially slow method and can lead @@ -3241,18 +3356,18 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Array<Node>] the right (aka next) siblings # - # source://rubocop-ast/lib/rubocop/ast/node.rb#206 + # source://rubocop-ast/lib/rubocop/ast/node.rb#227 def right_siblings; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#140 + # source://rubocop-ast/lib/rubocop/ast/node.rb#161 def root?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def sclass_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def self_type?; end # Most nodes are of 'send' type, so this method is defined @@ -3260,15 +3375,15 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#119 + # source://rubocop-ast/lib/rubocop/ast/node.rb#140 def send_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def shadowarg_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#412 + # source://rubocop-ast/lib/rubocop/ast/node.rb#422 def shorthand_asgn?; end # Returns the index of the receiver node in its siblings. (Sibling index @@ -3277,70 +3392,70 @@ class RuboCop::AST::Node < ::Parser::AST::Node # # @return [Integer, nil] the index of the receiver node in its siblings # - # source://rubocop-ast/lib/rubocop/ast/node.rb#171 + # source://rubocop-ast/lib/rubocop/ast/node.rb#192 def sibling_index; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#345 + # source://rubocop-ast/lib/rubocop/ast/node.rb#366 def single_line?; end # NOTE: Some rare nodes may have no source, like `s(:args)` in `foo {}` # # @return [String, nil] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#253 + # source://rubocop-ast/lib/rubocop/ast/node.rb#274 def source; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#279 + # source://rubocop-ast/lib/rubocop/ast/node.rb#300 def source_length; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#257 + # source://rubocop-ast/lib/rubocop/ast/node.rb#278 def source_range; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#444 + # source://rubocop-ast/lib/rubocop/ast/node.rb#454 def special_keyword?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def splat_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#291 + # source://rubocop-ast/lib/rubocop/ast/node.rb#312 def str_content(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def str_type?; end # @deprecated Use `:class_constructor?` # - # source://rubocop-ast/lib/rubocop/ast/node.rb#525 + # source://rubocop-ast/lib/rubocop/ast/node.rb#535 def struct_constructor?(param0 = T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def super_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def sym_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def true_type?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#367 + # source://rubocop-ast/lib/rubocop/ast/node.rb#388 def truthy_literal?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def undef_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def unless_guard_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def until_post_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def until_type?; end # Override `AST::Node#updated` so that `AST::Processor` does not try to @@ -3349,7 +3464,7 @@ class RuboCop::AST::Node < ::Parser::AST::Node # identical subtrees. Rather, the entire AST must be copied any time any # part of it is changed. # - # source://rubocop-ast/lib/rubocop/ast/node.rb#160 + # source://rubocop-ast/lib/rubocop/ast/node.rb#181 def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end # Some expressions are evaluated for their value, some for their side @@ -3360,76 +3475,82 @@ class RuboCop::AST::Node < ::Parser::AST::Node # So, does the return value of this node matter? If we changed it to # `(...; nil)`, might that affect anything? # - # # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#551 + # source://rubocop-ast/lib/rubocop/ast/node.rb#560 def value_used?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#400 + # source://rubocop-ast/lib/rubocop/ast/node.rb#410 def variable?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def when_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def while_post_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def while_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def xstr_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def yield_type?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#111 + # source://rubocop-ast/lib/rubocop/ast/node.rb#132 def zsuper_type?; end protected - # source://rubocop-ast/lib/rubocop/ast/node.rb#130 + # source://rubocop-ast/lib/rubocop/ast/node.rb#151 def parent=(node); end private # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#610 + # source://rubocop-ast/lib/rubocop/ast/node.rb#618 def begin_value_used?; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#621 + # source://rubocop-ast/lib/rubocop/ast/node.rb#629 def case_if_value_used?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#305 + # source://rubocop-ast/lib/rubocop/ast/node.rb#326 def defined_module0(param0 = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#615 + # source://rubocop-ast/lib/rubocop/ast/node.rb#623 def for_value_used?; end - # source://rubocop-ast/lib/rubocop/ast/node.rb#657 + # source://rubocop-ast/lib/rubocop/ast/node.rb#665 def parent_module_name_for_block(ancestor); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#645 + # source://rubocop-ast/lib/rubocop/ast/node.rb#653 def parent_module_name_for_sclass(sclass_node); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#632 + # source://rubocop-ast/lib/rubocop/ast/node.rb#640 def parent_module_name_part(node); end - # source://rubocop-ast/lib/rubocop/ast/node.rb#600 + # source://rubocop-ast/lib/rubocop/ast/node.rb#608 def visit_ancestors(types); end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node.rb#627 + # source://rubocop-ast/lib/rubocop/ast/node.rb#635 def while_until_value_used?; end + + class << self + private + + # source://rubocop-ast/lib/rubocop/ast/node.rb#92 + def def_recursive_literal_predicate(kind); end + end end # @api private @@ -3573,7 +3694,7 @@ RuboCop::AST::Node::VARIABLES = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/method_definer.rb#5 class RuboCop::AST::NodePattern include ::RuboCop::AST::NodePattern::MethodDefiner - extend ::Forwardable + extend ::RuboCop::SimpleForwardable # @return [NodePattern] a new instance of NodePattern # @@ -3591,8 +3712,8 @@ class RuboCop::AST::NodePattern # source://rubocop-ast/lib/rubocop/ast/node_pattern.rb#73 def ast; end - # source://forwardable/1.3.3forwardable.rb#231 - def captures(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def captures(*_arg0, **_arg1, &_arg2); end # source://rubocop-ast/lib/rubocop/ast/node_pattern.rb#111 def encode_with(coder); end @@ -3620,16 +3741,16 @@ class RuboCop::AST::NodePattern # source://rubocop-ast/lib/rubocop/ast/node_pattern.rb#73 def match_code; end - # source://forwardable/1.3.3forwardable.rb#231 - def named_parameters(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def named_parameters(*_arg0, **_arg1, &_arg2); end # Returns the value of attribute pattern. # # source://rubocop-ast/lib/rubocop/ast/node_pattern.rb#73 def pattern; end - # source://forwardable/1.3.3forwardable.rb#231 - def positional_parameters(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def positional_parameters(*_arg0, **_arg1, &_arg2); end # source://rubocop-ast/lib/rubocop/ast/node_pattern.rb#95 def to_s; end @@ -3734,15 +3855,15 @@ end # # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler.rb#11 class RuboCop::AST::NodePattern::Compiler - extend ::Forwardable + extend ::RuboCop::SimpleForwardable # @return [Compiler] a new instance of Compiler # # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler.rb#15 def initialize; end - # source://forwardable/1.3.3forwardable.rb#231 - def bind(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def bind(*_arg0, **_arg1, &_arg2); end # Returns the value of attribute binding. # @@ -3867,7 +3988,10 @@ class RuboCop::AST::NodePattern::Compiler::Binding # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler/binding.rb#16 def bind(name); end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler/binding.rb#30 + # Yields for each branch of the given union, forbidding unification of + # bindings which only appear in a subset of the union. + # + # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler/binding.rb#31 def union_bind(enum); end private @@ -3885,8 +4009,8 @@ class RuboCop::AST::NodePattern::Compiler::Debug < ::RuboCop::AST::NodePattern:: # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler/debug.rb#123 def initialize; end - # source://forwardable/1.3.3forwardable.rb#231 - def comments(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def comments(*_arg0, **_arg1, &_arg2); end # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler/debug.rb#128 def named_parameters; end @@ -3899,8 +4023,8 @@ class RuboCop::AST::NodePattern::Compiler::Debug < ::RuboCop::AST::NodePattern:: # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler/debug.rb#132 def parser; end - # source://forwardable/1.3.3forwardable.rb#231 - def tokens(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def tokens(*_arg0, **_arg1, &_arg2); end end # @api private @@ -4215,7 +4339,6 @@ end # Doc on how this fits in the compiling process: # /docs/modules/ROOT/pages/node_pattern.adoc # -# # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb#17 class RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler < ::RuboCop::AST::NodePattern::Compiler::Subcompiler # Calls `compile_sequence`; the actual `compile` method @@ -4369,6 +4492,8 @@ class RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler < ::RuboCop::AST: def within_loop; end end +# Shift of 1 from standard Ruby indices +# # source://rubocop-ast/lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb#18 RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler::DELTA = T.let(T.unsafe(nil), Integer) @@ -4501,7 +4626,7 @@ class RuboCop::AST::NodePattern::LexerRex # The current location in the parse. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#104 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#103 def location; end # The StringScanner for this lexer. @@ -4516,22 +4641,22 @@ class RuboCop::AST::NodePattern::LexerRex # Lex the next token. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#113 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#112 def next_token; end # Parse the given string. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#84 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#83 def parse(str); end # Read in and parse the file at +path+. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#94 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#93 def parse_file(path); end # The current scanner class. Must be overridden in subclasses. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#77 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/lexer.rex.rb#76 def scanner_class; end # The StringScanner for this lexer. @@ -4675,218 +4800,218 @@ end # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#7 class RuboCop::AST::NodePattern::Node < ::Parser::AST::Node include ::RuboCop::AST::Descendence - extend ::Forwardable + extend ::RuboCop::SimpleForwardable # Note: `arity.end` may be `Float::INFINITY` # # @return [Integer, Range] An Integer for fixed length terms, otherwise a Range. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#29 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#28 def arity; end # @return [Range] arity as a Range # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#69 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#68 def arity_range; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#23 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#22 def capture?; end # @return [Node] most nodes have only one child # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#48 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#47 def child; end # @return [Array<Node>] # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#43 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#42 def children_nodes; end # @return [Array<Node>, nil] replace node with result, or `nil` if no change requested. # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#34 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#33 def in_sequence_head; end # that matches within a Set (e.g. `42`, `:sym` but not `/regexp/`) # # @return [Boolean] returns true for nodes having a Ruby literal equivalent # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#64 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#63 def matches_within_set?; end # @return [Integer] nb of captures of that node and its descendants # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#53 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#52 def nb_captures; end # To be overridden by subclasses # # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#19 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#18 def rest?; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#78 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#77 def source_range; end # @return [Boolean] returns whether it matches a variable number of elements # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#58 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#57 def variadic?; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#74 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#73 def with(type: T.unsafe(nil), children: T.unsafe(nil), location: T.unsafe(nil)); end end # Node class for `<int str ...>` # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#180 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#179 class RuboCop::AST::NodePattern::Node::AnyOrder < ::RuboCop::AST::NodePattern::Node include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#198 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#197 def arity; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#190 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#189 def ends_with_rest?; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#194 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#193 def rest_node; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#186 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#185 def term_nodes; end end -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#183 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#182 RuboCop::AST::NodePattern::Node::AnyOrder::ARITIES = T.let(T.unsafe(nil), Hash) # Node class for `$something` # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#97 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#96 class RuboCop::AST::NodePattern::Node::Capture < ::RuboCop::AST::NodePattern::Node - # source://forwardable/1.3.3forwardable.rb#231 - def arity(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def arity(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#101 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#100 def capture?; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#109 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#108 def in_sequence_head; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#105 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#104 def nb_captures; end - # source://forwardable/1.3.3forwardable.rb#231 - def rest?(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def rest?(*_arg0, **_arg1, &_arg2); end end -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#86 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#85 module RuboCop::AST::NodePattern::Node::ForbidInSeqHead # @raise [NodePattern::Invalid] # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#87 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#86 def in_sequence_head; end end -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#140 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#139 RuboCop::AST::NodePattern::Node::FunctionCall = RuboCop::AST::NodePattern::Node::Predicate -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#82 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#81 RuboCop::AST::NodePattern::Node::INT_TO_RANGE = T.let(T.unsafe(nil), Hash) # Registry # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#250 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#249 RuboCop::AST::NodePattern::Node::MAP = T.let(T.unsafe(nil), Hash) -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#12 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#11 RuboCop::AST::NodePattern::Node::MATCHES_WITHIN_SET = T.let(T.unsafe(nil), Set) # Node class for `predicate?(:arg, :list)` # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#131 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#130 class RuboCop::AST::NodePattern::Node::Predicate < ::RuboCop::AST::NodePattern::Node - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#136 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#135 def arg_list; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#132 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#131 def method_name; end end # Node class for `int+` # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#143 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#142 class RuboCop::AST::NodePattern::Node::Repetition < ::RuboCop::AST::NodePattern::Node include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#156 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#155 def arity; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#146 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#145 def operator; end end -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#150 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#149 RuboCop::AST::NodePattern::Node::Repetition::ARITIES = T.let(T.unsafe(nil), Hash) # Node class for `...` # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#162 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#161 class RuboCop::AST::NodePattern::Node::Rest < ::RuboCop::AST::NodePattern::Node - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#170 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#169 def arity; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#174 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#173 def in_sequence_head; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#166 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#165 def rest?; end end -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#163 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#162 RuboCop::AST::NodePattern::Node::Rest::ARITY = T.let(T.unsafe(nil), Range) # Node class for `(type first second ...)` # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#118 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#117 class RuboCop::AST::NodePattern::Node::Sequence < ::RuboCop::AST::NodePattern::Node include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead # @return [Sequence] a new instance of Sequence # - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#121 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#120 def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end end # A list (potentially empty) of nodes; part of a Union # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#206 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#205 class RuboCop::AST::NodePattern::Node::Subsequence < ::RuboCop::AST::NodePattern::Node include ::RuboCop::AST::NodePattern::Node::ForbidInSeqHead - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#209 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#208 def arity; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#214 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#213 def in_sequence_head; end end # Node class for `{ ... }` # -# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#224 +# source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#223 class RuboCop::AST::NodePattern::Node::Union < ::RuboCop::AST::NodePattern::Node - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#225 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#224 def arity; end - # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#232 + # source://rubocop-ast/lib/rubocop/ast/node_pattern/node.rb#231 def in_sequence_head; end end @@ -4898,7 +5023,7 @@ end # # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#12 class RuboCop::AST::NodePattern::Parser < ::Racc::Parser - extend ::Forwardable + extend ::RuboCop::SimpleForwardable # @return [Parser] a new instance of Parser # @@ -5017,29 +5142,29 @@ class RuboCop::AST::NodePattern::Parser < ::Racc::Parser # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.racc.rb#465 def _reduce_none(val, _values); end - # source://forwardable/1.3.3forwardable.rb#231 - def emit_atom(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def emit_atom(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def emit_call(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def emit_call(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def emit_capture(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def emit_capture(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def emit_list(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def emit_list(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def emit_unary_op(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def emit_unary_op(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def emit_union(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def emit_union(*_arg0, **_arg1, &_arg2); end # source://rubocop-ast/lib/rubocop/ast/node_pattern/parser.rb#40 def inspect; end - # source://forwardable/1.3.3forwardable.rb#231 - def next_token(*args, **_arg1, &block); end + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def next_token(*_arg0, **_arg1, &_arg2); end # (Similar API to `parser` gem) # Parses a source and returns the AST. @@ -5312,6 +5437,9 @@ RuboCop::AST::NodePattern::Sets::SET_LOAD_RESTORE = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_MAP_COLLECT = T.let(T.unsafe(nil), Set) +# source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 +RuboCop::AST::NodePattern::Sets::SET_MAP_FILTER_MAP = T.let(T.unsafe(nil), Set) + # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_MATCH_MATCH_ = T.let(T.unsafe(nil), Set) @@ -5364,7 +5492,7 @@ RuboCop::AST::NodePattern::Sets::SET_READ_BINREAD = T.let(T.unsafe(nil), Set) RuboCop::AST::NodePattern::Sets::SET_REDUCE_INJECT = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 -RuboCop::AST::NodePattern::Sets::SET_REJECT_DELETE_IF_REJECT = T.let(T.unsafe(nil), Set) +RuboCop::AST::NodePattern::Sets::SET_REJECT_REJECT = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_REQUIRE_REQUIRE_RELATIVE = T.let(T.unsafe(nil), Set) @@ -5373,7 +5501,7 @@ RuboCop::AST::NodePattern::Sets::SET_REQUIRE_REQUIRE_RELATIVE = T.let(T.unsafe(n RuboCop::AST::NodePattern::Sets::SET_SELECT_FILTER_FIND_ALL = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 -RuboCop::AST::NodePattern::Sets::SET_SELECT_SELECT = T.let(T.unsafe(nil), Set) +RuboCop::AST::NodePattern::Sets::SET_SELECT_SELECT_FILTER_FILTER = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern/sets.rb#10 RuboCop::AST::NodePattern::Sets::SET_SEND_PUBLIC_SEND___SEND__ = T.let(T.unsafe(nil), Set) @@ -5495,7 +5623,7 @@ RuboCop::AST::NodePattern::Sets::SET_____2 = T.let(T.unsafe(nil), Set) # source://rubocop-ast/lib/rubocop/ast/node_pattern.rb#55 RuboCop::AST::NodePattern::VAR = T.let(T.unsafe(nil), String) -# Common functionality for primitive numeric nodes: `int`, `float`, ... +# Common functionality for primitive numeric nodes: `int`, `float`, `rational`... # # source://rubocop-ast/lib/rubocop/ast/node/mixin/numeric_node.rb#6 module RuboCop::AST::NumericNode @@ -5528,22 +5656,34 @@ class RuboCop::AST::OpAsgnNode < ::RuboCop::AST::Node # # @return [Node] the expression being assigned. # - # source://rubocop-ast/lib/rubocop/ast/node/op_asgn_node.rb#31 + # source://rubocop-ast/lib/rubocop/ast/node/op_asgn_node.rb#32 def expression; end + # @return [AsgnNode] the assignment node + # + # source://rubocop-ast/lib/rubocop/ast/node/op_asgn_node.rb#10 + def lhs; end + # The name of the variable being assigned as a symbol. # # @return [Symbol] the name of the variable being assigned # - # source://rubocop-ast/lib/rubocop/ast/node/op_asgn_node.rb#17 + # source://rubocop-ast/lib/rubocop/ast/node/op_asgn_node.rb#18 def name; end # The operator being used for assignment as a symbol. # # @return [Symbol] the assignment operator # - # source://rubocop-ast/lib/rubocop/ast/node/op_asgn_node.rb#24 + # source://rubocop-ast/lib/rubocop/ast/node/op_asgn_node.rb#25 def operator; end + + # The expression being assigned to the variable. + # + # @return [Node] the expression being assigned. + # + # source://rubocop-ast/lib/rubocop/ast/node/op_asgn_node.rb#32 + def rhs; end end # A node extension for `op_asgn` nodes. @@ -5832,42 +5972,42 @@ end # and other information such as disabled lines for cops. # It also provides a convenient way to access source lines. # -# source://rubocop-ast/lib/rubocop/ast/processed_source.rb#11 +# source://rubocop-ast/lib/rubocop/ast/processed_source.rb#10 class RuboCop::AST::ProcessedSource # @return [ProcessedSource] a new instance of ProcessedSource # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#29 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#28 def initialize(source, ruby_version, path = T.unsafe(nil), parser_engine: T.unsafe(nil)); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#73 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#72 def [](*args); end # Returns the value of attribute ast. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def ast; end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#51 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#50 def ast_with_comments; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#112 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#111 def blank?; end # Returns the value of attribute buffer. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def buffer; end # Raw source checksum for tracking infinite loops. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#84 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#83 def checksum; end # @return [Comment, nil] the comment at that line, if any. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#117 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#116 def comment_at_line(line); end # Consider using `each_comment_in_lines` instead @@ -5875,181 +6015,181 @@ class RuboCop::AST::ProcessedSource # @deprecated use contains_comment? # @return [Boolean] if any of the lines in the given `source_range` has a comment. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#139 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#138 def commented?(source_range); end # Returns the value of attribute comments. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def comments; end # Should have been called `comments_before_or_at_line`. Doubtful it has of any valid use. # # @deprecated Use `each_comment_in_lines` # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#147 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#146 def comments_before_line(line); end # Consider using `each_comment_in_lines` instead # # @return [Boolean] if any of the lines in the given `source_range` has a comment. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#139 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#138 def contains_comment?(source_range); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#161 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#160 def current_line(token); end # Returns the value of attribute diagnostics. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def diagnostics; end # @deprecated Use `comments.each` # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#89 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#88 def each_comment(&block); end # Enumerates on the comments contained with the given `line_range` # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#127 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#126 def each_comment_in_lines(line_range); end # @deprecated Use `tokens.each` # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#99 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#98 def each_token(&block); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#108 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#107 def file_path; end # @deprecated Use `comment_at_line`, `each_comment_in_lines`, or `comments.find` # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#94 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#93 def find_comment(&block); end # @deprecated Use `tokens.find` # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#104 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#103 def find_token(&block); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#182 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#181 def first_token_of(range_or_node); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#165 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#164 def following_line(token); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#186 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#185 def last_token_of(range_or_node); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#169 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#168 def line_indentation(line_number); end # @return [Boolean] if the given line number has a comment. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#122 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#121 def line_with_comment?(line); end # Returns the source lines, line break characters removed, excluding a # possible __END__ and everything that comes after. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#59 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#58 def lines; end # Returns the value of attribute parser_engine. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def parser_engine; end # Returns the value of attribute parser_error. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def parser_error; end # Returns the value of attribute path. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def path; end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#157 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#156 def preceding_line(token); end # Returns the value of attribute raw_source. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def raw_source; end # Returns the value of attribute ruby_version. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def ruby_version; end # The tokens list is always sorted by token position, except for cases when heredoc # is passed as a method argument. In this case tokens are interleaved by # heredoc contents' tokens. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#193 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#192 def sorted_tokens; end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#151 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#150 def start_with?(string); end # Returns the value of attribute tokens. # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#21 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#20 def tokens; end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#176 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#175 def tokens_within(range_or_node); end # @return [Boolean] # - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#77 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#76 def valid_syntax?; end private - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#200 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#199 def comment_index; end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#312 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#309 def create_parser(ruby_version, parser_engine); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#328 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#325 def first_token_index(range_or_node); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#333 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#330 def last_token_index(range_or_node); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#206 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#205 def parse(source, ruby_version, parser_engine); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#240 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#238 def parser_class(ruby_version, parser_engine); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#338 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#335 def source_range(range_or_node); end - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#223 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#222 def tokenize(parser); end class << self - # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#24 + # source://rubocop-ast/lib/rubocop/ast/processed_source.rb#23 def from_file(path, ruby_version, parser_engine: T.unsafe(nil)); end end end -# source://rubocop-ast/lib/rubocop/ast/processed_source.rb#15 +# source://rubocop-ast/lib/rubocop/ast/processed_source.rb#14 RuboCop::AST::ProcessedSource::INVALID_LEVELS = T.let(T.unsafe(nil), Array) -# source://rubocop-ast/lib/rubocop/ast/processed_source.rb#18 +# source://rubocop-ast/lib/rubocop/ast/processed_source.rb#17 RuboCop::AST::ProcessedSource::PARSER_ENGINES = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop-ast/lib/rubocop/ast/processed_source.rb#13 +# source://rubocop-ast/lib/rubocop/ast/processed_source.rb#12 RuboCop::AST::ProcessedSource::STRING_SOURCE_NAME = T.let(T.unsafe(nil), String) # A node extension for `irange` and `erange` nodes. This will be used in @@ -6065,6 +6205,16 @@ class RuboCop::AST::RangeNode < ::RuboCop::AST::Node def end; end end +# A node extension for `rational` nodes. This will be used in place of a plain +# node when the builder constructs the AST, making its methods available to +# all `rational` nodes within RuboCop. +# +# source://rubocop-ast/lib/rubocop/ast/node/rational_node.rb#8 +class RuboCop::AST::RationalNode < ::RuboCop::AST::Node + include ::RuboCop::AST::BasicLiteralNode + include ::RuboCop::AST::NumericNode +end + # A node extension for `regexp` nodes. This will be used in place of a plain # node when the builder constructs the AST, making its methods available # to all `regexp` nodes within RuboCop. @@ -7007,6 +7157,18 @@ class RuboCop::AST::UntilNode < ::RuboCop::AST::Node def keyword; end end +# A node extension for `lvar`, `ivar`, `cvar` and `gvar` nodes. +# This will be used in place of a plain node when the builder constructs +# the AST, making its methods available to all assignment nodes within RuboCop. +# +# source://rubocop-ast/lib/rubocop/ast/node/var_node.rb#8 +class RuboCop::AST::VarNode < ::RuboCop::AST::Node + # @return [Symbol] The name of the variable. + # + # source://rubocop-ast/lib/rubocop/ast/node/var_node.rb#10 + def name; end +end + # source://rubocop-ast/lib/rubocop/ast/version.rb#5 module RuboCop::AST::Version; end @@ -7106,3 +7268,340 @@ class RuboCop::AST::YieldNode < ::RuboCop::AST::Node # source://rubocop-ast/lib/rubocop/ast/node/yield_node.rb#16 def node_parts; end end + +class RuboCop::CommentConfig + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#34 + def initialize(processed_source); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#63 + def comment_only_line?(line_number); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def config(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#51 + def cop_disabled_line_ranges; end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#39 + def cop_enabled_at_line?(cop, line_number); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#47 + def cop_opted_in?(cop); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#55 + def extra_enabled_comments; end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#30 + def processed_source; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def registry(*_arg0, **_arg1, &_arg2); end + + private + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#96 + def analyze; end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#124 + def analyze_cop(analysis, directive); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#144 + def analyze_disabled(analysis, directive); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#155 + def analyze_rest(analysis, directive); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#135 + def analyze_single_line(analysis, directive); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#164 + def cop_line_ranges(analysis); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#170 + def each_directive; end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#69 + def extra_enabled_comments_with_names(extras:, names:); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#190 + def handle_enable_all(directive, names, extras); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#204 + def handle_switch(directive, names, extras); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#115 + def inject_disabled_cops_directives(analyses); end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#183 + def non_comment_token_line_numbers; end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#83 + def opt_in_cops; end + + # source://rubocop/1.68.0lib/rubocop/comment_config.rb#179 + def qualified_cop_name(cop_name); end +end + +class RuboCop::Config + # source://rubocop/1.68.0lib/rubocop/config.rb#30 + def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def [](*_arg0, **_arg1, &_arg2); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def []=(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#170 + def active_support_extensions_enabled?; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#96 + def add_excludes_from_higher_level(highest_config); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#197 + def allowed_camel_case_file?(file); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#241 + def base_dir_for_path_parameters; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#271 + def bundler_lock_file_path; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#51 + def check; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#142 + def clusivity_config_for_badge?(badge); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def delete(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#108 + def deprecation_check; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def dig(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#162 + def disabled_new_cops?; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each(*_arg0, **_arg1, &_arg2); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each_key(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#166 + def enabled_new_cops?; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def fetch(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#219 + def file_to_exclude?(file); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#178 + def file_to_include?(file); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#158 + def for_all_cops; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#128 + def for_badge(badge); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#122 + def for_cop(cop); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#153 + def for_department(department_name); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#296 + def gem_versions_in_target; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#300 + def inspect; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#76 + def internal?; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def key?(*_arg0, **_arg1, &_arg2); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def keys(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#47 + def loaded_features; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#20 + def loaded_path; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#81 + def make_excludes_absolute; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def map(*_arg0, **_arg1, &_arg2); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def merge(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#251 + def parser_engine; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#232 + def path_relative_to_config(path); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#228 + def patterns_to_exclude; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#224 + def patterns_to_include; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#282 + def pending_cops; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#211 + def possibly_include_hidden?; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def replace(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#71 + def signature; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#266 + def smart_loaded_path; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#174 + def string_literals_frozen_by_default?; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#255 + def target_rails_version; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def target_ruby_version(*_arg0, **_arg1, &_arg2); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_h(*_arg0, **_arg1, &_arg2); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_hash(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#67 + def to_s; end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def transform_values(*_arg0, **_arg1, &_arg2); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def validate(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#58 + def validate_after_resolution; end + + private + + # source://rubocop/1.68.0lib/rubocop/config.rb#350 + def department_of(qualified_cop_name); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#338 + def enable_cop?(qualified_cop_name, cop_options); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#325 + def gem_version_to_major_minor_float(gem_version); end + + # source://rubocop/1.68.0lib/rubocop/config.rb#331 + def read_gem_versions_from_target_lockfile; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#312 + def read_rails_version_from_bundler_lock_file; end + + # source://rubocop/1.68.0lib/rubocop/config.rb#307 + def target_rails_version_from_bundler_lock_file; end + + class << self + # source://rubocop/1.68.0lib/rubocop/config.rb#22 + def create(hash, path, check: T.unsafe(nil)); end + end +end + +class RuboCop::ConfigValidator + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#27 + def initialize(config); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def for_all_cops(*_arg0, **_arg1, &_arg2); end + + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def smart_loaded_path(*_arg0, **_arg1, &_arg2); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#63 + def target_ruby_version; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#33 + def validate; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#59 + def validate_after_resolution; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#67 + def validate_section_presence(name); end + + private + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#104 + def alert_about_unrecognized_cops(invalid_cop_names); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#254 + def check_cop_config_value(hash, parent = T.unsafe(nil)); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#77 + def check_obsoletions; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#84 + def check_target_ruby; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#195 + def each_invalid_parameter(cop_name); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#120 + def list_unknown_cops(invalid_cop_names); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#274 + def param_error_message(parent, key, value, supposed_values); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#242 + def reject_conflicting_safe_settings; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#233 + def reject_mutually_exclusive_defaults; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#142 + def suggestion(name); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#75 + def target_ruby; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#207 + def validate_enforced_styles(valid_cop_names); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#169 + def validate_new_cops_parameter; end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#180 + def validate_parameter_names(valid_cop_names); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#227 + def validate_support_and_has_list(name, formats, valid); end + + # source://rubocop/1.68.0lib/rubocop/config_validator.rb#158 + def validate_syntax_cop; end +end + +# Similar to `Forwardable#def_delegators`, but simpler & faster +# +# source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#5 +module RuboCop::SimpleForwardable + # source://rubocop-ast/lib/rubocop/ast/utilities/simple_forwardable.rb#6 + def def_delegators(accessor, *methods); end +end diff --git a/sorbet/rbi/gems/rubocop-minitest@0.35.0.rbi b/sorbet/rbi/gems/rubocop-minitest@0.36.0.rbi similarity index 99% rename from sorbet/rbi/gems/rubocop-minitest@0.35.0.rbi rename to sorbet/rbi/gems/rubocop-minitest@0.36.0.rbi index 24b99556..ff6ba62c 100644 --- a/sorbet/rbi/gems/rubocop-minitest@0.35.0.rbi +++ b/sorbet/rbi/gems/rubocop-minitest@0.36.0.rbi @@ -1267,33 +1267,35 @@ RuboCop::Cop::Minitest::LiteralAsActualArgument::RESTRICT_ON_SEND = T.let(T.unsa # # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#30 class RuboCop::Cop::Minitest::MultipleAssertions < ::RuboCop::Cop::Base - include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::VisibilityHelp include ::RuboCop::Cop::DefNode include ::RuboCop::Cop::MinitestExplorationHelpers - # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#36 + # source://rubocop/1.68.0lib/rubocop/cop/exclude_limit.rb#11 + def max=(value); end + + # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#37 def on_class(class_node); end private - # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#53 + # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#54 def assertions_count(node); end - # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#61 + # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#62 def assertions_count_based_on_type(node); end - # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#76 + # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#77 def assertions_count_in_assignment(node); end - # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#94 + # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#99 def assertions_count_in_branches(branches); end - # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#98 + # source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#103 def max_assertions; end end -# source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#34 +# source://rubocop-minitest/lib/rubocop/cop/minitest/multiple_assertions.rb#33 RuboCop::Cop::Minitest::MultipleAssertions::MSG = T.let(T.unsafe(nil), String) # Common functionality for `AssertNil` and `RefuteNil` cops. @@ -2196,12 +2198,12 @@ class RuboCop::Cop::Minitest::SkipEnsure < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop-minitest/lib/rubocop/cop/minitest/skip_ensure.rb#81 + # source://rubocop-minitest/lib/rubocop/cop/minitest/skip_ensure.rb#83 def use_skip_in_rescue?(skip_method); end # @return [Boolean] # - # source://rubocop-minitest/lib/rubocop/cop/minitest/skip_ensure.rb#85 + # source://rubocop-minitest/lib/rubocop/cop/minitest/skip_ensure.rb#87 def valid_conditional_skip?(skip_method, ensure_node); end end diff --git a/sorbet/rbi/gems/rubocop-sorbet@0.8.3.rbi b/sorbet/rbi/gems/rubocop-sorbet@0.8.7.rbi similarity index 91% rename from sorbet/rbi/gems/rubocop-sorbet@0.8.3.rbi rename to sorbet/rbi/gems/rubocop-sorbet@0.8.7.rbi index 4c55d3c0..2df1fb7a 100644 --- a/sorbet/rbi/gems/rubocop-sorbet@0.8.3.rbi +++ b/sorbet/rbi/gems/rubocop-sorbet@0.8.7.rbi @@ -231,7 +231,7 @@ RuboCop::Cop::Sorbet::CallbackConditionalsBinding::RESTRICT_ON_SEND = T.let(T.un # sig { void } # # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#19 -class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Cop +class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::Sorbet::SignatureHelp @@ -276,6 +276,9 @@ RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), Str # # 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_csend(node); end + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/constants_from_strings.rb#46 def on_send(node); end end @@ -322,10 +325,12 @@ end # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#22 RuboCop::Cop::Sorbet::EmptyLineAfterSig::MSG = T.let(T.unsafe(nil), String) -# Checks that the Sorbet sigil comes as the first magic comment in the file. +# Checks that the Sorbet sigil comes as the first magic comment in the file, after the encoding comment if any. # # The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal. # +# The ordering is for consistency only, except for the encoding comment which must be first, if present. +# # For example, the following bad ordering: # # ```ruby @@ -341,42 +346,42 @@ RuboCop::Cop::Sorbet::EmptyLineAfterSig::MSG = T.let(T.unsafe(nil), String) # Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered, # other comments or magic comments are left in the same place. # -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#30 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#32 class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil include ::RuboCop::Cop::RangeHelp - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#42 - def autocorrect(_node); end - - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#33 - def investigate(processed_source); end + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#35 + def on_new_investigation; end protected + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#93 + def autocorrect(corrector); end + # checks # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#92 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70 def check_magic_comments_order(tokens); end # Get all the tokens in `processed_source` that match `MAGIC_REGEX` # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#84 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#62 def extract_magic_comments(processed_source); end end -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#68 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#46 RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp) -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#48 RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp) -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#69 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#47 RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp) -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#79 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#57 RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp) -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#72 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#50 RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash) # Checks that every method definition and attribute accessor has a Sorbet signature. @@ -400,87 +405,88 @@ RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), # * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped') # # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#27 -class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Cop +class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Base include ::RuboCop::Cop::Sorbet::SignatureHelp + extend ::RuboCop::Cop::AutoCorrector # @return [EnforceSignatures] a new instance of EnforceSignatures # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#30 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#31 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#36 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#37 def accessor?(param0 = T.unsafe(nil)); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#56 - def autocorrect(node); end - - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#40 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#41 def on_def(node); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#44 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#45 def on_defs(node); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#48 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#49 def on_send(node); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#52 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#53 def on_signature(node); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#75 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#57 def scope(node); end private - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#84 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#79 + def autocorrect(corrector, node); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#66 def check_node(node); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#95 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#96 def param_type_placeholder; end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#99 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#100 def return_type_placeholder; end end -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#103 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion # @return [SigSuggestion] a new instance of SigSuggestion # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#106 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#107 def initialize(indent, param_placeholder, return_placeholder); end # Returns the value of attribute params. # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105 def params; end # Sets the attribute params # # @param value the value to set the attribute params to. # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105 def params=(_arg0); end # Returns the value of attribute returns. # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105 def returns; end # Sets the attribute returns # # @param value the value to set the attribute returns to. # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105 def returns=(_arg0); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#114 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#115 def to_autocorrect; end private - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#126 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#127 def generate_params; end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#138 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#139 def generate_return; end end @@ -504,15 +510,15 @@ end class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil include ::RuboCop::Cop::RangeHelp - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#40 - def autocorrect(_node); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#29 - def investigate(processed_source); end + def on_new_investigation; end protected - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#56 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#50 + def autocorrect(corrector); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#44 def extract_all_sigils(processed_source); end end @@ -667,15 +673,15 @@ RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::RESTRICT_ON_SEND = T.let(T.unsa # # sorbet/rbi/any/path/for/file.rbi # # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#23 -class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Cop +class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#26 - def investigate(processed_source); end + def on_new_investigation; end private - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#58 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#48 def allowed_paths; end end @@ -996,6 +1002,25 @@ end # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26 RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String) +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#6 +module RuboCop::Cop::Sorbet::GemVersionAnnotationHelper + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#9 + def gem_version_annotations; end + + private + + # @return [Boolean] + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#17 + def gem_version_annotation?(comment); end + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#21 + def gem_versions(comment); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#7 +RuboCop::Cop::Sorbet::GemVersionAnnotationHelper::VERSION_PREFIX = T.let(T.unsafe(nil), String) + # Makes the Sorbet typed sigil mandatory in all files. # # Options: @@ -1009,7 +1034,7 @@ RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), Strin class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil # @return [Boolean] # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/has_sigil.rb#20 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/has_sigil.rb#18 def require_sigil_on_all_files?; end end @@ -1084,7 +1109,7 @@ RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsaf # def foo(b:, a: 1); end # # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#20 -class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Cop +class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Base include ::RuboCop::Cop::Sorbet::SignatureHelp # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23 @@ -1232,6 +1257,46 @@ RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String) # source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#33 RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +# Checks for the use of Ruby Refinements library. Refinements add +# complexity and incur a performance penalty that can be significant +# for large code bases. Good examples are cases of unrelated +# methods that happen to have the same name as these module methods. +# +# @example +# # bad +# module Foo +# refine(Date) do +# end +# end +# +# # bad +# module Foo +# using(Date) do +# end +# end +# +# # good +# module Foo +# bar.refine(Date) +# end +# +# # good +# module Foo +# bar.using(Date) +# end +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/refinement.rb#34 +class RuboCop::Cop::Sorbet::Refinement < ::RuboCop::Cop::Base + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/refinement.rb#38 + def on_send(node); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/refinement.rb#35 +RuboCop::Cop::Sorbet::Refinement::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/refinement.rb#36 +RuboCop::Cop::Sorbet::Refinement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks for the correct order of `sig` builder methods. # # Options: @@ -1445,6 +1510,42 @@ end # source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#18 RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String) +# Checks that gem versions in RBI annotations are properly formatted per the Bundler gem specification. +# +# @example +# # bad +# # @version > not a version number +# +# # good +# # @version = 1 +# +# # good +# # @version > 1.2.3 +# +# # good +# # @version <= 4.3-preview +# +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#21 +class RuboCop::Cop::Sorbet::ValidGemVersionAnnotations < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Sorbet::GemVersionAnnotationHelper + + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#27 + def on_new_investigation; end + + private + + # @return [Boolean] + # + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#50 + def valid_version?(version_string); end +end + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#24 +RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#25 +RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::VALID_OPERATORS = T.let(T.unsafe(nil), Array) + # Checks that every Ruby file contains a valid Sorbet sigil. # Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52 # @@ -1459,69 +1560,69 @@ RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String) # Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect. # # 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#36 - def autocorrect(_node); end +class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector - # So we can properly subclass this cop - # # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#23 - def investigate(processed_source); end + def on_new_investigation; end protected + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#150 + def autocorrect(corrector); end + # checks # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#71 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#55 def check_sigil_present(sigil); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#131 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#118 def check_strictness_level(sigil, strictness); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#109 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#94 def check_strictness_not_empty(sigil, strictness); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#120 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#106 def check_strictness_valid(sigil, strictness); end # Default is `nil` # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#181 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#184 def exact_strictness; end # extraction # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#59 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#43 def extract_sigil(processed_source); end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#65 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#49 def extract_strictness(sigil); end # Default is `nil` # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#175 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#178 def minimum_strictness; end # Default is `false` # # @return [Boolean] # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#164 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#167 def require_sigil_on_all_files?; end # Default is `'false'` # - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#169 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#172 def suggested_strictness; end - # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#87 + # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#72 def suggested_strictness_level; end end -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#55 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#39 RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp) -# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#54 +# source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#38 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.63.4.rbi b/sorbet/rbi/gems/rubocop@1.68.0.rbi similarity index 93% rename from sorbet/rbi/gems/rubocop@1.63.4.rbi rename to sorbet/rbi/gems/rubocop@1.68.0.rbi index ad579d72..6bdef711 100644 --- a/sorbet/rbi/gems/rubocop@1.63.4.rbi +++ b/sorbet/rbi/gems/rubocop@1.68.0.rbi @@ -98,44 +98,44 @@ class RuboCop::CLI private - # source://rubocop/lib/rubocop/cli.rb#152 + # source://rubocop/lib/rubocop/cli.rb#156 def act_on_options; end - # source://rubocop/lib/rubocop/cli.rb#194 + # source://rubocop/lib/rubocop/cli.rb#198 def apply_default_formatter; end - # source://rubocop/lib/rubocop/cli.rb#121 + # source://rubocop/lib/rubocop/cli.rb#125 def execute_runners; end - # source://rubocop/lib/rubocop/cli.rb#178 + # source://rubocop/lib/rubocop/cli.rb#182 def handle_editor_mode; end # @raise [Finished] # - # source://rubocop/lib/rubocop/cli.rb#183 + # source://rubocop/lib/rubocop/cli.rb#187 def handle_exiting_options; end - # source://rubocop/lib/rubocop/cli.rb#140 + # source://rubocop/lib/rubocop/cli.rb#144 def parallel_by_default!; end - # source://rubocop/lib/rubocop/cli.rb#76 + # source://rubocop/lib/rubocop/cli.rb#80 def profile_if_needed; end - # source://rubocop/lib/rubocop/cli.rb#109 + # source://rubocop/lib/rubocop/cli.rb#113 def require_gem(name); end - # source://rubocop/lib/rubocop/cli.rb#117 + # source://rubocop/lib/rubocop/cli.rb#121 def run_command(name); end - # source://rubocop/lib/rubocop/cli.rb#170 + # source://rubocop/lib/rubocop/cli.rb#174 def set_options_to_config_loader; end - # source://rubocop/lib/rubocop/cli.rb#129 + # source://rubocop/lib/rubocop/cli.rb#133 def suggest_extensions; end # @raise [OptionArgumentError] # - # source://rubocop/lib/rubocop/cli.rb#133 + # source://rubocop/lib/rubocop/cli.rb#137 def validate_options_vs_config; end end @@ -222,12 +222,6 @@ class RuboCop::CLI::Command::AutoGenerateConfig < ::RuboCop::CLI::Command::Base # source://rubocop/lib/rubocop/cli/command/auto_generate_config.rb#73 def only_exclude?; end - # @api private - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cli/command/auto_generate_config.rb#162 - def options_config_in_root?; end - # @api private # @return [Boolean] # @@ -440,11 +434,11 @@ RuboCop::CLI::Command::InitDotfile::DOTFILE = T.let(T.unsafe(nil), String) # # @api private # -# source://rubocop/lib/rubocop/cli/command/lsp.rb#10 +# source://rubocop/lib/rubocop/cli/command/lsp.rb#8 class RuboCop::CLI::Command::LSP < ::RuboCop::CLI::Command::Base # @api private # - # source://rubocop/lib/rubocop/cli/command/lsp.rb#13 + # source://rubocop/lib/rubocop/cli/command/lsp.rb#11 def run; end end @@ -747,8 +741,8 @@ class RuboCop::CachedData # @api private # - # source://rubocop/lib/rubocop/cached_data.rb#56 - def location_from_source_buffer(offense, source_buffer); end + # source://rubocop/lib/rubocop/cached_data.rb#54 + def location_from_source_buffer(offense); end # @api private # @@ -759,13 +753,22 @@ class RuboCop::CachedData # # source://rubocop/lib/rubocop/cached_data.rb#23 def serialize_offense(offense); end + + # Delay creation until needed. Some type of offenses will have no buffer associated with them + # and be global only. For these, trying to create the buffer will likely fail, for example + # because of unknown encoding comments. + # + # @api private + # + # source://rubocop/lib/rubocop/cached_data.rb#67 + def source_buffer; end end # and provides a way to check if each cop is enabled at arbitrary line. # # source://rubocop/lib/rubocop/comment_config.rb#6 class RuboCop::CommentConfig - extend ::Forwardable + extend ::RuboCop::SimpleForwardable # @return [CommentConfig] a new instance of CommentConfig # @@ -777,8 +780,8 @@ class RuboCop::CommentConfig # source://rubocop/lib/rubocop/comment_config.rb#63 def comment_only_line?(line_number); end - # source://forwardable/1.3.3forwardable.rb#231 - def config(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def config(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/comment_config.rb#51 def cop_disabled_line_ranges; end @@ -801,8 +804,8 @@ class RuboCop::CommentConfig # source://rubocop/lib/rubocop/comment_config.rb#30 def processed_source; end - # source://forwardable/1.3.3forwardable.rb#231 - def registry(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def registry(*_arg0, **_arg1, &_arg2); end private @@ -970,18 +973,18 @@ end class RuboCop::Config include ::RuboCop::PathUtil include ::RuboCop::FileFinder - extend ::Forwardable + extend ::RuboCop::SimpleForwardable # @return [Config] a new instance of Config # # source://rubocop/lib/rubocop/config.rb#30 def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end - # source://forwardable/1.3.3forwardable.rb#231 - def [](*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def [](*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def []=(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def []=(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # @@ -993,7 +996,7 @@ class RuboCop::Config # @return [Boolean] # - # source://rubocop/lib/rubocop/config.rb#193 + # source://rubocop/lib/rubocop/config.rb#197 def allowed_camel_case_file?(file); end # Paths specified in configuration files starting with .rubocop are @@ -1002,12 +1005,12 @@ class RuboCop::Config # config/default.yml, for example, are not relative to RuboCop's config # directory since that wouldn't work. # - # source://rubocop/lib/rubocop/config.rb#237 + # source://rubocop/lib/rubocop/config.rb#241 def base_dir_for_path_parameters; end # @return [String, nil] # - # source://rubocop/lib/rubocop/config.rb#267 + # source://rubocop/lib/rubocop/config.rb#271 def bundler_lock_file_path; end # source://rubocop/lib/rubocop/config.rb#51 @@ -1019,42 +1022,42 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#142 def clusivity_config_for_badge?(badge); end - # source://forwardable/1.3.3forwardable.rb#231 - def delete(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def delete(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#108 def deprecation_check; end - # source://forwardable/1.3.3forwardable.rb#231 - def dig(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def dig(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # # source://rubocop/lib/rubocop/config.rb#162 def disabled_new_cops?; end - # source://forwardable/1.3.3forwardable.rb#231 - def each(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def each_key(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def each_key(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # # source://rubocop/lib/rubocop/config.rb#166 def enabled_new_cops?; end - # source://forwardable/1.3.3forwardable.rb#231 - def fetch(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def fetch(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # - # source://rubocop/lib/rubocop/config.rb#215 + # source://rubocop/lib/rubocop/config.rb#219 def file_to_exclude?(file); end # @return [Boolean] # - # source://rubocop/lib/rubocop/config.rb#174 + # source://rubocop/lib/rubocop/config.rb#178 def file_to_include?(file); end # source://rubocop/lib/rubocop/config.rb#158 @@ -1085,10 +1088,10 @@ class RuboCop::Config # Returns target's locked gem versions (i.e. from Gemfile.lock or gems.locked) # - # source://rubocop/lib/rubocop/config.rb#292 + # source://rubocop/lib/rubocop/config.rb#296 def gem_versions_in_target; end - # source://rubocop/lib/rubocop/config.rb#296 + # source://rubocop/lib/rubocop/config.rb#300 def inspect; end # True if this is a config file that is shipped with RuboCop @@ -1098,11 +1101,11 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#76 def internal?; end - # source://forwardable/1.3.3forwardable.rb#231 - def key?(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def key?(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def keys(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def keys(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#47 def loaded_features; end @@ -1115,25 +1118,25 @@ class RuboCop::Config # source://rubocop/lib/rubocop/config.rb#81 def make_excludes_absolute; end - # source://forwardable/1.3.3forwardable.rb#231 - def map(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def map(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def merge(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def merge(*_arg0, **_arg1, &_arg2); end - # source://rubocop/lib/rubocop/config.rb#247 + # source://rubocop/lib/rubocop/config.rb#251 def parser_engine; end - # source://rubocop/lib/rubocop/config.rb#228 + # source://rubocop/lib/rubocop/config.rb#232 def path_relative_to_config(path); end - # source://rubocop/lib/rubocop/config.rb#224 + # source://rubocop/lib/rubocop/config.rb#228 def patterns_to_exclude; end - # source://rubocop/lib/rubocop/config.rb#220 + # source://rubocop/lib/rubocop/config.rb#224 def patterns_to_include; end - # source://rubocop/lib/rubocop/config.rb#278 + # source://rubocop/lib/rubocop/config.rb#282 def pending_cops; end # Returns true if there's a chance that an Include pattern matches hidden @@ -1141,69 +1144,74 @@ class RuboCop::Config # # @return [Boolean] # - # source://rubocop/lib/rubocop/config.rb#207 + # source://rubocop/lib/rubocop/config.rb#211 def possibly_include_hidden?; end - # source://forwardable/1.3.3forwardable.rb#231 - def replace(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def replace(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#71 def signature; end - # source://rubocop/lib/rubocop/config.rb#262 + # source://rubocop/lib/rubocop/config.rb#266 def smart_loaded_path; end - # source://rubocop/lib/rubocop/config.rb#251 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/config.rb#174 + def string_literals_frozen_by_default?; end + + # source://rubocop/lib/rubocop/config.rb#255 def target_rails_version; end - # source://forwardable/1.3.3forwardable.rb#231 - def target_ruby_version(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def target_ruby_version(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_h(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_h(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def to_hash(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def to_hash(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#67 def to_s; end - # source://forwardable/1.3.3forwardable.rb#231 - def transform_values(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def transform_values(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def validate(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def validate(*_arg0, **_arg1, &_arg2); end # source://rubocop/lib/rubocop/config.rb#58 def validate_after_resolution; end private - # source://rubocop/lib/rubocop/config.rb#347 + # source://rubocop/lib/rubocop/config.rb#350 def department_of(qualified_cop_name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/config.rb#335 + # source://rubocop/lib/rubocop/config.rb#338 def enable_cop?(qualified_cop_name, cop_options); end # @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 + # source://rubocop/lib/rubocop/config.rb#325 def gem_version_to_major_minor_float(gem_version); end - # source://rubocop/lib/rubocop/config.rb#328 + # source://rubocop/lib/rubocop/config.rb#331 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 + # source://rubocop/lib/rubocop/config.rb#312 def read_rails_version_from_bundler_lock_file; end # @return [Float, nil] The Rails version as a `major.minor` Float. # - # source://rubocop/lib/rubocop/config.rb#303 + # source://rubocop/lib/rubocop/config.rb#307 def target_rails_version_from_bundler_lock_file; end class << self @@ -1520,10 +1528,10 @@ class RuboCop::ConfigLoader def resolver; end # source://rubocop/lib/rubocop/config_loader.rb#238 - def yaml_safe_load(yaml_code, filename); end + def yaml_tree_to_hash(yaml_tree); end # source://rubocop/lib/rubocop/config_loader.rb#248 - def yaml_safe_load!(yaml_code, filename); end + def yaml_tree_to_hash!(yaml_tree); end end end @@ -1630,12 +1638,12 @@ class RuboCop::ConfigLoaderResolver # @api private # - # source://rubocop/lib/rubocop/config_loader_resolver.rb#268 + # source://rubocop/lib/rubocop/config_loader_resolver.rb#267 def gem_config_path(gem_name, relative_config_path); end # @api private # - # source://rubocop/lib/rubocop/config_loader_resolver.rb#246 + # source://rubocop/lib/rubocop/config_loader_resolver.rb#245 def handle_disabled_by_default(config, new_default_configuration); end # @api private @@ -1675,7 +1683,7 @@ class RuboCop::ConfigLoaderResolver # @api private # - # source://rubocop/lib/rubocop/config_loader_resolver.rb#264 + # source://rubocop/lib/rubocop/config_loader_resolver.rb#263 def transform(config, &block); end # @api private @@ -2257,23 +2265,23 @@ end # # source://rubocop/lib/rubocop/config_validator.rb#6 class RuboCop::ConfigValidator - extend ::Forwardable + extend ::RuboCop::SimpleForwardable # @return [ConfigValidator] a new instance of ConfigValidator # - # source://rubocop/lib/rubocop/config_validator.rb#26 + # source://rubocop/lib/rubocop/config_validator.rb#27 def initialize(config); end - # source://forwardable/1.3.3forwardable.rb#231 - def for_all_cops(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def for_all_cops(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def smart_loaded_path(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def smart_loaded_path(*_arg0, **_arg1, &_arg2); end - # source://rubocop/lib/rubocop/config_validator.rb#62 + # source://rubocop/lib/rubocop/config_validator.rb#63 def target_ruby_version; end - # source://rubocop/lib/rubocop/config_validator.rb#32 + # source://rubocop/lib/rubocop/config_validator.rb#33 def validate; end # Validations that should only be run after all config resolving has @@ -2282,76 +2290,76 @@ class RuboCop::ConfigValidator # chain has been loaded so that only the final value is validated, and # any obsolete but overridden values are ignored. # - # source://rubocop/lib/rubocop/config_validator.rb#58 + # source://rubocop/lib/rubocop/config_validator.rb#59 def validate_after_resolution; end # @raise [ValidationError] # - # source://rubocop/lib/rubocop/config_validator.rb#66 + # source://rubocop/lib/rubocop/config_validator.rb#67 def validate_section_presence(name); end private # @raise [ValidationError] # - # source://rubocop/lib/rubocop/config_validator.rb#103 + # source://rubocop/lib/rubocop/config_validator.rb#104 def alert_about_unrecognized_cops(invalid_cop_names); end - # source://rubocop/lib/rubocop/config_validator.rb#253 + # source://rubocop/lib/rubocop/config_validator.rb#254 def check_cop_config_value(hash, parent = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/config_validator.rb#76 + # source://rubocop/lib/rubocop/config_validator.rb#77 def check_obsoletions; end # @raise [ValidationError] # - # source://rubocop/lib/rubocop/config_validator.rb#83 + # source://rubocop/lib/rubocop/config_validator.rb#84 def check_target_ruby; end - # source://rubocop/lib/rubocop/config_validator.rb#194 + # source://rubocop/lib/rubocop/config_validator.rb#195 def each_invalid_parameter(cop_name); end - # source://rubocop/lib/rubocop/config_validator.rb#119 + # source://rubocop/lib/rubocop/config_validator.rb#120 def list_unknown_cops(invalid_cop_names); end # FIXME: Handling colors in exception messages like this is ugly. # - # source://rubocop/lib/rubocop/config_validator.rb#273 + # source://rubocop/lib/rubocop/config_validator.rb#274 def param_error_message(parent, key, value, supposed_values); end - # source://rubocop/lib/rubocop/config_validator.rb#241 + # source://rubocop/lib/rubocop/config_validator.rb#242 def reject_conflicting_safe_settings; end # @raise [ValidationError] # - # source://rubocop/lib/rubocop/config_validator.rb#232 + # source://rubocop/lib/rubocop/config_validator.rb#233 def reject_mutually_exclusive_defaults; end - # source://rubocop/lib/rubocop/config_validator.rb#141 + # source://rubocop/lib/rubocop/config_validator.rb#142 def suggestion(name); end # Returns the value of attribute target_ruby. # - # source://rubocop/lib/rubocop/config_validator.rb#74 + # source://rubocop/lib/rubocop/config_validator.rb#75 def target_ruby; end - # source://rubocop/lib/rubocop/config_validator.rb#206 + # source://rubocop/lib/rubocop/config_validator.rb#207 def validate_enforced_styles(valid_cop_names); end # @raise [ValidationError] # - # source://rubocop/lib/rubocop/config_validator.rb#168 + # source://rubocop/lib/rubocop/config_validator.rb#169 def validate_new_cops_parameter; end - # source://rubocop/lib/rubocop/config_validator.rb#179 + # source://rubocop/lib/rubocop/config_validator.rb#180 def validate_parameter_names(valid_cop_names); end - # source://rubocop/lib/rubocop/config_validator.rb#226 + # source://rubocop/lib/rubocop/config_validator.rb#227 def validate_support_and_has_list(name, formats, valid); end # @raise [ValidationError] # - # source://rubocop/lib/rubocop/config_validator.rb#157 + # source://rubocop/lib/rubocop/config_validator.rb#158 def validate_syntax_cop; end end @@ -2360,25 +2368,25 @@ end # source://rubocop/lib/rubocop/config_validator.rb#10 RuboCop::ConfigValidator::COMMON_PARAMS = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/config_validator.rb#21 +# source://rubocop/lib/rubocop/config_validator.rb#22 RuboCop::ConfigValidator::CONFIG_CHECK_AUTOCORRECTS = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/config_validator.rb#20 +# source://rubocop/lib/rubocop/config_validator.rb#21 RuboCop::ConfigValidator::CONFIG_CHECK_DEPARTMENTS = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop/lib/rubocop/config_validator.rb#19 +# source://rubocop/lib/rubocop/config_validator.rb#20 RuboCop::ConfigValidator::CONFIG_CHECK_KEYS = T.let(T.unsafe(nil), Set) # @api private # -# source://rubocop/lib/rubocop/config_validator.rb#12 +# source://rubocop/lib/rubocop/config_validator.rb#13 RuboCop::ConfigValidator::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop/lib/rubocop/config_validator.rb#16 +# source://rubocop/lib/rubocop/config_validator.rb#17 RuboCop::ConfigValidator::NEW_COPS_VALUES = T.let(T.unsafe(nil), Array) # source://rubocop/lib/rubocop/cop/util.rb#4 @@ -2412,7 +2420,7 @@ module RuboCop::Cop::Alignment # source://rubocop/lib/rubocop/cop/mixin/alignment.rb#45 def each_bad_alignment(items, base_column); end - # @deprecated Use processed_source.comment_at_line(line) + # @deprecated Use processed_source.line_with_comment?(line) # # source://rubocop/lib/rubocop/cop/mixin/alignment.rb#69 def end_of_line_comment(line); end @@ -2425,7 +2433,7 @@ module RuboCop::Cop::Alignment # @api private # - # source://rubocop/lib/rubocop/cop/mixin/alignment.rb#74 + # source://rubocop/lib/rubocop/cop/mixin/alignment.rb#78 def register_offense(offense_node, message_node); end # @api public @@ -2461,7 +2469,7 @@ class RuboCop::Cop::AlignmentCorrector private - # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#124 + # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#113 def alignment_column(align_to); end # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#40 @@ -2486,7 +2494,7 @@ class RuboCop::Cop::AlignmentCorrector # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#75 def delimited_string_literal?(node); end - # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#110 + # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#99 def each_line(expr); end # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#60 @@ -2495,10 +2503,7 @@ class RuboCop::Cop::AlignmentCorrector # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#54 def inside_string_ranges(node); end - # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#99 - def remove(range, corrector); end - - # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#118 + # source://rubocop/lib/rubocop/cop/correctors/alignment_corrector.rb#107 def whitespace_range(node); end end end @@ -2538,21 +2543,20 @@ module RuboCop::Cop::AllowedMethods # @api public # - # source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#21 + # source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#27 def allowed_methods; end - # source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#29 + # source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#35 def cop_config_allowed_methods; end - # source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#33 + # source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#39 def cop_config_deprecated_values; end - # @api public # @deprecated Use allowed_method? instead # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#13 - def ignored_method?(name); end + # source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#18 + def ignored_method?; end end # This module encapsulates the ability to ignore certain lines when @@ -2567,31 +2571,31 @@ module RuboCop::Cop::AllowedPattern # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#10 def allowed_line?(line); end - # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#30 + # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#42 def allowed_patterns; end - # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#46 + # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#58 def cop_config_deprecated_methods_values; end - # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#40 + # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#52 def cop_config_patterns_values; end # @deprecated Use allowed_line? instead # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#10 - def ignored_line?(line); end + # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#21 + def ignored_line?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#23 + # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#29 def matches_allowed_pattern?(line); end - # @deprecated Use matches_allowed_pattern?? instead + # @deprecated Use matches_allowed_pattern? instead # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#23 - def matches_ignored_pattern?(line); end + # source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#34 + def matches_ignored_pattern?; end end # This module encapsulates the ability to allow certain receivers in a cop. @@ -2628,85 +2632,83 @@ RuboCop::Cop::AmbiguousCopName::MSG = T.let(T.unsafe(nil), String) # # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#6 class RuboCop::Cop::AnnotationComment - extend ::Forwardable - # @param comment [Parser::Source::Comment] # @param keywords [Array<String>] # @return [AnnotationComment] a new instance of AnnotationComment # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#13 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#11 def initialize(comment, keywords); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#19 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#17 def annotation?; end # Returns the range bounds for just the annotation # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#31 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#29 def bounds; end # Returns the value of attribute colon. # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#9 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#7 def colon; end # Returns the value of attribute comment. # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#9 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#7 def comment; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#23 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#21 def correct?(colon:); end # Returns the value of attribute keyword. # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#9 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#7 def keyword; end # Returns the value of attribute margin. # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#9 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#7 def margin; end # Returns the value of attribute note. # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#9 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#7 def note; end # Returns the value of attribute space. # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#9 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#7 def space; end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#67 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#65 def just_keyword_of_sentence?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#63 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#61 def keyword_appearance?; end # Returns the value of attribute keywords. # - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#39 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#37 def keywords; end - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#53 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#51 def regex; end - # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#41 + # source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#39 def split_comment(comment); end end -# source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#50 +# source://rubocop/lib/rubocop/cop/mixin/annotation_comment.rb#48 RuboCop::Cop::AnnotationComment::KEYWORDS_REGEX_CACHE = T.let(T.unsafe(nil), Hash) # Handles the `MinSize` configuration option for array-based cops @@ -2802,31 +2804,44 @@ module RuboCop::Cop::AutocorrectLogic # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#51 def disable_offense(offense_range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#118 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#138 def disable_offense_at_end_of_line(range, eol_comment); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#122 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#142 def disable_offense_before_and_after(range_by_lines); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#61 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#63 def disable_offense_with_eol_or_surround_comment(range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#114 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#134 def max_line_length; end # Expand the given range to include all of any lines it covers. Does not # include newline at end of the last line. # - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#104 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#124 def range_by_lines(range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#95 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#115 def range_of_first_line(range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#72 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#107 + def range_overlaps_offense?(offense_range, range); end + + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#97 + def string_continuation(offense_range); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#111 + def string_continuation?(node); end + + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#74 def surrounding_heredoc(offense_range); end - # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#83 + # source://rubocop/lib/rubocop/cop/autocorrect_logic.rb#85 def surrounding_percent_array(offense_range); end end @@ -2939,18 +2954,18 @@ class RuboCop::Cop::Base # @return [Base] a new instance of Base # - # source://rubocop/lib/rubocop/cop/base.rb#153 + # source://rubocop/lib/rubocop/cop/base.rb#156 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#269 + # source://rubocop/lib/rubocop/cop/base.rb#272 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#186 + # source://rubocop/lib/rubocop/cop/base.rb#189 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) @@ -2958,25 +2973,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#198 + # source://rubocop/lib/rubocop/cop/base.rb#201 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#340 + # source://rubocop/lib/rubocop/cop/base.rb#351 def always_autocorrect?; end # Called before any investigation # # @api private # - # source://rubocop/lib/rubocop/cop/base.rb#326 + # source://rubocop/lib/rubocop/cop/base.rb#337 def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end # @api private # - # source://rubocop/lib/rubocop/cop/base.rb#311 + # source://rubocop/lib/rubocop/cop/base.rb#318 def callbacks_needed; end # Returns the value of attribute config. @@ -2984,29 +2999,29 @@ class RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/base.rb#43 def config; end - # source://rubocop/lib/rubocop/cop/base.rb#249 + # source://rubocop/lib/rubocop/cop/base.rb#252 def config_to_allow_offenses; end - # source://rubocop/lib/rubocop/cop/base.rb#253 + # source://rubocop/lib/rubocop/cop/base.rb#256 def config_to_allow_offenses=(hash); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#346 + # source://rubocop/lib/rubocop/cop/base.rb#357 def contextual_autocorrect?; end # Configuration Helpers # - # source://rubocop/lib/rubocop/cop/base.rb#243 + # source://rubocop/lib/rubocop/cop/base.rb#246 def cop_config; end - # source://rubocop/lib/rubocop/cop/base.rb#235 + # source://rubocop/lib/rubocop/cop/base.rb#238 def cop_name; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#282 + # source://rubocop/lib/rubocop/cop/base.rb#289 def excluded_file?(file); end # This method should be overridden when a cop's behavior depends @@ -3025,51 +3040,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#231 + # source://rubocop/lib/rubocop/cop/base.rb#234 def external_dependency_checksum; end - # source://rubocop/lib/rubocop/cop/base.rb#350 + # source://rubocop/lib/rubocop/cop/base.rb#361 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#180 + # source://rubocop/lib/rubocop/cop/base.rb#183 def message(_range = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/base.rb#235 + # source://rubocop/lib/rubocop/cop/base.rb#238 def name; end # @deprecated Make potential errors with previous API more obvious # - # source://rubocop/lib/rubocop/cop/base.rb#302 + # source://rubocop/lib/rubocop/cop/base.rb#309 def offenses; end # Called after all on_... have been called # When refining this method, always call `super` # - # source://rubocop/lib/rubocop/cop/base.rb#167 + # source://rubocop/lib/rubocop/cop/base.rb#170 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#161 + # source://rubocop/lib/rubocop/cop/base.rb#164 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#173 + # source://rubocop/lib/rubocop/cop/base.rb#176 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#287 + # source://rubocop/lib/rubocop/cop/base.rb#294 def parse(source, path = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/base.rb#261 + # source://rubocop/lib/rubocop/cop/base.rb#264 def parser_engine; end # Returns the value of attribute processed_source. @@ -3081,104 +3096,111 @@ class RuboCop::Cop::Base # # @api private # - # source://rubocop/lib/rubocop/cop/base.rb#293 + # source://rubocop/lib/rubocop/cop/base.rb#300 def ready; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#273 + # source://rubocop/lib/rubocop/cop/base.rb#280 def relevant_file?(file); end - # source://rubocop/lib/rubocop/cop/base.rb#265 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/base.rb#276 + def string_literals_frozen_by_default?; end + + # source://rubocop/lib/rubocop/cop/base.rb#268 def target_rails_version; end - # source://rubocop/lib/rubocop/cop/base.rb#257 + # source://rubocop/lib/rubocop/cop/base.rb#260 def target_ruby_version; end private - # source://rubocop/lib/rubocop/cop/base.rb#478 + # source://rubocop/lib/rubocop/cop/base.rb#479 def annotate(message); end - # source://rubocop/lib/rubocop/cop/base.rb#362 + # source://rubocop/lib/rubocop/cop/base.rb#373 def apply_correction(corrector); end # @return [Symbol] offense status # - # source://rubocop/lib/rubocop/cop/base.rb#442 + # source://rubocop/lib/rubocop/cop/base.rb#443 def attempt_correction(range, corrector); end # Reserved for Cop::Cop # - # source://rubocop/lib/rubocop/cop/base.rb#358 + # source://rubocop/lib/rubocop/cop/base.rb#369 def callback_argument(range); end # Called to complete an investigation # - # source://rubocop/lib/rubocop/cop/base.rb#391 + # source://rubocop/lib/rubocop/cop/base.rb#402 def complete_investigation; end # @return [Symbol, Corrector] offense status # - # source://rubocop/lib/rubocop/cop/base.rb#416 + # source://rubocop/lib/rubocop/cop/base.rb#417 def correct(range); end - # source://rubocop/lib/rubocop/cop/base.rb#376 + # source://rubocop/lib/rubocop/cop/base.rb#387 def current_corrector; end # Reserved for Commissioner: # - # source://rubocop/lib/rubocop/cop/base.rb#368 + # source://rubocop/lib/rubocop/cop/base.rb#379 def current_offense_locations; end - # source://rubocop/lib/rubocop/cop/base.rb#380 + # source://rubocop/lib/rubocop/cop/base.rb#391 def current_offenses; end - # source://rubocop/lib/rubocop/cop/base.rb#372 + # source://rubocop/lib/rubocop/cop/base.rb#383 def currently_disabled_lines; end - # source://rubocop/lib/rubocop/cop/base.rb#506 + # source://rubocop/lib/rubocop/cop/base.rb#507 def custom_severity; end - # source://rubocop/lib/rubocop/cop/base.rb#502 + # source://rubocop/lib/rubocop/cop/base.rb#503 def default_severity; end - # source://rubocop/lib/rubocop/cop/base.rb#456 + # source://rubocop/lib/rubocop/cop/base.rb#457 def disable_uncorrectable(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#492 + # source://rubocop/lib/rubocop/cop/base.rb#493 def enabled_line?(line_number); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#484 + # source://rubocop/lib/rubocop/cop/base.rb#485 def file_name_matches_any?(file, parameter, default_result); end - # source://rubocop/lib/rubocop/cop/base.rb#474 + # source://rubocop/lib/rubocop/cop/base.rb#475 def find_message(range, message); end - # source://rubocop/lib/rubocop/cop/base.rb#498 + # source://rubocop/lib/rubocop/cop/base.rb#499 def find_severity(_range, severity); end - # source://rubocop/lib/rubocop/cop/base.rb#519 + # source://rubocop/lib/rubocop/cop/base.rb#520 def range_for_original(range); end - # source://rubocop/lib/rubocop/cop/base.rb#463 + # source://rubocop/lib/rubocop/cop/base.rb#464 def range_from_node_or_range(node_or_range); end - # source://rubocop/lib/rubocop/cop/base.rb#411 + # Actually private methods + # + # source://rubocop/lib/rubocop/cop/base.rb#412 def reset_investigation; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#527 + # source://rubocop/lib/rubocop/cop/base.rb#528 def target_satisfies_all_gem_version_requirements?; end # @return [Symbol] offense status # - # source://rubocop/lib/rubocop/cop/base.rb#431 + # source://rubocop/lib/rubocop/cop/base.rb#432 def use_corrector(range, corrector); end class << self @@ -3193,51 +3215,54 @@ class RuboCop::Cop::Base # Naming # - # source://rubocop/lib/rubocop/cop/base.rb#90 + # source://rubocop/lib/rubocop/cop/base.rb#93 def badge; end # @api private # - # source://rubocop/lib/rubocop/cop/base.rb#316 + # source://rubocop/lib/rubocop/cop/base.rb#323 def callbacks_needed; end - # source://rubocop/lib/rubocop/cop/base.rb#94 + # source://rubocop/lib/rubocop/cop/base.rb#97 def cop_name; end - # source://rubocop/lib/rubocop/cop/base.rb#98 + # source://rubocop/lib/rubocop/cop/base.rb#101 def department; end - # Cops (other than builtin) are encouraged to implement this + # Returns an url to view this cops documentation online. + # Requires 'DocumentationBaseURL' to be set for your department. + # Will follow the convention of RuboCops own documentation structure, + # overwrite this method to accommodate your custom layout. # # @api public # @return [String, nil] # - # source://rubocop/lib/rubocop/cop/base.rb#67 - def documentation_url; end + # source://rubocop/lib/rubocop/cop/base.rb#70 + def documentation_url(config = T.unsafe(nil)); end # Call for abstract Cop classes # - # source://rubocop/lib/rubocop/cop/base.rb#78 + # source://rubocop/lib/rubocop/cop/base.rb#81 def exclude_from_registry; end # Returns the value of attribute gem_requirements. # - # source://rubocop/lib/rubocop/cop/base.rb#135 + # source://rubocop/lib/rubocop/cop/base.rb#138 def gem_requirements; end # @private # - # source://rubocop/lib/rubocop/cop/base.rb#71 + # source://rubocop/lib/rubocop/cop/base.rb#74 def inherited(subclass); end # Override and return the Force class(es) you need to join # - # source://rubocop/lib/rubocop/cop/base.rb#115 + # source://rubocop/lib/rubocop/cop/base.rb#118 def joining_forces; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#102 + # source://rubocop/lib/rubocop/cop/base.rb#105 def lint?; end # Returns true if the cop name or the cop namespace matches any of the @@ -3245,7 +3270,7 @@ class RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#108 + # source://rubocop/lib/rubocop/cop/base.rb#111 def match?(given_names); end # Register a version requirement for the given gem name. @@ -3260,7 +3285,7 @@ class RuboCop::Cop::Base # # https://guides.rubygems.org/patterns/#declaring-dependencies # - # source://rubocop/lib/rubocop/cop/base.rb#148 + # source://rubocop/lib/rubocop/cop/base.rb#151 def requires_gem(gem_name, *version_requirements); end # Returns if class supports autocorrect. @@ -3268,7 +3293,7 @@ class RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#84 + # source://rubocop/lib/rubocop/cop/base.rb#87 def support_autocorrect?; end # Override if your cop should be called repeatedly for multiple investigations @@ -3281,22 +3306,17 @@ class RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/base.rb#126 + # source://rubocop/lib/rubocop/cop/base.rb#129 def support_multiple_source?; end private - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cop/base.rb#402 - def builtin?; end - - # source://rubocop/lib/rubocop/cop/base.rb#384 + # source://rubocop/lib/rubocop/cop/base.rb#395 def restrict_on_send; end end end -# source://rubocop/lib/rubocop/cop/base.rb#388 +# source://rubocop/lib/rubocop/cop/base.rb#399 RuboCop::Cop::Base::EMPTY_OFFENSES = T.let(T.unsafe(nil), Array) # Reports of an investigation. @@ -3814,56 +3834,56 @@ class RuboCop::Cop::Bundler::GemVersion < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::GemDeclaration - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#67 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#68 def includes_commit_reference?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#62 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#63 def includes_version_specification?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#71 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#72 def on_send(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#85 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#86 def allowed_gem?(node); end - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#89 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#90 def allowed_gems; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#113 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#112 def forbidden_offense?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#119 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#118 def forbidden_style?; end - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#93 - def message(range); end + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#94 + def message(_range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#103 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#102 def offense?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#107 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#106 def required_offense?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#123 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#122 def required_style?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#127 + # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#126 def version_specification?(expression); end end @@ -3874,6 +3894,9 @@ RuboCop::Cop::Bundler::GemVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Bundler::GemVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#59 +RuboCop::Cop::Bundler::GemVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# source://rubocop/lib/rubocop/cop/bundler/gem_version.rb#60 RuboCop::Cop::Bundler::GemVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp) # Passing symbol arguments to `source` (e.g. `source :rubygems`) is @@ -4080,64 +4103,69 @@ module RuboCop::Cop::CheckLineBreakable # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#200 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#202 def all_on_same_line?(nodes); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#220 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#222 def already_on_multiple_lines?(node); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#133 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#135 def breakable_collection?(node, elements); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#228 + def chained_to_heredoc?(node); end + # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#187 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#189 def children_could_be_broken_up?(children); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#150 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#152 def contained_by_breakable_collection_on_same_line?(node); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#170 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#172 def contained_by_multiline_collection_that_could_be_broken_up?(node); end # @api private # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#60 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#62 def extract_breakable_node_from_elements(node, elements, max); end # @api private # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#72 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#74 def extract_first_element_over_column_limit(node, elements, max); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#92 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#94 def first_argument_is_heredoc?(node); end # @api private # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#207 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#209 def process_args(args); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#117 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#119 def safe_to_ignore?(node); end # If a send node contains a heredoc argument, splitting cannot happen @@ -4145,13 +4173,13 @@ module RuboCop::Cop::CheckLineBreakable # # @api private # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#101 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#103 def shift_elements_for_heredoc_arg(node, elements, index); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#112 + # source://rubocop/lib/rubocop/cop/mixin/check_line_breakable.rb#114 def within_column_limit?(element, max, line); end end @@ -4860,7 +4888,7 @@ end # Handles `Max` configuration parameters, especially setting them to an # appropriate value with --auto-gen-config. # -# @deprecated Use `exclude_limit ParameterName` instead. +# @deprecated Use `exclude_limit <ParameterName>` instead. # # source://rubocop/lib/rubocop/cop/mixin/configurable_max.rb#8 module RuboCop::Cop::ConfigurableMax @@ -4869,7 +4897,7 @@ module RuboCop::Cop::ConfigurableMax # source://rubocop/lib/rubocop/cop/mixin/configurable_max.rb#11 def max=(value); end - # source://rubocop/lib/rubocop/cop/mixin/configurable_max.rb#19 + # source://rubocop/lib/rubocop/cop/mixin/configurable_max.rb#23 def max_parameter_name; end end @@ -4902,22 +4930,22 @@ RuboCop::Cop::ConfigurableNumbering::FORMATS = T.let(T.unsafe(nil), Hash) # # source://rubocop/lib/rubocop/cop/cop.rb#11 class RuboCop::Cop::Cop < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/cop.rb#53 + # source://rubocop/lib/rubocop/cop/cop.rb#73 def add_offense(node_or_range, location: T.unsafe(nil), message: T.unsafe(nil), severity: T.unsafe(nil), &block); end # Called before any investigation # # @api private # - # source://rubocop/lib/rubocop/cop/cop.rb#103 + # source://rubocop/lib/rubocop/cop/cop.rb#129 def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end # @deprecated # - # source://rubocop/lib/rubocop/cop/cop.rb#82 + # source://rubocop/lib/rubocop/cop/cop.rb#105 def corrections; end - # source://rubocop/lib/rubocop/cop/cop.rb#70 + # source://rubocop/lib/rubocop/cop/cop.rb#90 def find_location(node, loc); end # Returns the value of attribute offenses. @@ -4927,71 +4955,76 @@ class RuboCop::Cop::Cop < ::RuboCop::Cop::Base # Called after all on_... have been called # - # source://rubocop/lib/rubocop/cop/cop.rb#96 + # source://rubocop/lib/rubocop/cop/cop.rb#122 def on_investigation_end; end # Called before all on_... have been called # - # source://rubocop/lib/rubocop/cop/cop.rb#90 + # source://rubocop/lib/rubocop/cop/cop.rb#116 def on_new_investigation; end # @deprecated Use class method # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/cop.rb#76 + # source://rubocop/lib/rubocop/cop/cop.rb#96 def support_autocorrect?; end private - # source://rubocop/lib/rubocop/cop/cop.rb#121 + # source://rubocop/lib/rubocop/cop/cop.rb#147 def apply_correction(corrector); end # Override Base # - # source://rubocop/lib/rubocop/cop/cop.rb#117 + # source://rubocop/lib/rubocop/cop/cop.rb#143 def callback_argument(_range); end - # source://rubocop/lib/rubocop/cop/cop.rb#138 + # source://rubocop/lib/rubocop/cop/cop.rb#164 def correction_lambda; end - # source://rubocop/lib/rubocop/cop/cop.rb#144 + # source://rubocop/lib/rubocop/cop/cop.rb#170 def dedupe_on_node(node); end # Just for legacy # # @yield [corrector] # - # source://rubocop/lib/rubocop/cop/cop.rb#126 + # source://rubocop/lib/rubocop/cop/cop.rb#152 def emulate_v0_callsequence(corrector); end - # source://rubocop/lib/rubocop/cop/cop.rb#157 + # source://rubocop/lib/rubocop/cop/cop.rb#183 def range_for_original(range); end - # source://rubocop/lib/rubocop/cop/cop.rb#151 + # source://rubocop/lib/rubocop/cop/cop.rb#177 def suppress_clobbering; end class << self # @deprecated Use Registry.all # - # source://rubocop/lib/rubocop/cop/cop.rb#44 + # source://rubocop/lib/rubocop/cop/cop.rb#56 def all; end - # source://rubocop/lib/rubocop/cop/cop.rb#29 + # @private + # + # source://rubocop/lib/rubocop/cop/cop.rb#25 + def inherited(_subclass); end + + # source://rubocop/lib/rubocop/cop/cop.rb#37 def joining_forces; end # @deprecated Use Registry.qualified_cop_name # - # source://rubocop/lib/rubocop/cop/cop.rb#49 + # source://rubocop/lib/rubocop/cop/cop.rb#65 def qualified_cop_name(name, origin); end # @deprecated Use Registry.global # - # source://rubocop/lib/rubocop/cop/cop.rb#39 + # source://rubocop/lib/rubocop/cop/cop.rb#47 def registry; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/cop.rb#25 + # source://rubocop/lib/rubocop/cop/cop.rb#33 def support_autocorrect?; end end end @@ -5093,7 +5126,7 @@ class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter # Legacy # - # source://parser/3.3.1.0lib/parser/source/tree_rewriter.rb#252 + # source://parser/3.3.6.0lib/parser/source/tree_rewriter.rb#252 def rewrite; end # Swaps sources at the given ranges. @@ -5159,19 +5192,34 @@ module RuboCop::Cop::Documentation # @api private # - # source://rubocop/lib/rubocop/cop/documentation.rb#24 + # source://rubocop/lib/rubocop/cop/documentation.rb#25 def base_url_for(cop_class, config); end # @api private # - # source://rubocop/lib/rubocop/cop/documentation.rb#34 + # source://rubocop/lib/rubocop/cop/documentation.rb#57 + def builtin?(cop_class); end + + # @api private + # + # source://rubocop/lib/rubocop/cop/documentation.rb#47 def default_base_url; end + # @api private + # + # source://rubocop/lib/rubocop/cop/documentation.rb#52 + def default_extension; end + # @api private # # source://rubocop/lib/rubocop/cop/documentation.rb#10 def department_to_basename(department); end + # @api private + # + # source://rubocop/lib/rubocop/cop/documentation.rb#36 + def extension_for(cop_class, config); end + # @api private # # source://rubocop/lib/rubocop/cop/documentation.rb#15 @@ -5180,19 +5228,35 @@ module RuboCop::Cop::Documentation class << self # @api private # - # source://rubocop/lib/rubocop/cop/documentation.rb#24 + # source://rubocop/lib/rubocop/cop/documentation.rb#25 def base_url_for(cop_class, config); end + # @api private + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/documentation.rb#57 + def builtin?(cop_class); end + # @api private # - # source://rubocop/lib/rubocop/cop/documentation.rb#34 + # source://rubocop/lib/rubocop/cop/documentation.rb#47 def default_base_url; end + # @api private + # + # source://rubocop/lib/rubocop/cop/documentation.rb#52 + def default_extension; end + # @api private # # source://rubocop/lib/rubocop/cop/documentation.rb#10 def department_to_basename(department); end + # @api private + # + # source://rubocop/lib/rubocop/cop/documentation.rb#36 + def extension_for(cop_class, config); end + # @api private # # source://rubocop/lib/rubocop/cop/documentation.rb#15 @@ -5407,6 +5471,19 @@ end # source://rubocop/lib/rubocop/cop/mixin/end_keyword_alignment.rb#10 RuboCop::Cop::EndKeywordAlignment::MSG = T.let(T.unsafe(nil), String) +# Common functionality for rewriting endless methods to normal method definitions +# +# source://rubocop/lib/rubocop/cop/mixin/endless_method_rewriter.rb#6 +module RuboCop::Cop::EndlessMethodRewriter + # source://rubocop/lib/rubocop/cop/mixin/endless_method_rewriter.rb#7 + def correct_to_multiline(corrector, node); end + + private + + # source://rubocop/lib/rubocop/cop/mixin/endless_method_rewriter.rb#19 + def arguments(node, missing = T.unsafe(nil)); end +end + # Common functionality for enforcing a specific superclass. # # IMPORTANT: RuboCop core depended on this module when it supported Rails department. @@ -5525,44 +5602,60 @@ RuboCop::Cop::ForToEachCorrector::CORRECTION = T.let(T.unsafe(nil), String) class RuboCop::Cop::Force # @return [Force] a new instance of Force # - # source://rubocop/lib/rubocop/cop/force.rb#22 + # source://rubocop/lib/rubocop/cop/force.rb#32 def initialize(cops); end # Returns the value of attribute cops. # - # source://rubocop/lib/rubocop/cop/force.rb#7 + # source://rubocop/lib/rubocop/cop/force.rb#17 def cops; end - # source://rubocop/lib/rubocop/cop/force.rb#38 + # source://rubocop/lib/rubocop/cop/force.rb#50 def investigate(_processed_source); end - # source://rubocop/lib/rubocop/cop/force.rb#26 + # source://rubocop/lib/rubocop/cop/force.rb#36 def name; end - # source://rubocop/lib/rubocop/cop/force.rb#30 + # source://rubocop/lib/rubocop/cop/force.rb#40 def run_hook(method_name, *args); end class << self - # source://rubocop/lib/rubocop/cop/force.rb#9 + # source://rubocop/lib/rubocop/cop/force.rb#19 def all; end - # source://rubocop/lib/rubocop/cop/force.rb#18 + # source://rubocop/lib/rubocop/cop/force.rb#28 def force_name; end # @private # - # source://rubocop/lib/rubocop/cop/force.rb#13 + # source://rubocop/lib/rubocop/cop/force.rb#23 def inherited(subclass); end end end +# @api private +# +# source://rubocop/lib/rubocop/cop/force.rb#8 +class RuboCop::Cop::Force::HookError < ::StandardError + # @api private + # @return [HookError] a new instance of HookError + # + # source://rubocop/lib/rubocop/cop/force.rb#11 + def initialize(joining_cop); end + + # @api private + # + # source://rubocop/lib/rubocop/cop/force.rb#9 + def joining_cop; end +end + # Common functionality for dealing with frozen string literals. # # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#6 module RuboCop::Cop::FrozenStringLiteral private - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#35 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#37 def frozen_heredoc?(node); end # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#21 @@ -5571,21 +5664,24 @@ module RuboCop::Cop::FrozenStringLiteral # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#15 def frozen_string_literal_comment_exists?; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#66 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#78 def frozen_string_literal_specified?; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#60 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#72 def frozen_string_literals_disabled?; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#41 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#44 def frozen_string_literals_enabled?; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#76 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#88 def leading_comment_lines; end - # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#72 + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#84 def leading_magic_comments; end + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#37 + def uninterpolated_heredoc?(node); end + # source://rubocop/lib/rubocop/cop/mixin/frozen_string_literal.rb#31 def uninterpolated_string?(node); end @@ -5616,9 +5712,38 @@ module RuboCop::Cop::GemDeclaration def gem_declaration?(param0 = T.unsafe(nil)); end end -# source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#5 +# source://rubocop/lib/rubocop/cop/gemspec/add_runtime_dependency.rb#5 module RuboCop::Cop::Gemspec; end +# Prefer `add_dependency` over `add_runtime_dependency` as the latter is +# considered soft-deprecated. +# +# @example +# +# # bad +# Gem::Specification.new do |spec| +# spec.add_runtime_dependency('rubocop') +# end +# +# # good +# Gem::Specification.new do |spec| +# spec.add_dependency('rubocop') +# end +# +# source://rubocop/lib/rubocop/cop/gemspec/add_runtime_dependency.rb#21 +class RuboCop::Cop::Gemspec::AddRuntimeDependency < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/gemspec/add_runtime_dependency.rb#28 + def on_send(node); end +end + +# source://rubocop/lib/rubocop/cop/gemspec/add_runtime_dependency.rb#24 +RuboCop::Cop::Gemspec::AddRuntimeDependency::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/gemspec/add_runtime_dependency.rb#26 +RuboCop::Cop::Gemspec::AddRuntimeDependency::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Enforce that gem dependency version specifications or a commit reference (branch, # ref, or tag) are either required or forbidden. # @@ -5686,7 +5811,7 @@ class RuboCop::Cop::Gemspec::DependencyVersion < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#120 + # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#118 def add_dependency_method?(method_name); end # @return [Boolean] @@ -5699,40 +5824,40 @@ class RuboCop::Cop::Gemspec::DependencyVersion < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#134 + # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#132 def forbidden_offense?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#140 + # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#138 def forbidden_style?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#114 + # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#112 def match_block_variable_name?(receiver_name); end # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#104 - def message(range); end + def message(_range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#124 + # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#122 def offense?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#128 + # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#126 def required_offense?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#144 + # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#142 def required_style?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#148 + # source://rubocop/lib/rubocop/cop/gemspec/dependency_version.rb#146 def version_specification?(expression); end end @@ -5921,8 +6046,8 @@ RuboCop::Cop::Gemspec::DevelopmentDependencies::RESTRICT_ON_SEND = T.let(T.unsaf # # # good # Gem::Specification.new do |spec| -# spec.add_runtime_dependency('parallel', '~> 1.10') -# spec.add_runtime_dependency('parser', '>= 2.3.3.1', '< 3.0') +# spec.add_dependency('parallel', '~> 1.10') +# spec.add_dependency('parser', '>= 2.3.3.1', '< 3.0') # end # # source://rubocop/lib/rubocop/cop/gemspec/duplicated_assignment.rb#37 @@ -6225,15 +6350,15 @@ RuboCop::Cop::Gemspec::RequiredRubyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(ni # # bad # Gem::Specification.new do |spec| # if RUBY_VERSION >= '3.0' -# spec.add_runtime_dependency 'gem_a' +# spec.add_dependency 'gem_a' # else -# spec.add_runtime_dependency 'gem_b' +# spec.add_dependency 'gem_b' # end # end # # # good # Gem::Specification.new do |spec| -# spec.add_runtime_dependency 'gem_a' +# spec.add_dependency 'gem_a' # end # # source://rubocop/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#28 @@ -6618,40 +6743,45 @@ module RuboCop::Cop::HashShorthandSyntax # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#125 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#126 def brackets?(method_dispatch_node); end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#155 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#156 def breakdown_value_types_of_hash(hash_node); end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#102 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#103 def def_node_that_require_parentheses(node); end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#179 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#185 def each_omittable_value_pair(hash_value_type_breakdown, &block); end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#175 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#181 def each_omitted_value_pair(hash_value_type_breakdown, &block); end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#80 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#81 def enforced_shorthand_syntax; end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#117 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#118 def find_ancestor_method_dispatch_node(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#167 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#168 def hash_with_mixed_shorthand_syntax?(hash_value_type_breakdown); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#171 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#172 def hash_with_values_that_cant_be_omitted?(hash_value_type_breakdown); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#74 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#176 + def ignore_explicit_omissible_hash_shorthand_syntax?(hash_value_type_breakdown); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#75 def ignore_hash_shorthand_syntax?(pair_node); end # @return [Boolean] @@ -6661,18 +6791,18 @@ module RuboCop::Cop::HashShorthandSyntax # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#140 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#141 def last_expression?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#148 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#149 def method_dispatch_as_argument?(method_dispatch_node); end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#183 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#189 def mixed_shorthand_syntax_check(hash_value_type_breakdown); end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#199 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#205 def no_mixed_shorthand_syntax_check(hash_value_type_breakdown); end # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#49 @@ -6680,22 +6810,22 @@ module RuboCop::Cop::HashShorthandSyntax # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#84 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#85 def require_hash_value?(hash_key_source, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#93 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#94 def require_hash_value_for_around_hash_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#129 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#130 def use_element_of_hash_literal_as_receiver?(ancestor, parent); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#134 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#135 def use_modifier_form_without_parenthesized_method_call?(ancestor); end end @@ -6708,12 +6838,12 @@ RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_MSG_PREFIX = T.let(T.unsafe(nil), # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#11 RuboCop::Cop::HashShorthandSyntax::DO_NOT_MIX_OMIT_VALUE_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#209 +# source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#216 class RuboCop::Cop::HashShorthandSyntax::DefNode < ::Struct - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#218 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#225 def first_argument; end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#222 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#229 def last_argument; end # Returns the value of attribute node @@ -6727,7 +6857,7 @@ class RuboCop::Cop::HashShorthandSyntax::DefNode < ::Struct # @return [Object] the newly set value def node=(_); end - # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#210 + # source://rubocop/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb#217 def selector; end class << self @@ -7032,7 +7162,7 @@ RuboCop::Cop::IfThenCorrector::DEFAULT_INDENTATION_WIDTH = T.let(T.unsafe(nil), # @deprecated IgnoredMethods class has been replaced with AllowedMethods. # -# source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#40 +# source://rubocop/lib/rubocop/cop/mixin/allowed_methods.rb#46 RuboCop::Cop::IgnoredMethods = RuboCop::Cop::AllowedMethods # Handles adding and checking ignored nodes. @@ -7060,7 +7190,7 @@ end # @deprecated IgnoredPattern class has been replaced with AllowedPattern. # -# source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#54 +# source://rubocop/lib/rubocop/cop/mixin/allowed_pattern.rb#66 RuboCop::Cop::IgnoredPattern = RuboCop::Cop::AllowedPattern # Common functionality for checking integer nodes. @@ -7241,19 +7371,19 @@ class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#58 def check_body(body, node); end - # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#65 + # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#69 def check_modifier(send_node, end_range); end - # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#88 + # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#92 def expected_indent_offset; end - # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#84 + # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#88 def message(range); end # An offset that is not expected, but correct if the configuration is # changed. # - # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#94 + # source://rubocop/lib/rubocop/cop/layout/access_modifier_indentation.rb#98 def unexpected_indent_offset; end end @@ -7437,7 +7567,7 @@ RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), St # right-hand-side of a multi-line assignment. # # The indentation of the remaining lines can be corrected with -# other cops such as `IndentationConsistency` and `EndAlignment`. +# other cops such as `Layout/IndentationConsistency` and `Layout/EndAlignment`. # # @example # # bad @@ -7452,7 +7582,7 @@ RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), St # 'bar' # end # -# source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#24 +# source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#25 class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Base include ::RuboCop::Cop::CheckAssignment include ::RuboCop::Cop::Alignment @@ -7460,17 +7590,17 @@ class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Base private - # source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#42 + # source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#43 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#33 + # source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#34 def check_assignment(node, rhs); end - # source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#46 + # source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#47 def leftmost_multiple_assignment(node); end end -# source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#29 +# source://rubocop/lib/rubocop/cop/layout/assignment_indentation.rb#30 RuboCop::Cop::Layout::AssignmentIndentation::MSG = T.let(T.unsafe(nil), String) # Checks whether the end keyword of `begin` is aligned properly. @@ -7545,7 +7675,7 @@ RuboCop::Cop::Layout::BeginEndAlignment::MSG = T.let(T.unsafe(nil), String) # start of the line where the expression started. # # `either` (which is the default) : the `end` is allowed to be in either -# location. The autofixer will default to `start_of_line`. +# location. The autocorrect will default to `start_of_line`. # # @example EnforcedStyleAlignWith: either (default) # # bad @@ -7610,54 +7740,63 @@ class RuboCop::Cop::Layout::BlockAlignment < ::RuboCop::Cop::Base private - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#228 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#246 def add_space_before(corrector, loc, delta); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#205 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#223 def alt_start_msg(start_loc, source_line_column); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#155 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#145 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#105 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#95 def block_end_align_target(node); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#123 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#113 def check_block_alignment(start_node, block_node); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#178 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#196 def compute_do_source_line_column(node, end_loc); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#220 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#238 def compute_start_col(ancestor_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#119 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#109 def disqualified_parent?(parent, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#115 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#105 def end_align_target?(node, parent); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#168 + # In offense message, we want to show the assignment LHS rather than + # the entire assignment. + # + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#191 + def find_lhs_node(node); end + + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#162 def format_message(start_loc, end_loc, do_source_line_column, error_source_line_column); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#215 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#233 def format_source_line_column(source_line_column); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#197 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#215 def loc_to_source_line_column(loc); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#136 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#126 def register_offense(block_node, start_loc, end_loc, do_source_line_column); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#232 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#250 def remove_space_before(corrector, end_pos, delta); end - # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#95 + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#172 def start_for_block_node(block_node); end + + # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#179 + def start_for_line_node(block_node); end end # source://rubocop/lib/rubocop/cop/layout/block_alignment.rb#71 @@ -8458,43 +8597,40 @@ RuboCop::Cop::Layout::CommentIndentation::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # if # some_condition # do_something # end -# @example # # # good -# # if some_condition # do_something # end # -# source://rubocop/lib/rubocop/cop/layout/condition_position.rb#25 +# source://rubocop/lib/rubocop/cop/layout/condition_position.rb#21 class RuboCop::Cop::Layout::ConditionPosition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#31 + # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#27 def on_if(node); end - # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#37 + # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#33 def on_until(node); end - # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#37 + # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#33 def on_while(node); end private - # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#44 + # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#40 def check(node); end - # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#58 + # source://rubocop/lib/rubocop/cop/layout/condition_position.rb#54 def message(condition); end end -# source://rubocop/lib/rubocop/cop/layout/condition_position.rb#29 +# source://rubocop/lib/rubocop/cop/layout/condition_position.rb#25 RuboCop::Cop::Layout::ConditionPosition::MSG = T.let(T.unsafe(nil), String) # Checks whether the end keywords of method definitions are @@ -8772,35 +8908,35 @@ class RuboCop::Cop::Layout::EmptyComment < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#131 + # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#133 def allow_border_comment?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#135 + # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#137 def allow_margin_comment?; end # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#97 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#127 + # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#129 def comment_text(comment); end # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#108 def concat_consecutive_comments(comments); end - # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#139 + # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#141 def current_token(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#117 + # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#119 def empty_comment_only?(comment_text); end # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#85 def investigate(comments); end - # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#143 + # source://rubocop/lib/rubocop/cop/layout/empty_comment.rb#145 def previous_token(node); end end @@ -9226,84 +9362,84 @@ class RuboCop::Cop::Layout::EmptyLineBetweenDefs < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#290 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#291 def allowance_range?; end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#274 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#275 def autocorrect_insert_lines(corrector, newline_pos, count); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#267 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#268 def autocorrect_remove_lines(corrector, newline_pos, count); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#227 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#228 def blank_lines_count_between(first_def_node, second_def_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#171 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#172 def candidate?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#191 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#192 def class_candidate?(node); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#255 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#256 def def_end(node); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#163 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#164 def def_location(correction_node); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#247 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#248 def def_start(node); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#178 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#179 def empty_line_between_macros; end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#259 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#260 def end_loc(node); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#205 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#206 def expected_lines; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#223 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#224 def line_count_allowed?(count); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#239 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#240 def lines_between_defs(first_def_node, second_def_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#182 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#183 def macro_candidate?(node); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#235 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#236 def maximum_empty_lines; end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#199 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#200 def message(node, count: T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#187 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#188 def method_candidate?(node); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#231 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#232 def minimum_empty_lines; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#195 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#196 def module_candidate?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#214 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#215 def multiple_blank_lines_groups?(first_def_node, second_def_node); end - # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#281 + # source://rubocop/lib/rubocop/cop/layout/empty_line_between_defs.rb#282 def node_type(node); end class << self @@ -9997,22 +10133,24 @@ class RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords < ::RuboCo # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#81 def check_body(body, line_of_def_or_kwbegin); end - # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#108 + # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#113 def keyword_locations(node); end - # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#125 + # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#130 def keyword_locations_in_ensure(node); end - # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#121 + # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#126 def keyword_locations_in_rescue(node); end + # @return [Boolean] + # # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#96 - def last_rescue_and_end_on_same_line(body); end + def last_body_and_end_on_same_line?(body); end - # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#100 + # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#105 def message(location, keyword); end - # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#104 + # source://rubocop/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#109 def style; end end @@ -10514,8 +10652,8 @@ RuboCop::Cop::Layout::ExtraSpacing::MSG_UNNECESSARY = T.let(T.unsafe(nil), Strin # second_params # @example EnforcedStyle: special_for_inner_method_call # # The first argument should normally be indented one step more than -# # the preceding line, but if it's a argument for a method call that -# # is itself a argument in a method call, then the inner argument +# # the preceding line, but if it's an argument for a method call that +# # is itself an argument in a method call, then the inner argument # # should be indented relative to the inner method. # # # good @@ -10671,7 +10809,6 @@ RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), Strin # # defined inside a method call. # # # bad -# # consistent # array = [ # :value # ] @@ -10691,68 +10828,66 @@ RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), Strin # # brackets are indented to the same position. # # # bad -# # align_brackets # and_now_for_something = [ # :completely_different # ] # # # good -# # align_brackets # and_now_for_something = [ # :completely_different # ] # -# source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#85 +# source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#82 class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineElementIndentation extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#94 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#91 def on_array(node); end - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#98 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#97 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#98 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#97 def on_send(node); end private - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#189 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#188 def array_alignment_config; end - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#109 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#108 def autocorrect(corrector, node); end # Returns the description of what the correct indentation is based on. # - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#147 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#146 def base_description(indent_base_type); end - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#113 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#112 def brace_alignment_style; end - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#117 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#116 def check(array_node, left_parenthesis); end - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#131 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#130 def check_right_bracket(right_bracket, first_elem, left_bracket, left_parenthesis); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#183 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#182 def enforce_first_argument_with_fixed_indentation?; end - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#160 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#159 def message(base_description); end - # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#168 + # source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#167 def message_for_right_bracket(indent_base_type); end end -# source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#91 +# source://rubocop/lib/rubocop/cop/layout/first_array_element_indentation.rb#88 RuboCop::Cop::Layout::FirstArrayElementIndentation::MSG = T.let(T.unsafe(nil), String) # Checks for a line break before the first element in a @@ -11094,30 +11229,36 @@ RuboCop::Cop::Layout::FirstHashElementLineBreak::MSG = T.let(T.unsafe(nil), Stri # qux: "b", # } # ) +# @example AllowedMethods: ['some_method'] # -# source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#66 +# # good +# some_method(foo, bar, +# baz) +# +# source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#71 class RuboCop::Cop::Layout::FirstMethodArgumentLineBreak < ::RuboCop::Cop::Base include ::RuboCop::Cop::FirstElementLineBreak + include ::RuboCop::Cop::AllowedMethods extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#72 + # source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#78 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#72 + # source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#78 def on_send(node); end - # source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#72 + # source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#78 def on_super(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#91 + # source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#99 def ignore_last_element?; end end -# source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#70 +# source://rubocop/lib/rubocop/cop/layout/first_method_argument_line_break.rb#76 RuboCop::Cop::Layout::FirstMethodArgumentLineBreak::MSG = T.let(T.unsafe(nil), String) # Checks for a line break before the first parameter in a @@ -11751,7 +11892,7 @@ RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis::MSG = T.let(T.unsafe(ni # Checks the indentation of the here document bodies. The bodies # are indented one step. # -# Note: When ``Layout/LineLength``'s `AllowHeredoc` is false (not default), +# NOTE: When ``Layout/LineLength``'s `AllowHeredoc` is false (not default), # this cop does not add any offenses for long here documents to # avoid ``Layout/LineLength``'s offenses. # @@ -12067,13 +12208,12 @@ end # source://rubocop/lib/rubocop/cop/layout/indentation_style.rb#40 RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String) -# Checks for indentation that doesn't use the specified number -# of spaces. +# Checks for indentation that doesn't use the specified number of spaces. +# The indentation width can be configured using the `Width` setting. The default width is 2. # -# See also the IndentationConsistency cop which is the companion to this -# one. +# See also the `Layout/IndentationConsistency` cop which is the companion to this one. # -# @example +# @example Width: 2 (default) # # bad # class A # def test @@ -12106,7 +12246,7 @@ RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String) # end # end # -# source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#45 +# source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#44 class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp @@ -12116,126 +12256,126 @@ class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedPattern extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#57 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#56 def access_modifier?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#81 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#80 def on_block(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#138 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#137 def on_case(case_node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#146 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#145 def on_case_match(case_match); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#95 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#94 def on_class(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#104 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#103 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#121 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#120 def on_def(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#121 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#120 def on_defs(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#66 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#65 def on_ensure(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#66 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#65 def on_for(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#156 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#155 def on_if(node, base = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#73 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#72 def on_kwbegin(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#95 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#94 def on_module(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#81 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#80 def on_numblock(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#66 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#65 def on_resbody(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#61 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#60 def on_rescue(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#95 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#94 def on_sclass(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#104 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#103 def on_send(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#128 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#127 def on_until(node, base = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#128 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#127 def on_while(node, base = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#227 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#226 def access_modifier_indentation_style; end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#165 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#164 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#235 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#234 def check_assignment(node, rhs); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#255 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#254 def check_if(node, body, else_clause, base_loc); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#268 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#267 def check_indentation(base_loc, body_node, style = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#169 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#168 def check_members(base, members); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#193 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#192 def check_members_for_indented_internal_methods_style(members); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#199 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#198 def check_members_for_normal_style(base, members); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#341 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#340 def check_rescue?(rescue_node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#377 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#376 def configured_indentation_width; end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#207 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#206 def each_member(members); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#231 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#230 def indentation_consistency_style; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#323 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#322 def indentation_to_check?(base_loc, body_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#219 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#218 def indented_internal_methods_style?; end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#381 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#380 def leftmost_modifier_of(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#302 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#301 def message(configured_indentation_width, indentation, name); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#360 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#359 def offending_range(body_node, indentation); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#278 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#277 def offense(body_node, indentation, style); end # Returns true if the given node is within another node that has @@ -12243,29 +12383,29 @@ class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#313 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#312 def other_offense_in_same_range?(node); end - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#181 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#180 def select_check_member(member); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#345 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#344 def skip_check?(base_loc, body_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#223 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#222 def special_modifier?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#368 + # source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#367 def starts_with_access_modifier?(body_node); end end -# source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#53 +# source://rubocop/lib/rubocop/cop/layout/indentation_width.rb#52 RuboCop::Cop::Layout::IndentationWidth::MSG = T.let(T.unsafe(nil), String) # Checks for indentation of the first non-blank non-comment @@ -12310,13 +12450,15 @@ RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String) # `#:nodoc`, `=begin`- and `=end` comments, "shebang" directives, # or rackup options. # -# @example -# -# # bad -# #Some comment +# @example AllowSteepAnnotation: true # # # good -# # Some comment +# +# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer] +# list << n +# end +# +# name = 'John' #: String # @example AllowDoxygenCommentStyle: false (default) # # # bad @@ -12345,72 +12487,123 @@ RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String) # # #ruby=2.7.0 # #ruby-gemset=myproject +# @example AllowRBSInlineAnnotation: false (default) +# +# # bad +# +# include Enumerable #[Integer] +# +# attr_reader :name #: String +# attr_reader :age #: Integer? +# @example AllowRBSInlineAnnotation: true +# +# # good +# +# include Enumerable #[Integer] +# +# attr_reader :name #: String +# attr_reader :age #: Integer? +# @example AllowSteepAnnotation: false (default) +# +# # bad +# [1, 2, 3].each_with_object([]) do |n, list| #$ Array[Integer] +# list << n +# end +# +# name = 'John' #: String +# @example +# +# # bad +# #Some comment +# +# # good +# # Some comment # -# source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#52 +# source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#89 class RuboCop::Cop::Layout::LeadingCommentSpace < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#58 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#95 def on_new_investigation; end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#95 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#134 def allow_doxygen_comment?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#103 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#142 def allow_gemfile_ruby_comment?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#79 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#158 + def allow_rbs_inline_annotation?; end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#166 + def allow_steep_annotation?; end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#118 def allowed_on_first_line?(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#99 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#138 def doxygen_comment_style?(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#107 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#146 def gemfile?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#115 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#154 def gemfile_ruby_comment?(comment); end - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#75 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#114 def hash_mark(expr); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#91 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#130 def rackup_config_file?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#87 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#126 def rackup_options?(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#111 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#162 + def rbs_inline_annotation?(comment); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#150 def ruby_comment_in_gemfile?(comment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#83 + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#122 def shebang?(comment); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#170 + def steep_annotation?(comment); end end -# source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#56 +# source://rubocop/lib/rubocop/cop/layout/leading_comment_space.rb#93 RuboCop::Cop::Layout::LeadingCommentSpace::MSG = T.let(T.unsafe(nil), String) # Checks for unnecessary leading blank lines at the beginning @@ -12741,29 +12934,29 @@ RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::PARENT_TYPES_FOR_IN # split across lines. These include arrays, hashes, and # method calls with argument lists. # -# If autocorrection is enabled, the following Layout cops +# If autocorrection is enabled, the following cops # are recommended to further format the broken lines. # (Many of these are enabled by default.) # -# * ArgumentAlignment -# * ArrayAlignment -# * BlockAlignment -# * BlockDelimiters -# * BlockEndNewline -# * ClosingParenthesisIndentation -# * FirstArgumentIndentation -# * FirstArrayElementIndentation -# * FirstHashElementIndentation -# * FirstParameterIndentation -# * HashAlignment -# * IndentationWidth -# * MultilineArrayLineBreaks -# * MultilineBlockLayout -# * MultilineHashBraceLayout -# * MultilineHashKeyLineBreaks -# * MultilineMethodArgumentLineBreaks -# * MultilineMethodParameterLineBreaks -# * ParameterAlignment +# * `Layout/ArgumentAlignment` +# * `Layout/ArrayAlignment` +# * `Layout/BlockAlignment` +# * `Layout/BlockEndNewline` +# * `Layout/ClosingParenthesisIndentation` +# * `Layout/FirstArgumentIndentation` +# * `Layout/FirstArrayElementIndentation` +# * `Layout/FirstHashElementIndentation` +# * `Layout/FirstParameterIndentation` +# * `Layout/HashAlignment` +# * `Layout/IndentationWidth` +# * `Layout/MultilineArrayLineBreaks` +# * `Layout/MultilineBlockLayout` +# * `Layout/MultilineHashBraceLayout` +# * `Layout/MultilineHashKeyLineBreaks` +# * `Layout/MultilineMethodArgumentLineBreaks` +# * `Layout/MultilineMethodParameterLineBreaks` +# * `Layout//ParameterAlignment` +# * `Style/BlockDelimiters` # # Together, these cops will pretty print hashes, arrays, # method calls, etc. For example, let's say the max columns @@ -15101,44 +15294,44 @@ class RuboCop::Cop::Layout::SpaceAroundOperators < ::RuboCop::Cop::Base private - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#256 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#259 def align_hash_cop_config; end - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#195 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#198 def autocorrect(corrector, range, right_operand); end # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#179 def check_operator(type, operator, right_operand); end - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#209 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#212 def enclose_operator_with_space(corrector, range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#236 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#239 def excess_leading_space?(type, operator, with_space); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#251 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#254 def excess_trailing_space?(right_operand, with_space); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#274 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#277 def force_equal_sign_alignment?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#260 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#263 def hash_table_style?; end # @yield [msg] # - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#190 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#193 def offense(type, operator, with_space, right_operand); end - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#222 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#225 def offense_message(type, operator, with_space, right_operand); end # @return [Boolean] @@ -15153,17 +15346,17 @@ class RuboCop::Cop::Layout::SpaceAroundOperators < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#278 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#281 def should_not_have_surrounding_space?(operator, right_operand); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#264 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#267 def space_around_exponent_operator?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#268 + # source://rubocop/lib/rubocop/cop/layout/space_around_operators.rb#271 def space_around_slash_operator?(right_operand); end class << self @@ -15743,67 +15936,72 @@ class RuboCop::Cop::Layout::SpaceInsideBlockBraces < ::RuboCop::Cop::Base include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#85 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#89 def on_block(node); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#85 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#89 def on_numblock(node); end private - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#122 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#126 def adjacent_braces(left_brace, right_brace); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#161 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#165 def aligned_braces?(inner, right_brace, column); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#130 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#134 def braces_with_contents_inside(node, inner); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#105 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#109 def check_inside(node, left_brace, right_brace); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#137 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#141 def check_left_brace(inner, left_brace, args_delimiter); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#145 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#149 def check_right_brace(node, inner, left_brace, right_brace, single_line); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#165 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#169 def inner_last_space_count(inner); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#157 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#161 def multiline_block?(left_brace, right_brace); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#222 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#226 def no_space(begin_pos, end_pos, msg); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#169 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#173 def no_space_inside_left_brace(left_brace, args_delimiter); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#238 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#242 def offense(begin_pos, end_pos, msg, style_param = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#201 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#205 def pipe?(args_delimiter); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#230 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#234 def space(begin_pos, end_pos, msg); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#186 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#190 def space_inside_left_brace(left_brace, args_delimiter); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#205 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#209 def space_inside_right_brace(inner, right_brace, column); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#253 + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#257 def style_for_empty_braces; end + + class << self + # source://rubocop/lib/rubocop/cop/layout/space_inside_block_braces.rb#85 + def autocorrect_incompatible_with; end + end end # Checks that braces used for hash literals have or don't have @@ -16251,23 +16449,20 @@ class RuboCop::Cop::Layout::SpaceInsideStringInterpolation < ::RuboCop::Cop::Bas include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/layout/space_inside_string_interpolation.rb#31 + # source://rubocop/lib/rubocop/cop/layout/space_inside_string_interpolation.rb#30 def on_interpolation(begin_node); end private - # source://rubocop/lib/rubocop/cop/layout/space_inside_string_interpolation.rb#47 + # source://rubocop/lib/rubocop/cop/layout/space_inside_string_interpolation.rb#46 def autocorrect(corrector, begin_node); end - # source://rubocop/lib/rubocop/cop/layout/space_inside_string_interpolation.rb#57 + # source://rubocop/lib/rubocop/cop/layout/space_inside_string_interpolation.rb#56 def delimiters(begin_node); end end # source://rubocop/lib/rubocop/cop/layout/space_inside_string_interpolation.rb#28 -RuboCop::Cop::Layout::SpaceInsideStringInterpolation::NO_SPACE_MSG = T.let(T.unsafe(nil), String) - -# source://rubocop/lib/rubocop/cop/layout/space_inside_string_interpolation.rb#29 -RuboCop::Cop::Layout::SpaceInsideStringInterpolation::SPACE_MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Layout::SpaceInsideStringInterpolation::MSG = T.let(T.unsafe(nil), String) # Looks for trailing blank lines and a final newline in the # source code. @@ -16492,7 +16687,7 @@ class RuboCop::Cop::LineBreakCorrector # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/correctors/line_break_corrector.rb#58 + # source://rubocop/lib/rubocop/cop/correctors/line_break_corrector.rb#60 def trailing_class_definition?(token, body); end end end @@ -16537,7 +16732,7 @@ module RuboCop::Cop::LineLengthHelp # source://rubocop/lib/rubocop/cop/mixin/line_length_help.rb#32 def line_length(line); end - # source://rubocop/lib/rubocop/cop/mixin/line_length_help.rb#105 + # source://rubocop/lib/rubocop/cop/mixin/line_length_help.rb#110 def line_length_without_directive(line); end # source://rubocop/lib/rubocop/cop/mixin/line_length_help.rb#51 @@ -16551,7 +16746,7 @@ module RuboCop::Cop::LineLengthHelp # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/line_length_help.rb#98 + # source://rubocop/lib/rubocop/cop/mixin/line_length_help.rb#103 def valid_uri?(uri_ish_string); end end @@ -16620,7 +16815,6 @@ RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsaf # # # bad # some_method a { |val| puts val } -# @example # # # good # # With parentheses, there's no ambiguity. @@ -16653,38 +16847,38 @@ RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsaf # expect { do_something }.to change { object.attribute } # expect { do_something }.to not_change { object.attribute } # -# source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#54 +# source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#52 class RuboCop::Cop::Lint::AmbiguousBlockAssociation < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::AllowedPattern extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#64 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#62 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#64 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#62 def on_send(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#85 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#83 def allowed_method_pattern?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#81 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#79 def ambiguous_block_association?(send_node); end - # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#91 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#89 def message(send_node); end - # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#97 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#95 def wrap_in_parentheses(corrector, node); end end -# source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#60 +# source://rubocop/lib/rubocop/cop/lint/ambiguous_block_association.rb#58 RuboCop::Cop::Lint::AmbiguousBlockAssociation::MSG = T.let(T.unsafe(nil), String) # Checks for ambiguous operators in the first argument of a @@ -16697,51 +16891,50 @@ RuboCop::Cop::Lint::AmbiguousBlockAssociation::MSG = T.let(T.unsafe(nil), String # # The `*` is interpreted as a splat operator but it could possibly be # # a `*` method invocation (i.e. `do_something.*(some_array)`). # do_something *some_array -# @example # # # good # # # With parentheses, there's no ambiguity. # do_something(*some_array) # -# source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#23 +# source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#21 class RuboCop::Cop::Lint::AmbiguousOperator < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#45 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#43 def on_new_investigation; end private - # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#64 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#62 def find_offense_node_by(diagnostic); end - # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#82 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#80 def message(diagnostic); end - # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#92 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#90 def offense_node(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#88 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#86 def offense_position?(node, diagnostic); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#101 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#99 def unary_operator?(node, diagnostic); end class << self - # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#41 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#39 def autocorrect_incompatible_with; end end end -# source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#26 +# source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#24 RuboCop::Cop::Lint::AmbiguousOperator::AMBIGUITIES = T.let(T.unsafe(nil), Hash) -# source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#36 +# source://rubocop/lib/rubocop/cop/lint/ambiguous_operator.rb#34 RuboCop::Cop::Lint::AmbiguousOperator::MSG_FORMAT = T.let(T.unsafe(nil), String) # Looks for expressions containing multiple binary operators @@ -16862,38 +17055,39 @@ RuboCop::Cop::Lint::AmbiguousOperatorPrecedence::RESTRICT_ON_SEND = T.let(T.unsa # # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#59 class RuboCop::Cop::Lint::AmbiguousRange < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RationalLiteral extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#64 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#65 def on_erange(node); end - # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#64 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#65 def on_irange(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#82 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#84 def acceptable?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#89 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#92 def acceptable_call?(node); end # @yield [range.begin] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#77 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#78 def each_boundary(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#99 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#102 def require_parentheses_for_method_chain?; end end -# source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#62 +# source://rubocop/lib/rubocop/cop/lint/ambiguous_range.rb#63 RuboCop::Cop::Lint::AmbiguousRange::MSG = T.let(T.unsafe(nil), String) # Checks for ambiguous regexp literals in the first argument of @@ -16907,40 +17101,39 @@ RuboCop::Cop::Lint::AmbiguousRange::MSG = T.let(T.unsafe(nil), String) # # but it could possibly be `/` method invocations. # # (i.e. `do_something./(pattern)./(i)`) # do_something /pattern/i -# @example # # # good # # # With parentheses, there's no ambiguity. # do_something(/pattern/i) # -# source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#24 +# source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#22 class RuboCop::Cop::Lint::AmbiguousRegexpLiteral < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#31 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#29 def on_new_investigation; end private - # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#56 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#54 def find_offense_node(node, regexp_receiver); end - # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#49 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#47 def find_offense_node_by(diagnostic); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#67 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#65 def first_argument_is_regexp?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#71 + # source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#69 def method_chain_to_regexp_receiver?(node, regexp_receiver); end end -# source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#27 +# source://rubocop/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#25 RuboCop::Cop::Lint::AmbiguousRegexpLiteral::MSG = T.let(T.unsafe(nil), String) # Checks for assignments in the conditions of @@ -17034,17 +17227,17 @@ RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITH_SAFE_ASSIGNMENT_ALLOWED = T. class RuboCop::Cop::Lint::BigDecimalNew < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/big_decimal_new.rb#25 + # source://rubocop/lib/rubocop/cop/lint/big_decimal_new.rb#24 def big_decimal_new(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/big_decimal_new.rb#30 + # source://rubocop/lib/rubocop/cop/lint/big_decimal_new.rb#29 def on_send(node); end end # source://rubocop/lib/rubocop/cop/lint/big_decimal_new.rb#20 RuboCop::Cop::Lint::BigDecimalNew::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/big_decimal_new.rb#22 +# source://rubocop/lib/rubocop/cop/lint/big_decimal_new.rb#21 RuboCop::Cop::Lint::BigDecimalNew::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for places where binary operator has identical operands. @@ -17106,7 +17299,6 @@ RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(ni # # # good # true -# @example # # # bad # :false @@ -17114,23 +17306,23 @@ RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(ni # # good # false # -# source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#29 +# source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#27 class RuboCop::Cop::Lint::BooleanSymbol < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#35 + # source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#33 def boolean_symbol?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#37 + # source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#35 def on_sym(node); end private - # source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#50 + # source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#48 def autocorrect(corrector, node); end end -# source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#32 +# source://rubocop/lib/rubocop/cop/lint/boolean_symbol.rb#30 RuboCop::Cop::Lint::BooleanSymbol::MSG = T.let(T.unsafe(nil), String) # Checks for circular argument references in optional keyword @@ -17141,54 +17333,45 @@ RuboCop::Cop::Lint::BooleanSymbol::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # def bake(pie: pie) # pie.heat_up # end -# @example # # # good -# # def bake(pie:) # pie.refrigerate # end -# @example # # # good -# # def bake(pie: self.pie) # pie.feed_to(user) # end -# @example # # # bad -# # def cook(dry_ingredients = dry_ingredients) # dry_ingredients.reduce(&:+) # end -# @example # # # good -# # def cook(dry_ingredients = self.dry_ingredients) # dry_ingredients.combine # end # -# source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#50 +# source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#37 class RuboCop::Cop::Lint::CircularArgumentReference < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#53 + # source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#40 def on_kwoptarg(node); end - # source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#57 + # source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#44 def on_optarg(node); end private - # source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#63 + # source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#50 def check_for_circular_argument_references(arg_name, arg_value); end end -# source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#51 +# source://rubocop/lib/rubocop/cop/lint/circular_argument_reference.rb#38 RuboCop::Cop::Lint::CircularArgumentReference::MSG = T.let(T.unsafe(nil), String) # Do not define constants within a block, since the block's scope does not @@ -17435,7 +17618,6 @@ RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) # binding.pry # do_something # end -# @example # # # bad (ok during development) # @@ -17444,7 +17626,6 @@ RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) # byebug # do_something # end -# @example # # # good # @@ -17464,50 +17645,50 @@ RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) # # require 'my_debugger/start' # -# source://rubocop/lib/rubocop/cop/lint/debugger.rb#78 +# source://rubocop/lib/rubocop/cop/lint/debugger.rb#74 class RuboCop::Cop::Lint::Debugger < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#82 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#78 def on_send(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#142 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#138 def assumed_argument?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#121 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#117 def assumed_usage_context?(node); end - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#131 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#127 def chained_method_name(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#108 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#104 def debugger_method?(send_node); end - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#94 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#90 def debugger_methods; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#114 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#110 def debugger_require?(send_node); end - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#101 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#97 def debugger_requires; end - # source://rubocop/lib/rubocop/cop/lint/debugger.rb#90 + # source://rubocop/lib/rubocop/cop/lint/debugger.rb#86 def message(node); end end -# source://rubocop/lib/rubocop/cop/lint/debugger.rb#80 +# source://rubocop/lib/rubocop/cop/lint/debugger.rb#76 RuboCop::Cop::Lint::Debugger::BLOCK_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/debugger.rb#79 +# source://rubocop/lib/rubocop/cop/lint/debugger.rb#75 RuboCop::Cop::Lint::Debugger::MSG = T.let(T.unsafe(nil), String) # Checks for uses of the deprecated class method usages. @@ -17644,25 +17825,17 @@ RuboCop::Cop::Lint::DeprecatedConstants::SUGGEST_GOOD_MSG = T.let(T.unsafe(nil), # # @example # -# # Example for OpenSSL::Cipher instantiation. -# # # bad # OpenSSL::Cipher::AES.new(128, :GCM) # # # good # OpenSSL::Cipher.new('aes-128-gcm') -# @example -# -# # Example for OpenSSL::Digest instantiation. # # # bad # OpenSSL::Digest::SHA256.new # # # good # OpenSSL::Digest.new('SHA256') -# @example -# -# # Example for ::Digest inherited class methods. # # # bad # OpenSSL::Digest::SHA256.digest('foo') @@ -17670,51 +17843,51 @@ RuboCop::Cop::Lint::DeprecatedConstants::SUGGEST_GOOD_MSG = T.let(T.unsafe(nil), # # good # OpenSSL::Digest.digest('SHA256', 'foo') # -# source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#40 +# source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#30 class RuboCop::Cop::Lint::DeprecatedOpenSSLConstant < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#49 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#39 def algorithm_const(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#59 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#49 def digest_const?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#63 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#53 def on_send(node); end private - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#110 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#100 def algorithm_name(node); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#75 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#65 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#139 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#129 def build_cipher_arguments(node, algorithm_name, no_arguments); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#102 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#92 def correction_range(node); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#87 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#77 def message(node); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#106 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#96 def openssl_class(node); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#128 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#118 def replacement_args(node); end - # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#120 + # source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#110 def sanitize_arguments(arguments); end end -# source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#44 +# source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#34 RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#46 +# source://rubocop/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#36 RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::NO_ARG_ALGORITHM = T.let(T.unsafe(nil), Array) # Checks constructors for disjunctive assignments (`||=`) that should @@ -17785,6 +17958,9 @@ RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil # With `IgnoreConstantBranches: true`, branches are not registered # as offenses if they return a constant value. # +# With `IgnoreDuplicateElseBranch: true`, in conditionals with multiple branches, +# duplicate 'else' branches are not registered as offenses. +# # @example # # bad # if foo @@ -17850,59 +18026,78 @@ RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil # when "large" then LARGE_SIZE # else MEDIUM_SIZE # end +# @example IgnoreDuplicateElseBranch: true +# # good +# if foo +# do_foo +# elsif bar +# do_bar +# else +# do_foo +# end # -# source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#86 +# source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#99 class RuboCop::Cop::Lint::DuplicateBranch < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#102 def on_branching_statement(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#102 def on_case(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#102 def on_case_match(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#114 def on_if(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#102 def on_rescue(node); end private - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#117 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#136 def branches(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#121 - def consider_branch?(branch); end + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#140 + def consider_branch?(branches, branch); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#147 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#174 def const_branch?(branch); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#132 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#178 + def duplicate_else_branch?(branches, branch); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#155 def ignore_constant_branches?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#128 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#159 + def ignore_duplicate_else_branches?; end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#151 def ignore_literal_branches?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#136 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#163 def literal_branch?(branch); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#103 + # source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#122 def offense_range(duplicate_branch); end end -# source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#87 +# source://rubocop/lib/rubocop/cop/lint/duplicate_branch.rb#100 RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String) # Checks that there are no repeated conditions @@ -17911,17 +18106,14 @@ RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # case x # when 'first' # do_something # when 'first' # do_something_else # end -# @example # # # good -# # case x # when 'first' # do_something @@ -17929,13 +18121,13 @@ RuboCop::Cop::Lint::DuplicateBranch::MSG = T.let(T.unsafe(nil), String) # do_something_else # end # -# source://rubocop/lib/rubocop/cop/lint/duplicate_case_condition.rb#30 +# source://rubocop/lib/rubocop/cop/lint/duplicate_case_condition.rb#26 class RuboCop::Cop::Lint::DuplicateCaseCondition < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/duplicate_case_condition.rb#33 + # source://rubocop/lib/rubocop/cop/lint/duplicate_case_condition.rb#29 def on_case(case_node); end end -# source://rubocop/lib/rubocop/cop/lint/duplicate_case_condition.rb#31 +# source://rubocop/lib/rubocop/cop/lint/duplicate_case_condition.rb#27 RuboCop::Cop::Lint::DuplicateCaseCondition::MSG = T.let(T.unsafe(nil), String) # Checks that there are no repeated conditions used in if 'elsif'. @@ -17972,23 +18164,20 @@ RuboCop::Cop::Lint::DuplicateElsifCondition::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # hash = { food: 'apple', food: 'orange' } -# @example # # # good -# # hash = { food: 'apple', other_food: 'orange' } # -# source://rubocop/lib/rubocop/cop/lint/duplicate_hash_key.rb#22 +# source://rubocop/lib/rubocop/cop/lint/duplicate_hash_key.rb#18 class RuboCop::Cop::Lint::DuplicateHashKey < ::RuboCop::Cop::Base include ::RuboCop::Cop::Duplication - # source://rubocop/lib/rubocop/cop/lint/duplicate_hash_key.rb#27 + # source://rubocop/lib/rubocop/cop/lint/duplicate_hash_key.rb#23 def on_hash(node); end end -# source://rubocop/lib/rubocop/cop/lint/duplicate_hash_key.rb#25 +# source://rubocop/lib/rubocop/cop/lint/duplicate_hash_key.rb#21 RuboCop::Cop::Lint::DuplicateHashKey::MSG = T.let(T.unsafe(nil), String) # Checks for duplicated magic comments. @@ -18140,7 +18329,6 @@ RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # def foo # 1 # end @@ -18148,19 +18336,15 @@ RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String) # def foo # 2 # end -# @example # # # bad -# # def foo # 1 # end # # alias foo bar -# @example # # # good -# # def foo # 1 # end @@ -18168,98 +18352,96 @@ RuboCop::Cop::Lint::DuplicateMatchPattern::MSG = T.let(T.unsafe(nil), String) # def bar # 2 # end -# @example # # # good -# # def foo # 1 # end # # alias bar foo # -# source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#52 +# source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#42 class RuboCop::Cop::Lint::DuplicateMethods < ::RuboCop::Cop::Base # @return [DuplicateMethods] a new instance of DuplicateMethods # - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#57 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#47 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#98 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#88 def alias_method?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#85 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#75 def method_alias?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#89 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#79 def on_alias(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#63 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#53 def on_def(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#72 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#62 def on_defs(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#104 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#94 def on_send(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#103 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#93 def sym_name(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#117 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#107 def check_const_receiver(node, name, const_name); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#124 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#114 def check_self_receiver(node, name); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#208 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#198 def found_attr(node, args, readable: T.unsafe(nil), writable: T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#136 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#126 def found_instance_method(node, name); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#159 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#149 def found_method(node, method_name); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#149 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#139 def found_sclass_method(node, name); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#186 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#176 def location(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#218 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#208 def lookup_constant(node, const_name); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#131 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#121 def message_for_dup(node, method_name, key); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#178 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#168 def method_key(node, method_name); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#194 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#184 def on_attr(node, attr_name, args); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#250 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#240 def possible_dsl?(node); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#236 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#226 def qualified_name(enclosing, namespace, mod_name); end - # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#260 + # source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#250 def source_location(node); end end -# source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#55 +# source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#45 RuboCop::Cop::Lint::DuplicateMethods::DEF_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#53 +# source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#43 RuboCop::Cop::Lint::DuplicateMethods::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#54 +# source://rubocop/lib/rubocop/cop/lint/duplicate_methods.rb#44 RuboCop::Cop::Lint::DuplicateMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for duplicate elements in Regexp character classes. @@ -18407,6 +18589,53 @@ end # source://rubocop/lib/rubocop/cop/lint/duplicate_rescue_exception.rb#31 RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String) +# Checks for duplicate literal, constant, or variable elements in Set. +# +# @example +# +# # bad +# Set[:foo, :bar, :foo] +# +# # good +# Set[:foo, :bar] +# +# # bad +# Set.new([:foo, :bar, :foo]) +# +# # good +# Set.new([:foo, :bar]) +# +# # bad +# [:foo, :bar, :foo].to_set +# +# # good +# [:foo, :bar].to_set +# +# source://rubocop/lib/rubocop/cop/lint/duplicate_set_element.rb#28 +class RuboCop::Cop::Lint::DuplicateSetElement < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/lint/duplicate_set_element.rb#43 + def on_csend(node); end + + # source://rubocop/lib/rubocop/cop/lint/duplicate_set_element.rb#43 + def on_send(node); end + + # source://rubocop/lib/rubocop/cop/lint/duplicate_set_element.rb#35 + def set_init_elements(param0 = T.unsafe(nil)); end + + private + + # source://rubocop/lib/rubocop/cop/lint/duplicate_set_element.rb#64 + def register_offense(current_element, prev_element); end +end + +# source://rubocop/lib/rubocop/cop/lint/duplicate_set_element.rb#31 +RuboCop::Cop::Lint::DuplicateSetElement::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/lint/duplicate_set_element.rb#32 +RuboCop::Cop::Lint::DuplicateSetElement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks if each_with_object is called with an immutable # argument. Since the argument is the object that the given block shall # make calls on to build something based on the enumerable that @@ -18416,31 +18645,28 @@ RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # sum = numbers.each_with_object(0) { |e, a| a += e } -# @example # # # good -# # num = 0 # sum = numbers.each_with_object(num) { |e, a| a += e } # -# source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#24 +# source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#20 class RuboCop::Cop::Lint::EachWithObjectArgument < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#29 + # source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#25 def each_with_object?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#33 + # source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#29 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#33 + # source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#29 def on_send(node); end end -# source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#25 +# source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#21 RuboCop::Cop::Lint::EachWithObjectArgument::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#26 +# source://rubocop/lib/rubocop/cop/lint/each_with_object_argument.rb#22 RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for odd `else` block layout - like @@ -18460,7 +18686,6 @@ RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(ni # else do_this # do_that # end -# @example # # # good # @@ -18480,28 +18705,28 @@ RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(ni # do_that # end # -# source://rubocop/lib/rubocop/cop/lint/else_layout.rb#43 +# source://rubocop/lib/rubocop/cop/lint/else_layout.rb#41 class RuboCop::Cop::Lint::ElseLayout < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/else_layout.rb#50 + # source://rubocop/lib/rubocop/cop/lint/else_layout.rb#48 def on_if(node); end private - # source://rubocop/lib/rubocop/cop/lint/else_layout.rb#81 + # source://rubocop/lib/rubocop/cop/lint/else_layout.rb#79 def autocorrect(corrector, node, first_else); end - # source://rubocop/lib/rubocop/cop/lint/else_layout.rb#61 + # source://rubocop/lib/rubocop/cop/lint/else_layout.rb#59 def check(node); end - # source://rubocop/lib/rubocop/cop/lint/else_layout.rb#71 + # source://rubocop/lib/rubocop/cop/lint/else_layout.rb#69 def check_else(node); end end -# source://rubocop/lib/rubocop/cop/lint/else_layout.rb#48 +# source://rubocop/lib/rubocop/cop/lint/else_layout.rb#46 RuboCop::Cop::Lint::ElseLayout::MSG = T.let(T.unsafe(nil), String) # Checks for blocks without a body. @@ -18725,104 +18950,100 @@ class RuboCop::Cop::Lint::EmptyConditionalBody < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#70 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#71 def on_if(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#156 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#177 def all_branches_body_missing?(node); end - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#83 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#95 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#142 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#163 def branch_range(node); end - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#104 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#125 def correct_other_branches(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#162 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#183 def deletion_range(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#137 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#158 def else_branch?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#131 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#152 def empty_elsif_branch?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#123 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#144 def empty_if_branch?(node); end - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#89 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#87 + def offense_range(node); end + + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#101 def remove_comments(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#96 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#109 def remove_empty_branch(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#116 + # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#137 def require_other_branches_correction?(node); end end # source://rubocop/lib/rubocop/cop/lint/empty_conditional_body.rb#68 RuboCop::Cop::Lint::EmptyConditionalBody::MSG = T.let(T.unsafe(nil), String) -# Checks for empty `ensure` blocks +# Checks for empty `ensure` blocks. # # @example # # # bad -# # def some_method # do_something # ensure # end -# @example # # # bad -# # begin # do_something # ensure # end -# @example # # # good -# # def some_method # do_something # ensure # do_something_else # end -# @example # # # good -# # begin # do_something # ensure # do_something_else # end # -# source://rubocop/lib/rubocop/cop/lint/empty_ensure.rb#45 +# source://rubocop/lib/rubocop/cop/lint/empty_ensure.rb#35 class RuboCop::Cop::Lint::EmptyEnsure < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/empty_ensure.rb#50 + # source://rubocop/lib/rubocop/cop/lint/empty_ensure.rb#40 def on_ensure(node); end end -# source://rubocop/lib/rubocop/cop/lint/empty_ensure.rb#48 +# source://rubocop/lib/rubocop/cop/lint/empty_ensure.rb#38 RuboCop::Cop::Lint::EmptyEnsure::MSG = T.let(T.unsafe(nil), String) # Checks for the presence of empty expressions. @@ -18957,24 +19178,21 @@ RuboCop::Cop::Lint::EmptyInPattern::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # "result is #{}" -# @example # # # good -# # "result is #{some_result}" # -# source://rubocop/lib/rubocop/cop/lint/empty_interpolation.rb#19 +# source://rubocop/lib/rubocop/cop/lint/empty_interpolation.rb#15 class RuboCop::Cop::Lint::EmptyInterpolation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Interpolation extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/empty_interpolation.rb#25 + # source://rubocop/lib/rubocop/cop/lint/empty_interpolation.rb#21 def on_interpolation(begin_node); end end -# source://rubocop/lib/rubocop/cop/lint/empty_interpolation.rb#23 +# source://rubocop/lib/rubocop/cop/lint/empty_interpolation.rb#19 RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String) # Checks for the presence of `when` branches without a body. @@ -18987,7 +19205,6 @@ RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String) # do_something # when baz # end -# @example # # # good # case condition @@ -19015,15 +19232,15 @@ RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String) # # do nothing # end # -# source://rubocop/lib/rubocop/cop/lint/empty_when.rb#47 +# source://rubocop/lib/rubocop/cop/lint/empty_when.rb#45 class RuboCop::Cop::Lint::EmptyWhen < ::RuboCop::Cop::Base include ::RuboCop::Cop::CommentsHelp - # source://rubocop/lib/rubocop/cop/lint/empty_when.rb#52 + # source://rubocop/lib/rubocop/cop/lint/empty_when.rb#50 def on_case(node); end end -# source://rubocop/lib/rubocop/cop/lint/empty_when.rb#50 +# source://rubocop/lib/rubocop/cop/lint/empty_when.rb#48 RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String) # Checks for `return` from an `ensure` block. @@ -19036,17 +19253,14 @@ RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # def foo # do_something # ensure # cleanup # return self # end -# @example # # # good -# # def foo # do_something # self @@ -19054,8 +19268,7 @@ RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String) # cleanup # end # -# # also good -# +# # good # def foo # begin # do_something @@ -19067,16 +19280,13 @@ RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String) # cleanup # end # -# source://rubocop/lib/rubocop/cop/lint/ensure_return.rb#47 +# source://rubocop/lib/rubocop/cop/lint/ensure_return.rb#42 class RuboCop::Cop::Lint::EnsureReturn < ::RuboCop::Cop::Base - include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::AutoCorrector - - # source://rubocop/lib/rubocop/cop/lint/ensure_return.rb#53 + # source://rubocop/lib/rubocop/cop/lint/ensure_return.rb#45 def on_ensure(node); end end -# source://rubocop/lib/rubocop/cop/lint/ensure_return.rb#51 +# source://rubocop/lib/rubocop/cop/lint/ensure_return.rb#43 RuboCop::Cop::Lint::EnsureReturn::MSG = T.let(T.unsafe(nil), String) # Emulates the following Ruby warnings in Ruby 2.6. @@ -19140,36 +19350,45 @@ class RuboCop::Cop::Lint::ErbNewArguments < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#83 + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#81 def erb_new_with_non_keyword_arguments(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#88 + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#86 def on_send(node); end private - # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#153 + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#160 def arguments_range(node); end - # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#108 + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#115 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#123 + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#130 def build_kwargs(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#119 + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#126 def correct_arguments?(arguments); end - # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#140 + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#104 + def message(positional_argument_index, arg_value); end + + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#147 def override_by_legacy_args(kwargs, node); end end +# source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#74 +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_EOUTVAR = T.let(T.unsafe(nil), String) + # source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#68 -RuboCop::Cop::Lint::ErbNewArguments::MESSAGES = T.let(T.unsafe(nil), Array) +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_SAFE_LEVEL = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#80 +# source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#71 +RuboCop::Cop::Lint::ErbNewArguments::MESSAGE_TRIM_MODE = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/lint/erb_new_arguments.rb#78 RuboCop::Cop::Lint::ErbNewArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Looks for uses of flip-flop operator @@ -19211,7 +19430,15 @@ RuboCop::Cop::Lint::FlipFlop::MSG = T.let(T.unsafe(nil), String) # floating-point value representation to be exactly the same, which is very unlikely # if you perform any arithmetic operations involving precision loss. # -# # good - comparing against zero +# @example +# # bad +# x == 0.1 +# x != 0.1 +# +# # good - using BigDecimal +# x.to_d == 0.1.to_d +# +# # good - comparing against zero # x == 0.0 # x != 0.0 # @@ -19225,14 +19452,6 @@ RuboCop::Cop::Lint::FlipFlop::MSG = T.let(T.unsafe(nil), String) # # Or some other epsilon based type of comparison: # # https://www.embeddeduse.com/2019/08/26/qt-compare-two-floats/ # -# @example -# # bad -# x == 0.1 -# x != 0.1 -# -# # good - using BigDecimal -# x.to_d == 0.1.to_d -# # source://rubocop/lib/rubocop/cop/lint/float_comparison.rb#35 class RuboCop::Cop::Lint::FloatComparison < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/lint/float_comparison.rb#44 @@ -19279,21 +19498,18 @@ RuboCop::Cop::Lint::FloatComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr # @example # # # bad -# # float = 3.0e400 -# @example # # # good -# # float = 42.9 # -# source://rubocop/lib/rubocop/cop/lint/float_out_of_range.rb#21 +# source://rubocop/lib/rubocop/cop/lint/float_out_of_range.rb#17 class RuboCop::Cop::Lint::FloatOutOfRange < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/float_out_of_range.rb#24 + # source://rubocop/lib/rubocop/cop/lint/float_out_of_range.rb#20 def on_float(node); end end -# source://rubocop/lib/rubocop/cop/lint/float_out_of_range.rb#22 +# source://rubocop/lib/rubocop/cop/lint/float_out_of_range.rb#18 RuboCop::Cop::Lint::FloatOutOfRange::MSG = T.let(T.unsafe(nil), String) # This lint sees if there is a mismatch between the number of @@ -19307,138 +19523,131 @@ RuboCop::Cop::Lint::FloatOutOfRange::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # format('A value: %s and another: %i', a_value) -# @example # # # good -# # format('A value: %s and another: %i', a_value, another) -# @example # # # bad -# # format('Unnumbered format: %s and numbered: %2$s', a_value, another) -# @example # # # good -# # format('Numbered format: %1$s and numbered %2$s', a_value, another) # -# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#37 +# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#27 class RuboCop::Cop::Lint::FormatParameterMismatch < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#100 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#90 def called_on_string?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#49 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#39 def on_send(node); end private - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#137 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#127 def count_format_matches(node); end - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#119 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#109 def count_matches(node); end - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#141 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#131 def count_percent_matches(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#129 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#119 def countable_format?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#133 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#123 def countable_percent?(node); end - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#153 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#143 def expected_fields_count(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#168 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#158 def format?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#146 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#136 def format_method?(name, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#64 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#54 def format_string?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#115 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#105 def heredoc?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#68 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#58 def invalid_format_string?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#91 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#81 def matched_arguments_count?(expected, passed); end - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#186 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#176 def message(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#105 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#95 def method_with_format_args?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#77 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#67 def offending_node?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#176 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#166 def percent?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#109 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#99 def splat_args?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#172 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#162 def sprintf?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#195 + # source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#185 def string_type?(node); end end -# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#44 +# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#34 RuboCop::Cop::Lint::FormatParameterMismatch::KERNEL = T.let(T.unsafe(nil), String) # http://rubular.com/r/CvpbxkcTzy # -# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#39 +# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#29 RuboCop::Cop::Lint::FormatParameterMismatch::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#41 +# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#31 RuboCop::Cop::Lint::FormatParameterMismatch::MSG_INVALID = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#47 +# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#37 RuboCop::Cop::Lint::FormatParameterMismatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#45 +# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#35 RuboCop::Cop::Lint::FormatParameterMismatch::SHOVEL = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#46 +# source://rubocop/lib/rubocop/cop/lint/format_parameter_mismatch.rb#36 RuboCop::Cop::Lint::FormatParameterMismatch::STRING_TYPES = T.let(T.unsafe(nil), Array) # Prefer using `Hash#compare_by_identity` rather than using `object_id` @@ -19618,12 +19827,9 @@ RuboCop::Cop::Lint::IdentityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), # @example # # # bad -# # array = ['Item 1' 'Item 2'] -# @example # # # good -# # array = ['Item 1Item 2'] # array = ['Item 1' + 'Item 2'] # array = [ @@ -19631,43 +19837,45 @@ RuboCop::Cop::Lint::IdentityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), # 'Item 2' # ] # -# source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#25 +# source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#21 class RuboCop::Cop::Lint::ImplicitStringConcatenation < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#33 + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#32 def on_dstr(node); end private - # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#83 + # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#92 def display_str(node); end - # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#50 + # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#59 def each_bad_cons(node); end - # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#65 + # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#74 def ending_delimiter(str); end - # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#91 + # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#100 def str_content(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#75 + # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#84 def string_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#79 + # source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#88 def string_literals?(node1, node2); end end -# source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#28 +# source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#26 RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_ARRAY = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#30 +# source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#28 RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_METHOD = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#26 +# source://rubocop/lib/rubocop/cop/lint/implicit_string_concatenation.rb#24 RuboCop::Cop::Lint::ImplicitStringConcatenation::MSG = T.let(T.unsafe(nil), String) # Checks for `IO.select` that is incompatible with Fiber Scheduler since Ruby 3.0. @@ -19729,7 +19937,6 @@ RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T # @example # # # bad -# # class C # private # @@ -19737,10 +19944,8 @@ RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T # puts 'hi' # end # end -# @example # # # good -# # class C # def self.method # puts 'hi' @@ -19748,10 +19953,8 @@ RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T # # private_class_method :method # end -# @example # # # good -# # class C # class << self # private @@ -19762,49 +19965,49 @@ RuboCop::Cop::Lint::IncompatibleIoSelectWithFiberScheduler::RESTRICT_ON_SEND = T # end # end # -# source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#48 +# source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#41 class RuboCop::Cop::Lint::IneffectiveAccessModifier < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#59 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#52 def on_class(node); end - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#59 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#52 def on_module(node); end - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#55 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#48 def private_class_methods(param0); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#109 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#102 def access_modifier?(node); end - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#66 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#59 def check_node(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#113 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#106 def correct_visibility?(node, modifier, ignored_methods); end - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#78 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#71 def format_message(modifier); end - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#91 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#84 def ineffective_modifier(node, ignored_methods = T.unsafe(nil), modifier = T.unsafe(nil), &block); end - # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#74 + # source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#67 def private_class_method_names(node); end end -# source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#51 +# source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#44 RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PRIVATE = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#52 +# source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#45 RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PROTECTED = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#49 +# source://rubocop/lib/rubocop/cop/lint/ineffective_access_modifier.rb#42 RuboCop::Cop::Lint::IneffectiveAccessModifier::MSG = T.let(T.unsafe(nil), String) # Looks for error classes inheriting from `Exception`. @@ -19883,33 +20086,30 @@ RuboCop::Cop::Lint::InheritException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Ar # @example # # # bad -# # foo = 'something with #{interpolation} inside' -# @example # # # good -# # foo = "something with #{interpolation} inside" # -# source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#25 +# source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#21 class RuboCop::Cop::Lint::InterpolationCheck < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#31 + # source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#27 def on_str(node); end private - # source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#42 + # source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#38 def autocorrect(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#53 + # source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#49 def heredoc?(node); end end -# source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#28 +# source://rubocop/lib/rubocop/cop/lint/interpolation_check.rb#24 RuboCop::Cop::Lint::InterpolationCheck::MSG = T.let(T.unsafe(nil), String) # Emulates the following Ruby warning in Ruby 3.3. @@ -19939,16 +20139,19 @@ class RuboCop::Cop::Lint::ItWithoutArgumentsInBlock < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/it_without_arguments_in_block.rb#48 + # source://rubocop/lib/rubocop/cop/lint/it_without_arguments_in_block.rb#41 def deprecated_it_method?(node); end - # source://rubocop/lib/rubocop/cop/lint/it_without_arguments_in_block.rb#33 - def on_block(node); end + # source://rubocop/lib/rubocop/cop/lint/it_without_arguments_in_block.rb#34 + def on_send(node); end end # source://rubocop/lib/rubocop/cop/lint/it_without_arguments_in_block.rb#30 RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::MSG = T.let(T.unsafe(nil), String) +# source://rubocop/lib/rubocop/cop/lint/it_without_arguments_in_block.rb#32 +RuboCop::Cop::Lint::ItWithoutArgumentsInBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks uses of lambda without a literal block. # It emulates the following warning in Ruby 3.0: # @@ -20152,84 +20355,84 @@ RuboCop::Cop::Lint::LiteralAssignmentInCondition::MSG = T.let(T.unsafe(nil), Str # @example # # # bad -# # "result is #{10}" -# @example # # # good -# # "result is 10" # -# source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#19 +# source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#15 class RuboCop::Cop::Lint::LiteralInInterpolation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Interpolation include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#28 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#24 def on_interpolation(begin_node); end private - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#62 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#60 def autocorrected_value(node); end - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#108 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#127 def autocorrected_value_for_array(node); end - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#114 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#133 def autocorrected_value_for_hash(node); end - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#84 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#103 def autocorrected_value_for_string(node); end - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#92 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#111 def autocorrected_value_for_symbol(node); end - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#125 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#144 def autocorrected_value_in_hash(node); end - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#99 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#118 def autocorrected_value_in_hash_for_symbol(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#155 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#174 def ends_heredoc_line?(node); end + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#82 + def handle_special_regexp_chars(begin_node, value); end + # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#163 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#182 def in_array_percent_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#48 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#46 def offending?(node); end # Does node print its own source when converted to a string? # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#146 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#165 def prints_as_self?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#151 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#170 def space_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#56 + # source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#54 def special_keyword?(node); end end -# source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#26 +# source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#22 RuboCop::Cop::Lint::LiteralInInterpolation::COMPOSITE = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#25 +# source://rubocop/lib/rubocop/cop/lint/literal_in_interpolation.rb#21 RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String) # Checks for uses of `begin...end while/until something`. @@ -20242,15 +20445,6 @@ RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String) # begin # do_something # end while some_condition -# @example -# -# # bad -# -# # using until -# begin -# do_something -# end until some_condition -# @example # # # good # @@ -20259,7 +20453,13 @@ RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String) # do_something # break unless some_condition # end -# @example +# +# # bad +# +# # using until +# begin +# do_something +# end until some_condition # # # good # @@ -20269,29 +20469,29 @@ RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String) # break if some_condition # end # -# source://rubocop/lib/rubocop/cop/lint/loop.rb#50 +# source://rubocop/lib/rubocop/cop/lint/loop.rb#44 class RuboCop::Cop::Lint::Loop < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/loop.rb#59 + # source://rubocop/lib/rubocop/cop/lint/loop.rb#53 def on_until_post(node); end - # source://rubocop/lib/rubocop/cop/lint/loop.rb#55 + # source://rubocop/lib/rubocop/cop/lint/loop.rb#49 def on_while_post(node); end private - # source://rubocop/lib/rubocop/cop/lint/loop.rb#79 + # source://rubocop/lib/rubocop/cop/lint/loop.rb#73 def build_break_line(node); end - # source://rubocop/lib/rubocop/cop/lint/loop.rb#75 + # source://rubocop/lib/rubocop/cop/lint/loop.rb#69 def keyword_and_condition_range(node); end - # source://rubocop/lib/rubocop/cop/lint/loop.rb#65 + # source://rubocop/lib/rubocop/cop/lint/loop.rb#59 def register_offense(node); end end -# source://rubocop/lib/rubocop/cop/lint/loop.rb#53 +# source://rubocop/lib/rubocop/cop/lint/loop.rb#47 RuboCop::Cop::Lint::Loop::MSG = T.let(T.unsafe(nil), String) # cop disables on wide ranges of code, that latter contributors to @@ -20637,15 +20837,17 @@ RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe # Checks for nested method definitions. # -# @example AllowedPatterns: ['baz'] -# # good -# def foo(obj) -# obj.do_baz do +# @example +# +# # bad +# +# # `bar` definition actually produces methods in the same scope +# # as the outer `foo` method. Furthermore, the `bar` method +# # will be redefined every time `foo` is invoked. +# def foo # def bar # end # end -# end -# @example # # # good # @@ -20653,7 +20855,6 @@ RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe # bar = -> { puts 'hello' } # bar.call # end -# @example # # # good # @@ -20673,7 +20874,6 @@ RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe # end # end # end -# @example # # # good # @@ -20707,49 +20907,46 @@ RuboCop::Cop::Lint::MultipleComparison::SET_OPERATION_OPERATORS = T.let(T.unsafe # end # end # end -# @example -# -# # bad -# -# # `bar` definition actually produces methods in the same scope -# # as the outer `foo` method. Furthermore, the `bar` method -# # will be redefined every time `foo` is invoked. -# def foo +# @example AllowedPatterns: ['baz'] +# # good +# def foo(obj) +# obj.do_baz do # def bar # end # end +# end # -# source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#97 +# source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#91 class RuboCop::Cop::Lint::NestedMethodDefinition < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::AllowedPattern - # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#133 + # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#127 def eval_call?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#138 + # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#132 def exec_call?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#103 + # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#97 def on_def(node); end - # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#103 + # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#97 def on_defs(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#126 + # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#120 def allowed_method_name?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#121 + # source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#115 def scoping_method_call?(child); end end -# source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#101 +# source://rubocop/lib/rubocop/cop/lint/nested_method_definition.rb#95 RuboCop::Cop::Lint::NestedMethodDefinition::MSG = T.let(T.unsafe(nil), String) # Checks for nested percent literals. @@ -20815,38 +21012,35 @@ RuboCop::Cop::Lint::NestedPercentLiteral::REGEXES = T.let(T.unsafe(nil), Array) # @example # # # bad -# # result = (1..4).reduce(0) do |acc, i| # next if i.odd? # acc + i # end -# @example # # # good -# # result = (1..4).reduce(0) do |acc, i| # next acc if i.odd? # acc + i # end # -# source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#25 +# source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#21 class RuboCop::Cop::Lint::NextWithoutAccumulator < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#28 + # source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#24 def on_block(node); end - # source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#42 + # source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#38 def on_block_body_of_reduce(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#28 + # source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#24 def on_numblock(node); end private - # source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#49 + # source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#45 def parent_block_node(node); end end -# source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#26 +# source://rubocop/lib/rubocop/cop/lint/next_without_accumulator.rb#22 RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String) # Checks for the presence of a `return` inside a `begin..end` block @@ -20857,16 +21051,13 @@ RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # @some_variable ||= begin # return some_value if some_condition_is_met # # do_something # end -# @example # # # good -# # @some_variable ||= begin # if some_condition_is_met # some_value @@ -20876,7 +21067,6 @@ RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String) # end # # # good -# # some_variable = if some_condition_is_met # return if another_condition_is_met # @@ -20885,19 +21075,19 @@ RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String) # do_something # end # -# source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#43 +# source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#38 class RuboCop::Cop::Lint::NoReturnInBeginEndBlocks < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#46 + # source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41 def on_lvasgn(node); end - # source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#46 + # source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41 def on_op_asgn(node); end - # source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#46 + # source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#41 def on_or_asgn(node); end end -# source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#44 +# source://rubocop/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb#39 RuboCop::Cop::Lint::NoReturnInBeginEndBlocks::MSG = T.let(T.unsafe(nil), String) # Checks for non-atomic file operation. @@ -20967,17 +21157,17 @@ class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#151 + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#152 def force_method?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#159 + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#166 def force_method_name?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#155 + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#162 def force_option?(node); end # @return [Boolean] @@ -20994,8 +21184,13 @@ class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#101 def register_offense(node, exist_node); end - # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#139 + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#140 def replacement_method(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#156 + def require_mode_keyword?(node); end end # source://rubocop/lib/rubocop/cop/lint/non_atomic_file_operation.rb#50 @@ -21538,28 +21733,28 @@ class RuboCop::Cop::Lint::ParenthesesAsGroupedExpression < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#61 + # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#60 def chained_calls?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#49 - def first_argument_block_type?(first_arg); end + # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#56 + def compound_range?(first_arg); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#57 - def first_argument_starts_with_left_parenthesis?(node); end + # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#47 + def first_argument_block_type?(first_arg); end - # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#86 + # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#85 def space_range(expr, space_length); end - # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#70 + # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#69 def spaces_before_left_parenthesis(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#66 + # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#65 def ternary_expression?(node); end # @return [Boolean] @@ -21569,7 +21764,7 @@ class RuboCop::Cop::Lint::ParenthesesAsGroupedExpression < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#53 + # source://rubocop/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#51 def valid_first_argument?(first_arg); end end @@ -21585,44 +21780,41 @@ RuboCop::Cop::Lint::ParenthesesAsGroupedExpression::MSG = T.let(T.unsafe(nil), S # @example # # # bad -# # %w('foo', "bar") -# @example # # # good -# # %w(foo bar) # -# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#33 +# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#29 class RuboCop::Cop::Lint::PercentStringArray < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#44 + # source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#40 def on_array(node); end - # source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#48 + # source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#44 def on_percent_literal(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#65 + # source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#61 def contains_quotes_or_commas?(node); end end -# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#38 +# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#34 RuboCop::Cop::Lint::PercentStringArray::LEADING_QUOTE = T.let(T.unsafe(nil), Regexp) -# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#41 +# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#37 RuboCop::Cop::Lint::PercentStringArray::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#37 +# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#33 RuboCop::Cop::Lint::PercentStringArray::QUOTES_AND_COMMAS = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#39 +# source://rubocop/lib/rubocop/cop/lint/percent_string_array.rb#35 RuboCop::Cop::Lint::PercentStringArray::TRAILING_QUOTE = T.let(T.unsafe(nil), Regexp) # Checks for colons and commas in %i, e.g. `%i(:foo, :bar)` @@ -21634,43 +21826,40 @@ RuboCop::Cop::Lint::PercentStringArray::TRAILING_QUOTE = T.let(T.unsafe(nil), Re # @example # # # bad -# # %i(:foo, :bar) -# @example # # # good -# # %i(foo bar) # -# source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#23 +# source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#19 class RuboCop::Cop::Lint::PercentSymbolArray < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#30 + # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#26 def on_array(node); end - # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#34 + # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#30 def on_percent_literal(node); end private - # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#42 + # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#38 def autocorrect(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#52 + # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#48 def contains_colons_or_commas?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#62 + # source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#58 def non_alphanumeric_literal?(literal); end end -# source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#27 +# source://rubocop/lib/rubocop/cop/lint/percent_symbol_array.rb#23 RuboCop::Cop::Lint::PercentSymbolArray::MSG = T.let(T.unsafe(nil), String) # Checks for `raise` or `fail` statements which are @@ -21736,35 +21925,32 @@ RuboCop::Cop::Lint::RaiseException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arra # @example # # # bad -# # rand 1 # Kernel.rand(-1) # rand 1.0 # rand(-1.0) -# @example # # # good -# # 0 # just use 0 instead # -# source://rubocop/lib/rubocop/cop/lint/rand_one.rb#23 +# source://rubocop/lib/rubocop/cop/lint/rand_one.rb#19 class RuboCop::Cop::Lint::RandOne < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/rand_one.rb#32 + # source://rubocop/lib/rubocop/cop/lint/rand_one.rb#28 def on_send(node); end - # source://rubocop/lib/rubocop/cop/lint/rand_one.rb#28 + # source://rubocop/lib/rubocop/cop/lint/rand_one.rb#24 def rand_one?(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/lint/rand_one.rb#40 + # source://rubocop/lib/rubocop/cop/lint/rand_one.rb#36 def message(node); end end -# source://rubocop/lib/rubocop/cop/lint/rand_one.rb#24 +# source://rubocop/lib/rubocop/cop/lint/rand_one.rb#20 RuboCop::Cop::Lint::RandOne::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/rand_one.rb#25 +# source://rubocop/lib/rubocop/cop/lint/rand_one.rb#21 RuboCop::Cop::Lint::RandOne::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # removed without causing any offenses to be reported. It's implemented @@ -21945,13 +22131,14 @@ RuboCop::Cop::Lint::RedundantCopDisableDirective::SIMILAR_COP_NAMES_CACHE = T.le # that cop checks whether any cop was actually enabled. # # @example +# # # bad # foo = 1 # # rubocop:enable Layout/LineLength # # # good # foo = 1 -# @example +# # # bad # # rubocop:disable Style/StringLiterals # foo = "1" @@ -21965,54 +22152,54 @@ RuboCop::Cop::Lint::RedundantCopDisableDirective::SIMILAR_COP_NAMES_CACHE = T.le # # rubocop:enable all # baz # -# source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#37 +# source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#39 class RuboCop::Cop::Lint::RedundantCopEnableDirective < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#44 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#46 def on_new_investigation; end private - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#120 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#122 def all_or_name(name); end - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#76 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#78 def comment_start(comment); end - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#80 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#82 def cop_name_indention(comment, name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#124 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#126 def department?(directive, name); end - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#71 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#73 def range_of_offense(comment, name); end - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#95 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#97 def range_to_remove(begin_pos, end_pos, comment); end - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#84 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#86 def range_with_comma(comment, name); end # If the list of cops is comma-separated, but without a empty space after the comma, # we should **not** remove the prepending empty space, thus begin_pos += 1 # - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#114 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#116 def range_with_comma_after(comment, start, begin_pos, end_pos); end - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#108 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#110 def range_with_comma_before(start, begin_pos, end_pos); end - # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#53 + # source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#55 def register_offense(comment, cop_names); end end -# source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#42 +# source://rubocop/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#44 RuboCop::Cop::Lint::RedundantCopEnableDirective::MSG = T.let(T.unsafe(nil), String) # Sort globbed results by default in Ruby 3.0. @@ -22313,7 +22500,7 @@ RuboCop::Cop::Lint::RedundantSafeNavigation::NIL_SPECIFIC_METHODS = T.let(T.unsa # source://rubocop/lib/rubocop/cop/lint/redundant_safe_navigation.rb#87 RuboCop::Cop::Lint::RedundantSafeNavigation::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) -# Checks for unneeded usages of splat expansion +# Checks for unneeded usages of splat expansion. # # @example # @@ -22466,47 +22653,44 @@ RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_W = T.let(T.unsafe(nil), St # @example # # # bad -# # "result is #{something.to_s}" # print something.to_s # puts something.to_s # warn something.to_s -# @example # # # good -# # "result is #{something}" # print something # puts something # warn something # -# source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#27 +# source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#23 class RuboCop::Cop::Lint::RedundantStringCoercion < ::RuboCop::Cop::Base include ::RuboCop::Cop::Interpolation extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#38 + # source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#34 def on_interpolation(begin_node); end - # source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#46 + # source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#42 def on_send(node); end - # source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#36 + # source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#32 def to_s_without_args?(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#58 + # source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#54 def register_offense(node, context); end end -# source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#31 +# source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#27 RuboCop::Cop::Lint::RedundantStringCoercion::MSG_DEFAULT = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#32 +# source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#28 RuboCop::Cop::Lint::RedundantStringCoercion::MSG_SELF = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#33 +# source://rubocop/lib/rubocop/cop/lint/redundant_string_coercion.rb#29 RuboCop::Cop::Lint::RedundantStringCoercion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for redundant `with_index`. @@ -22686,38 +22870,35 @@ RuboCop::Cop::Lint::RegexpAsCondition::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # if day.is? :tuesday && month == :jan # # ... # end -# @example # # # good -# # if day.is?(:tuesday) && month == :jan # # ... # end # -# source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#30 +# source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#26 class RuboCop::Cop::Lint::RequireParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp - # source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#35 + # source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#31 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#35 + # source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#31 def on_send(node); end private - # source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#58 + # source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#54 def check_predicate(predicate, node); end - # source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#48 + # source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#44 def check_ternary(ternary, node); end end -# source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#33 +# source://rubocop/lib/rubocop/cop/lint/require_parentheses.rb#29 RuboCop::Cop::Lint::RequireParentheses::MSG = T.let(T.unsafe(nil), String) # Checks that a range literal is enclosed in parentheses when the end of the range is @@ -22811,34 +22992,31 @@ RuboCop::Cop::Lint::RequireRelativeSelfPath::RESTRICT_ON_SEND = T.let(T.unsafe(n # @example # # # bad -# # begin # do_something # rescue Exception # handle_exception # end -# @example # # # good -# # begin # do_something # rescue ArgumentError # handle_exception # end # -# source://rubocop/lib/rubocop/cop/lint/rescue_exception.rb#27 +# source://rubocop/lib/rubocop/cop/lint/rescue_exception.rb#23 class RuboCop::Cop::Lint::RescueException < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/rescue_exception.rb#30 + # source://rubocop/lib/rubocop/cop/lint/rescue_exception.rb#26 def on_resbody(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/rescue_exception.rb#39 + # source://rubocop/lib/rubocop/cop/lint/rescue_exception.rb#35 def targets_exception?(rescue_arg_node); end end -# source://rubocop/lib/rubocop/cop/lint/rescue_exception.rb#28 +# source://rubocop/lib/rubocop/cop/lint/rescue_exception.rb#24 RuboCop::Cop::Lint::RescueException::MSG = T.let(T.unsafe(nil), String) # Check for arguments to `rescue` that will result in a `TypeError` @@ -22916,7 +23094,6 @@ RuboCop::Cop::Lint::RescueType::MSG = T.let(T.unsafe(nil), String) # def foo=(bar) # return 42 # end -# @example # # # good # def initialize @@ -22929,18 +23106,18 @@ RuboCop::Cop::Lint::RescueType::MSG = T.let(T.unsafe(nil), String) # return # end # -# source://rubocop/lib/rubocop/cop/lint/return_in_void_context.rb#34 +# source://rubocop/lib/rubocop/cop/lint/return_in_void_context.rb#32 class RuboCop::Cop::Lint::ReturnInVoidContext < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/return_in_void_context.rb#37 + # source://rubocop/lib/rubocop/cop/lint/return_in_void_context.rb#35 def on_return(return_node); end private - # source://rubocop/lib/rubocop/cop/lint/return_in_void_context.rb#53 + # source://rubocop/lib/rubocop/cop/lint/return_in_void_context.rb#51 def non_void_context(return_node); end end -# source://rubocop/lib/rubocop/cop/lint/return_in_void_context.rb#35 +# source://rubocop/lib/rubocop/cop/lint/return_in_void_context.rb#33 RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String) # The safe navigation operator returns nil if the receiver is @@ -22952,28 +23129,25 @@ RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # x&.foo.bar # x&.foo + bar # x&.foo[bar] -# @example # # # good -# # x&.foo&.bar # x&.foo || bar # -# source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#26 +# source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#22 class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::NilMethods extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#37 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#33 def bad_method?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#44 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#40 def on_send(node); end private @@ -22982,85 +23156,131 @@ class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base # @param send_node [RuboCop::AST::SendNode] # @return [String] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#62 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#67 def add_safe_navigation_operator(offense_range:, send_node:); end # @param corrector [RuboCop::Cop::Corrector] # @param offense_range [Parser::Source::Range] # @param send_node [RuboCop::AST::SendNode] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#81 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#86 def autocorrect(corrector, offense_range:, send_node:); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#90 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#95 def brackets?(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#94 + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#99 def require_parentheses?(send_node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#57 + def require_safe_navigation?(node); end end -# source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#33 +# source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#29 RuboCop::Cop::Lint::SafeNavigationChain::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#34 +# source://rubocop/lib/rubocop/cop/lint/safe_navigation_chain.rb#30 RuboCop::Cop::Lint::SafeNavigationChain::PLUS_MINUS_METHODS = T.let(T.unsafe(nil), Array) -# Check to make sure that if safe navigation is used for a method -# call in an `&&` or `||` condition that safe navigation is used for all -# method calls on that same object. +# Check to make sure that if safe navigation is used in an `&&` or `||` condition, +# consistent and appropriate safe navigation, without excess or deficiency, +# is used for all method calls on the same object. # # @example # # bad -# foo&.bar && foo.baz +# foo&.bar && foo&.baz # -# # bad -# foo.bar || foo&.baz +# # good +# foo&.bar && foo.baz # # # bad -# foo&.bar && (foobar.baz || foo.baz) +# foo.bar && foo&.baz # # # good # foo.bar && foo.baz # +# # bad +# foo&.bar || foo.baz +# # # good # foo&.bar || foo&.baz # +# # bad +# foo.bar || foo&.baz +# # # good +# foo.bar || foo.baz +# +# # bad # foo&.bar && (foobar.baz || foo&.baz) # -# source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#29 +# # good +# foo&.bar && (foobar.baz || foo.baz) +# +# source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#41 class RuboCop::Cop::Lint::SafeNavigationConsistency < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::NilMethods extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#42 - def check(node); end + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#48 + def on_and(node); end - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#36 - def on_csend(node); end + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#48 + def on_or(node); end private - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#61 - def autocorrect(corrector, node); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#96 + def already_appropriate_call?(operand, dot_op); end # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#67 - def location(node, unsafe_method_call); end + def collect_operands(node, operand_nodes); end + + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#83 + def find_consistent_parts(grouped_operands); end + + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#122 + def most_left_indices(grouped_operands); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#152 + def nilable?(node); end - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#71 - def top_conditional_ancestor(node); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#136 + def operand_in_and?(node); end - # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#82 - def unsafe_method_calls(method_calls, safe_nav_receiver); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#144 + def operand_in_or?(node); end + + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#113 + def operand_nodes(operand, operand_nodes); end + + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#74 + def receiver_name_as_key(method, fully_receivers); end + + # source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#102 + def register_offense(operand, dot_operator); end end -# source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#34 -RuboCop::Cop::Lint::SafeNavigationConsistency::MSG = T.let(T.unsafe(nil), String) +# source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#45 +RuboCop::Cop::Lint::SafeNavigationConsistency::USE_DOT_MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/lint/safe_navigation_consistency.rb#46 +RuboCop::Cop::Lint::SafeNavigationConsistency::USE_SAFE_NAVIGATION_MSG = T.let(T.unsafe(nil), String) # Checks to make sure safe navigation isn't used with `empty?` in # a conditional. @@ -23509,17 +23729,16 @@ RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String) # because `Ractor` should not access outer variables. # eg. following style is encouraged: # -# [source,ruby] -# ---- -# worker_id, pipe = env -# Ractor.new(worker_id, pipe) do |worker_id, pipe| -# end -# ---- +# [source,ruby] +# ---- +# worker_id, pipe = env +# Ractor.new(worker_id, pipe) do |worker_id, pipe| +# end +# ---- # # @example # # # bad -# # def some_method # foo = 1 # @@ -23527,10 +23746,8 @@ RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String) # do_something(foo) # end # end -# @example # # # good -# # def some_method # foo = 1 # @@ -23539,37 +23756,37 @@ RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String) # end # end # -# source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#45 +# source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#41 class RuboCop::Cop::Lint::ShadowingOuterLocalVariable < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#57 + # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#53 def before_declaring_variable(variable, variable_table); end - # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#93 + # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#89 def find_conditional_node_from_ascendant(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#100 + # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#96 def node_or_its_ascendant_conditional?(node); end - # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#49 + # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#45 def ractor_block?(param0 = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#69 + # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#65 def same_conditions_node_different_branch?(variable, outer_local_variable); end - # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#83 + # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#79 def variable_node(variable); end class << self - # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#53 + # source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#49 def joining_forces; end end end -# source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#46 +# source://rubocop/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#42 RuboCop::Cop::Lint::ShadowingOuterLocalVariable::MSG = T.let(T.unsafe(nil), String) # Checks unexpected overrides of the `Struct` built-in methods @@ -23906,12 +24123,12 @@ class RuboCop::Cop::Lint::ToEnumArguments < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/to_enum_arguments.rb#83 + # source://rubocop/lib/rubocop/cop/lint/to_enum_arguments.rb#76 def argument_match?(send_arg, def_arg); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/to_enum_arguments.rb#68 + # source://rubocop/lib/rubocop/cop/lint/to_enum_arguments.rb#61 def arguments_match?(arguments, def_node); end end @@ -24152,6 +24369,58 @@ end # source://rubocop/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#44 RuboCop::Cop::Lint::UnderscorePrefixedVariableName::MSG = T.let(T.unsafe(nil), String) +# Checks for Regexpes (both literals and via `Regexp.new` / `Regexp.compile`) +# that contain unescaped `]` characters. +# +# It emulates the following Ruby warning: +# +# [source,ruby] +# ---- +# $ ruby -e '/abc]123/' +# -e:1: warning: regular expression has ']' without escape: /abc]123/ +# ---- +# +# @example +# # bad +# /abc]123/ +# %r{abc]123} +# Regexp.new('abc]123') +# Regexp.compile('abc]123') +# +# # good +# /abc\]123/ +# %r{abc\]123} +# Regexp.new('abc\]123') +# Regexp.compile('abc\]123') +# +# source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#30 +class RuboCop::Cop::Lint::UnescapedBracketInRegexp < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#45 + def on_regexp(node); end + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#53 + def on_send(node); end + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#37 + def regexp_constructor(param0); end + + private + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#66 + def detect_offenses(node, expr); end + + # source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#81 + def range_at_index(node, index, offset); end +end + +# source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#33 +RuboCop::Cop::Lint::UnescapedBracketInRegexp::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#34 +RuboCop::Cop::Lint::UnescapedBracketInRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks for a block that is known to need more positional # block arguments than are given (by default this is configured for # `Enumerable` methods needing 2 arguments). Optional arguments are allowed, @@ -24220,27 +24489,24 @@ RuboCop::Cop::Lint::UnexpectedBlockArity::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # 1.is_a?(Fixnum) # 1.is_a?(Bignum) -# @example # # # good -# # 1.is_a?(Integer) # -# source://rubocop/lib/rubocop/cop/lint/unified_integer.rb#20 +# source://rubocop/lib/rubocop/cop/lint/unified_integer.rb#16 class RuboCop::Cop::Lint::UnifiedInteger < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/unified_integer.rb#26 + # source://rubocop/lib/rubocop/cop/lint/unified_integer.rb#22 def fixnum_or_bignum_const(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/unified_integer.rb#30 + # source://rubocop/lib/rubocop/cop/lint/unified_integer.rb#26 def on_const(node); end end -# source://rubocop/lib/rubocop/cop/lint/unified_integer.rb#23 +# source://rubocop/lib/rubocop/cop/lint/unified_integer.rb#19 RuboCop::Cop::Lint::UnifiedInteger::MSG = T.let(T.unsafe(nil), String) # Looks for `reduce` or `inject` blocks where the value returned (implicitly or @@ -24335,31 +24601,31 @@ class RuboCop::Cop::Lint::UnmodifiedReduceAccumulator < ::RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#190 + # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#191 def acceptable_return?(return_val, element_name); end # Exclude `begin` nodes inside a `dstr` from being collected by `return_values` # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#198 + # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#199 def allowed_type?(parent_node); end - # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#158 + # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#159 def block_arg_name(node, index); end - # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#141 + # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#142 def check_return_values(block_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#175 + # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#176 def potential_offense?(return_values, block_body, element_name, accumulator_name); end # Return values in a block are either the value given to next, # the last line of a multiline block, or the only line of the block # - # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#127 + # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#128 def return_values(block_body_node); end # Look for an index of the accumulator being returned, except where the index @@ -24367,7 +24633,7 @@ class RuboCop::Cop::Lint::UnmodifiedReduceAccumulator < ::RuboCop::Cop::Base # This is always an offense, in order to try to catch potential exceptions # due to type mismatches # - # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#166 + # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#167 def returned_accumulator_index(return_values, accumulator_name, element_name); end # If the accumulator is used in any return value, the node is acceptable since @@ -24375,7 +24641,7 @@ class RuboCop::Cop::Lint::UnmodifiedReduceAccumulator < ::RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#182 + # source://rubocop/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb#183 def returns_accumulator_anywhere?(return_values, accumulator_name); end end @@ -24392,14 +24658,12 @@ RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG_INDEX = T.let(T.unsafe(nil) # @example # # # bad -# # def some_method # return # do_something # end # # # bad -# # def some_method # if cond # return @@ -24408,40 +24672,38 @@ RuboCop::Cop::Lint::UnmodifiedReduceAccumulator::MSG_INDEX = T.let(T.unsafe(nil) # end # do_something # end -# @example # # # good -# # def some_method # do_something # end # -# source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#37 +# source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#32 class RuboCop::Cop::Lint::UnreachableCode < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#55 + # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#50 def flow_command?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#40 + # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#35 def on_begin(node); end - # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#40 + # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#35 def on_kwbegin(node); end private - # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#87 + # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#82 def check_case(node); end - # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#81 + # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#76 def check_if(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#65 + # source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#60 def flow_expression?(node); end end -# source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#38 +# source://rubocop/lib/rubocop/cop/lint/unreachable_code.rb#33 RuboCop::Cop::Lint::UnreachableCode::MSG = T.let(T.unsafe(nil), String) # Checks for loops that will have at most one iteration. @@ -24858,33 +25120,46 @@ RuboCop::Cop::Lint::UriEscapeUnescape::MSG = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/lint/uri_escape_unescape.rb#48 RuboCop::Cop::Lint::UriEscapeUnescape::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) -# Identifies places where `URI.regexp` is obsolete and should -# not be used. Instead, use `URI::DEFAULT_PARSER.make_regexp`. +# Identifies places where `URI.regexp` is obsolete and should not be used. +# +# For Ruby 3.3 or lower, use `URI::DEFAULT_PARSER.make_regexp`. +# For Ruby 3.4 or higher, use `URI::RFC2396_PARSER.make_regexp`. +# +# NOTE: If you need to support both Ruby 3.3 and lower as well as Ruby 3.4 and higher, +# consider manually changing the code as follows: +# +# [source,ruby] +# ---- +# defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER +# ---- # # @example # # bad # URI.regexp('http://example.com') # -# # good +# # good - Ruby 3.3 or lower # URI::DEFAULT_PARSER.make_regexp('http://example.com') # -# source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#16 +# # good - Ruby 3.4 or higher +# URI::RFC2396_PARSER.make_regexp('http://example.com') +# +# source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#29 class RuboCop::Cop::Lint::UriRegexp < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#23 + # source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#40 def on_send(node); end + + # source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#36 + def uri_constant?(param0 = T.unsafe(nil)); end end -# source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#19 +# source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#32 RuboCop::Cop::Lint::UriRegexp::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#21 +# source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#33 RuboCop::Cop::Lint::UriRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/uri_regexp.rb#20 -RuboCop::Cop::Lint::UriRegexp::URI_CONSTANTS = T.let(T.unsafe(nil), Array) - # Checks for redundant access modifiers, including those with no # code, those which are repeated, and leading `public` modifiers in a # class or module body. Conditionally-defined methods are considered as @@ -25106,103 +25381,105 @@ RuboCop::Cop::Lint::UselessAccessModifier::MSG = T.let(T.unsafe(nil), String) # reassignments and properly handles varied cases such as branch, loop, # rescue, ensure, etc. # +# This cop's autocorrection avoids cases like `a ||= 1` because removing assignment from +# operator assignment can cause NameError if this assignment has been used to declare +# a local variable. For example, replacing `a ||= 1` with `a || 1` may cause +# "undefined local variable or method `a' for main:Object (NameError)". +# # NOTE: Given the assignment `foo = 1, bar = 2`, removing unused variables # can lead to a syntax error, so this case is not autocorrected. # # @example # # # bad -# # def some_method # some_var = 1 # do_something # end -# @example # # # good -# # def some_method # some_var = 1 # do_something(some_var) # end # -# source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#45 +# source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#40 class RuboCop::Cop::Lint::UselessAssignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#56 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#51 def after_leaving_scope(scope, _variable_table); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#162 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#165 def autocorrect(corrector, assignment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#103 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#106 def chained_assignment?(node); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#61 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#56 def check_for_unused_assignments(variable); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#146 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#149 def collect_variable_like_names(scope); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#79 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#82 def message_for_useless_assignment(assignment); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#107 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#110 def message_specification(assignment, variable); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#117 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#120 def multiple_assignment_message(variable_name); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#85 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#88 def offense_range(assignment); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#122 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#125 def operator_assignment_message(scope, assignment); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#179 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#182 def remove_exception_assignment_part(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#203 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#206 def remove_local_variable_assignment_part(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#192 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#195 def remove_trailing_character_from_operator(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#188 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#191 def rename_variable_with_underscore(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#196 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#199 def replace_named_capture_group_with_non_capturing_group(corrector, node, variable_name); end # TODO: More precise handling (rescue, ensure, nested begin, etc.) # - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#136 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#139 def return_value_node_of_scope(scope); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#93 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#96 def sequential_assignment?(node); end - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#129 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#132 def similar_name_message(variable); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#155 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#158 def variable_like_method_invocation?(node); end class << self - # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#52 + # source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#47 def joining_forces; end end end -# source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#50 +# source://rubocop/lib/rubocop/cop/lint/useless_assignment.rb#45 RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String) # Checks for useless `else` in `begin..end` without `rescue`. @@ -25212,16 +25489,13 @@ RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String) # @example # # # bad -# # begin # do_something # else # do_something_else # This will never be run. # end -# @example # # # good -# # begin # do_something # rescue @@ -25230,13 +25504,13 @@ RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String) # do_something_else # end # -# source://rubocop/lib/rubocop/cop/lint/useless_else_without_rescue.rb#31 +# source://rubocop/lib/rubocop/cop/lint/useless_else_without_rescue.rb#27 class RuboCop::Cop::Lint::UselessElseWithoutRescue < ::RuboCop::Cop::Base - # source://rubocop/lib/rubocop/cop/lint/useless_else_without_rescue.rb#34 + # source://rubocop/lib/rubocop/cop/lint/useless_else_without_rescue.rb#30 def on_new_investigation; end end -# source://rubocop/lib/rubocop/cop/lint/useless_else_without_rescue.rb#32 +# source://rubocop/lib/rubocop/cop/lint/useless_else_without_rescue.rb#28 RuboCop::Cop::Lint::UselessElseWithoutRescue::MSG = T.let(T.unsafe(nil), String) # Checks for useless method definitions, specifically: empty constructors @@ -25298,6 +25572,62 @@ end # source://rubocop/lib/rubocop/cop/lint/useless_method_definition.rb#41 RuboCop::Cop::Lint::UselessMethodDefinition::MSG = T.let(T.unsafe(nil), String) +# Certain numeric operations have no impact, being: +# Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1. +# These are probably leftover from debugging, or are mistakes. +# +# @example +# +# # bad +# x + 0 +# x - 0 +# x * 1 +# x / 1 +# x ** 1 +# +# # good +# x +# +# # bad +# x += 0 +# x -= 0 +# x *= 1 +# x /= 1 +# x **= 1 +# +# # good +# x = x +# +# source://rubocop/lib/rubocop/cop/lint/useless_numeric_operation.rb#32 +class RuboCop::Cop::Lint::UselessNumericOperation < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/lint/useless_numeric_operation.rb#54 + def on_op_asgn(node); end + + # source://rubocop/lib/rubocop/cop/lint/useless_numeric_operation.rb#43 + def on_send(node); end + + # source://rubocop/lib/rubocop/cop/lint/useless_numeric_operation.rb#41 + def useless_abbreviated_assignment?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/lint/useless_numeric_operation.rb#38 + def useless_operation?(param0 = T.unsafe(nil)); end + + private + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/useless_numeric_operation.rb#67 + def useless?(operation, number); end +end + +# source://rubocop/lib/rubocop/cop/lint/useless_numeric_operation.rb#34 +RuboCop::Cop::Lint::UselessNumericOperation::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/lint/useless_numeric_operation.rb#35 +RuboCop::Cop::Lint::UselessNumericOperation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks for useless `rescue`s, which only reraise rescued exceptions. # # @example @@ -25464,83 +25794,80 @@ RuboCop::Cop::Lint::UselessRuby2Keywords::RESTRICT_ON_SEND = T.let(T.unsafe(nil) # @example # # # bad -# # def something # x = Something.new # x.attr = 5 # end -# @example # # # good -# # def something # x = Something.new # x.attr = 5 # x # end # -# source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#35 +# source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#31 class RuboCop::Cop::Lint::UselessSetterCall < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#41 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#37 def on_def(node); end - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#41 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#37 def on_defs(node); end - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#63 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#59 def setter_call_to_local_variable?(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#67 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#63 def last_expression(body); end end -# source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#39 +# source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#35 RuboCop::Cop::Lint::UselessSetterCall::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#38 +# source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#34 RuboCop::Cop::Lint::UselessSetterCall::MSG = T.let(T.unsafe(nil), String) # This class tracks variable assignments in a method body # and if a variable contains object passed as argument at the end of # the method. # -# source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#76 +# source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#72 class RuboCop::Cop::Lint::UselessSetterCall::MethodVariableTracker # @return [MethodVariableTracker] a new instance of MethodVariableTracker # - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#77 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#73 def initialize(body_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#163 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#159 def constructor?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#82 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#78 def contain_local_object?(variable_name); end - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#152 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#148 def process_assignment(asgn_node, rhs_node); end - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#100 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#96 def process_assignment_node(node); end - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#142 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#138 def process_binary_operator_assignment(op_asgn_node); end - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#133 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#129 def process_logical_operator_assignment(asgn_node); end - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#114 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#110 def process_multiple_assignment(masgn_node); end - # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#92 + # source://rubocop/lib/rubocop/cop/lint/useless_setter_call.rb#88 def scan(node, &block); end end @@ -25662,61 +25989,77 @@ class RuboCop::Cop::Lint::Void < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/lint/void.rb#92 + # source://rubocop/lib/rubocop/cop/lint/void.rb#90 def on_begin(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#82 + # source://rubocop/lib/rubocop/cop/lint/void.rb#81 def on_block(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#92 + # source://rubocop/lib/rubocop/cop/lint/void.rb#95 + def on_ensure(node); end + + # source://rubocop/lib/rubocop/cop/lint/void.rb#90 def on_kwbegin(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#82 + # source://rubocop/lib/rubocop/cop/lint/void.rb#81 def on_numblock(node); end private - # source://rubocop/lib/rubocop/cop/lint/void.rb#217 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/void.rb#258 + def all_keys_entirely_literal?(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/lint/void.rb#262 + def all_values_entirely_literal?(node); end + + # source://rubocop/lib/rubocop/cop/lint/void.rb#236 def autocorrect_nonmutating_send(corrector, node, suggestion); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#213 + # source://rubocop/lib/rubocop/cop/lint/void.rb#230 def autocorrect_void_expression(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#201 + # source://rubocop/lib/rubocop/cop/lint/void.rb#218 def autocorrect_void_op(corrector, node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#99 + # source://rubocop/lib/rubocop/cop/lint/void.rb#101 def check_begin(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#113 + # source://rubocop/lib/rubocop/cop/lint/void.rb#198 + def check_ensure(node); end + + # source://rubocop/lib/rubocop/cop/lint/void.rb#115 def check_expression(expr); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#151 + # source://rubocop/lib/rubocop/cop/lint/void.rb#156 def check_literal(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#175 + # source://rubocop/lib/rubocop/cop/lint/void.rb#180 def check_nonmutating(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#159 + # source://rubocop/lib/rubocop/cop/lint/void.rb#164 def check_self(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#133 + # source://rubocop/lib/rubocop/cop/lint/void.rb#138 def check_var(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#167 + # source://rubocop/lib/rubocop/cop/lint/void.rb#172 def check_void_expression(node); end - # source://rubocop/lib/rubocop/cop/lint/void.rb#123 + # source://rubocop/lib/rubocop/cop/lint/void.rb#127 def check_void_op(node, &block); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/void.rb#226 + # source://rubocop/lib/rubocop/cop/lint/void.rb#245 def entirely_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/lint/void.rb#193 + # source://rubocop/lib/rubocop/cop/lint/void.rb#211 def in_void_context?(node); end end @@ -25732,13 +26075,13 @@ RuboCop::Cop::Lint::Void::EXPRESSION_MSG = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/lint/void.rb#61 RuboCop::Cop::Lint::Void::LIT_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/void.rb#77 +# source://rubocop/lib/rubocop/cop/lint/void.rb#76 RuboCop::Cop::Lint::Void::METHODS_REPLACEABLE_BY_EACH = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/void.rb#79 +# source://rubocop/lib/rubocop/cop/lint/void.rb#78 RuboCop::Cop::Lint::Void::NONMUTATING_METHODS = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/lint/void.rb#70 +# source://rubocop/lib/rubocop/cop/lint/void.rb#69 RuboCop::Cop::Lint::Void::NONMUTATING_METHODS_WITH_BANG_VERSION = T.let(T.unsafe(nil), Array) # source://rubocop/lib/rubocop/cop/lint/void.rb#64 @@ -25759,9 +26102,6 @@ RuboCop::Cop::Lint::Void::UNARY_OPERATORS = T.let(T.unsafe(nil), Array) # source://rubocop/lib/rubocop/cop/lint/void.rb#59 RuboCop::Cop::Lint::Void::VAR_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/lint/void.rb#69 -RuboCop::Cop::Lint::Void::VOID_CONTEXT_TYPES = T.let(T.unsafe(nil), Array) - # Common functionality for obtaining source ranges from regexp matches # # source://rubocop/lib/rubocop/cop/mixin/match_range.rb#6 @@ -26024,8 +26364,9 @@ RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String) # The cop can be configured to ignore blocks passed to certain methods. # # You can set constructs you want to fold with `CountAsOne`. -# Available are: 'array', 'hash', 'heredoc', and 'method_call'. Each construct -# will be counted as one line regardless of its actual size. +# +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of its actual size. # # NOTE: This cop does not apply for `Struct` definitions. # @@ -26033,7 +26374,7 @@ RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String) # for backwards compatibility. Please use `AllowedMethods` and `AllowedPatterns` # instead. By default, there are no methods to allowed. # -# @example CountAsOne: ['array', 'heredoc', 'method_call'] +# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] # # something do # array = [ # +1 @@ -26041,7 +26382,7 @@ RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String) # 2 # ] # -# hash = { # +3 +# hash = { # +1 # key: 'value' # } # @@ -26054,40 +26395,40 @@ RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String) # 1, # 2 # ) -# end # 6 points +# end # 4 points # -# source://rubocop/lib/rubocop/cop/metrics/block_length.rb#44 +# source://rubocop/lib/rubocop/cop/metrics/block_length.rb#45 class RuboCop::Cop::Metrics::BlockLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::CodeLength include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::AllowedPattern - # source://rubocop/lib/rubocop/cop/metrics/block_length.rb#51 + # source://rubocop/lib/rubocop/cop/metrics/block_length.rb#52 def on_block(node); end - # source://rubocop/lib/rubocop/cop/metrics/block_length.rb#51 + # source://rubocop/lib/rubocop/cop/metrics/block_length.rb#52 def on_numblock(node); end private - # source://rubocop/lib/rubocop/cop/metrics/block_length.rb#80 + # source://rubocop/lib/rubocop/cop/metrics/block_length.rb#81 def cop_label; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/metrics/block_length.rb#62 + # source://rubocop/lib/rubocop/cop/metrics/block_length.rb#63 def method_receiver_excluded?(node); end end -# source://rubocop/lib/rubocop/cop/metrics/block_length.rb#49 +# source://rubocop/lib/rubocop/cop/metrics/block_length.rb#50 RuboCop::Cop::Metrics::BlockLength::LABEL = T.let(T.unsafe(nil), String) -# Checks for excessive nesting of conditional and looping -# constructs. +# Checks for excessive nesting of conditional and looping constructs. # -# You can configure if blocks are considered using the `CountBlocks` -# option. When set to `false` (the default) blocks are not counted -# towards the nesting level. Set to `true` to count blocks as well. +# You can configure if blocks are considered using the `CountBlocks` and `CountModifierForms` +# options. When both are set to `false` (the default) blocks and modifier forms are not +# counted towards the nesting level. Set them to `true` to include these in the nesting level +# calculation as well. # # The maximum level of nesting allowed is configurable. # @@ -26106,15 +26447,25 @@ class RuboCop::Cop::Metrics::BlockNesting < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/metrics/block_nesting.rb#44 + # source://rubocop/lib/rubocop/cop/metrics/block_nesting.rb#52 def consider_node?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/metrics/block_nesting.rb#54 + # source://rubocop/lib/rubocop/cop/metrics/block_nesting.rb#62 def count_blocks?; end - # source://rubocop/lib/rubocop/cop/metrics/block_nesting.rb#50 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/metrics/block_nesting.rb#44 + def count_if_block?(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/metrics/block_nesting.rb#66 + def count_modifier_forms?; end + + # source://rubocop/lib/rubocop/cop/metrics/block_nesting.rb#58 def message(max); end end @@ -26126,12 +26477,13 @@ RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array # The maximum allowed length is configurable. # # You can set constructs you want to fold with `CountAsOne`. -# Available are: 'array', 'hash', 'heredoc', and 'method_call'. Each construct -# will be counted as one line regardless of its actual size. +# +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of its actual size. # # NOTE: This cop also applies for `Struct` definitions. # -# @example CountAsOne: ['array', 'heredoc', 'method_call'] +# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] # # class Foo # ARRAY = [ # +1 @@ -26139,7 +26491,7 @@ RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array # 2 # ] # -# HASH = { # +3 +# HASH = { # +1 # key: 'value' # } # @@ -26152,24 +26504,24 @@ RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array # 1, # 2 # ) -# end # 6 points +# end # 4 points # -# source://rubocop/lib/rubocop/cop/metrics/class_length.rb#39 +# source://rubocop/lib/rubocop/cop/metrics/class_length.rb#40 class RuboCop::Cop::Metrics::ClassLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::CodeLength - # source://rubocop/lib/rubocop/cop/metrics/class_length.rb#52 + # source://rubocop/lib/rubocop/cop/metrics/class_length.rb#53 def on_casgn(node); end - # source://rubocop/lib/rubocop/cop/metrics/class_length.rb#42 + # source://rubocop/lib/rubocop/cop/metrics/class_length.rb#43 def on_class(node); end - # source://rubocop/lib/rubocop/cop/metrics/class_length.rb#46 + # source://rubocop/lib/rubocop/cop/metrics/class_length.rb#47 def on_sclass(node); end private - # source://rubocop/lib/rubocop/cop/metrics/class_length.rb#70 + # source://rubocop/lib/rubocop/cop/metrics/class_length.rb#71 def message(length, max_length); end end @@ -26254,23 +26606,26 @@ RuboCop::Cop::Metrics::CollectionLiteralLength::RESTRICT_ON_SEND = T.let(T.unsaf # and ||/or is shorthand for a sequence of ifs, so they also add one. # Loops can be said to have an exit condition, so they add one. # Blocks that are calls to builtin iteration methods -# (e.g. `ary.map{...}) also add one, others are ignored. +# (e.g. `ary.map{...}`) also add one, others are ignored. +# +# @example # # def each_child_node(*types) # count begins: 1 -# unless block_given? # unless: +1 -# return to_enum(__method__, *types) +# unless block_given? # unless: +1 +# return to_enum(__method__, *types) +# end # -# children.each do |child| # each{}: +1 -# next unless child.is_a?(Node) # unless: +1 +# children.each do |child| # each{}: +1 +# next unless child.is_a?(Node) # unless: +1 # -# yield child if types.empty? || # if: +1, ||: +1 -# types.include?(child.type) -# end +# yield child if types.empty? || # if: +1, ||: +1 +# types.include?(child.type) +# end # -# self +# self # end # total: 6 # -# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#32 +# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#35 class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::AllowedPattern @@ -26280,19 +26635,19 @@ class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base private - # source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#42 + # source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#45 def complexity_score_for(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#49 + # source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#52 def count_block?(block); end end -# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#37 +# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#40 RuboCop::Cop::Metrics::CyclomaticComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#36 +# source://rubocop/lib/rubocop/cop/metrics/cyclomatic_complexity.rb#39 RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) # Checks if the length of a method exceeds some maximum value. @@ -26300,15 +26655,16 @@ RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) # The maximum allowed length is configurable. # # You can set constructs you want to fold with `CountAsOne`. -# Available are: 'array', 'hash', 'heredoc', and 'method_call'. Each construct -# will be counted as one line regardless of its actual size. +# +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of its actual size. # # NOTE: The `ExcludedMethods` and `IgnoredMethods` configuration is # deprecated and only kept for backwards compatibility. # Please use `AllowedMethods` and `AllowedPatterns` instead. # By default, there are no methods to allowed. # -# @example CountAsOne: ['array', 'heredoc', 'method_call'] +# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] # # def m # array = [ # +1 @@ -26316,7 +26672,7 @@ RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) # 2 # ] # -# hash = { # +3 +# hash = { # +1 # key: 'value' # } # @@ -26329,33 +26685,33 @@ RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) # 1, # 2 # ) -# end # 6 points +# end # 4 points # -# source://rubocop/lib/rubocop/cop/metrics/method_length.rb#42 +# source://rubocop/lib/rubocop/cop/metrics/method_length.rb#43 class RuboCop::Cop::Metrics::MethodLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::CodeLength include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::AllowedPattern - # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#56 + # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#57 def on_block(node); end - # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#49 + # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#50 def on_def(node); end - # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#49 + # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#50 def on_defs(node); end - # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#56 + # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#57 def on_numblock(node); end private - # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#65 + # source://rubocop/lib/rubocop/cop/metrics/method_length.rb#66 def cop_label; end end -# source://rubocop/lib/rubocop/cop/metrics/method_length.rb#47 +# source://rubocop/lib/rubocop/cop/metrics/method_length.rb#48 RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String) # Checks if the length of a module exceeds some maximum value. @@ -26363,10 +26719,11 @@ RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String) # The maximum allowed length is configurable. # # You can set constructs you want to fold with `CountAsOne`. -# Available are: 'array', 'hash', 'heredoc', and 'method_call'. Each construct -# will be counted as one line regardless of its actual size. # -# @example CountAsOne: ['array', 'heredoc', 'method_call'] +# Available are: 'array', 'hash', 'heredoc', and 'method_call'. +# Each construct will be counted as one line regardless of its actual size. +# +# @example CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] # # module M # ARRAY = [ # +1 @@ -26374,7 +26731,7 @@ RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String) # 2 # ] # -# HASH = { # +3 +# HASH = { # +1 # key: 'value' # } # @@ -26387,24 +26744,24 @@ RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String) # 1, # 2 # ) -# end # 6 points +# end # 4 points # -# source://rubocop/lib/rubocop/cop/metrics/module_length.rb#37 +# source://rubocop/lib/rubocop/cop/metrics/module_length.rb#38 class RuboCop::Cop::Metrics::ModuleLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::CodeLength - # source://rubocop/lib/rubocop/cop/metrics/module_length.rb#51 + # source://rubocop/lib/rubocop/cop/metrics/module_length.rb#52 def module_definition?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/metrics/module_length.rb#44 + # source://rubocop/lib/rubocop/cop/metrics/module_length.rb#45 def on_casgn(node); end - # source://rubocop/lib/rubocop/cop/metrics/module_length.rb#40 + # source://rubocop/lib/rubocop/cop/metrics/module_length.rb#41 def on_module(node); end private - # source://rubocop/lib/rubocop/cop/metrics/module_length.rb#55 + # source://rubocop/lib/rubocop/cop/metrics/module_length.rb#56 def message(length, max_length); end end @@ -26981,6 +27338,36 @@ module RuboCop::Cop::MinBranchesCount def min_branches_count?(node); end end +module RuboCop::Cop::Minitest; end + +class RuboCop::Cop::Minitest::MultipleAssertions < ::RuboCop::Cop::Base + include ::RuboCop::Cop::VisibilityHelp + include ::RuboCop::Cop::DefNode + + # source://rubocop/lib/rubocop/cop/exclude_limit.rb#11 + def max=(value); end + + # source://rubocop-minitest/0.35.1lib/rubocop/cop/minitest/multiple_assertions.rb#37 + def on_class(class_node); end + + private + + # source://rubocop-minitest/0.35.1lib/rubocop/cop/minitest/multiple_assertions.rb#54 + def assertions_count(node); end + + # source://rubocop-minitest/0.35.1lib/rubocop/cop/minitest/multiple_assertions.rb#62 + def assertions_count_based_on_type(node); end + + # source://rubocop-minitest/0.35.1lib/rubocop/cop/minitest/multiple_assertions.rb#77 + def assertions_count_in_assignment(node); end + + # source://rubocop-minitest/0.35.1lib/rubocop/cop/minitest/multiple_assertions.rb#95 + def assertions_count_in_branches(branches); end + + # source://rubocop-minitest/0.35.1lib/rubocop/cop/minitest/multiple_assertions.rb#99 + def max_assertions; end +end + # Common code for indenting the first elements in multiline # array literals, hash literals, and method definitions. # @@ -27398,16 +27785,21 @@ class RuboCop::Cop::Naming::AccessorMethodName < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/naming/accessor_method_name.rb#61 + # source://rubocop/lib/rubocop/cop/naming/accessor_method_name.rb#66 def bad_reader_name?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/naming/accessor_method_name.rb#65 + # source://rubocop/lib/rubocop/cop/naming/accessor_method_name.rb#70 def bad_writer_name?(node); end - # source://rubocop/lib/rubocop/cop/naming/accessor_method_name.rb#53 + # source://rubocop/lib/rubocop/cop/naming/accessor_method_name.rb#54 def message(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/naming/accessor_method_name.rb#62 + def proper_attribute_name?(node); end end # source://rubocop/lib/rubocop/cop/naming/accessor_method_name.rb#39 @@ -28091,10 +28483,10 @@ class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#111 def add_offenses_for_token(token, word_locations); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#167 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#176 def add_to_flagged_term_hash(regex_string, term, term_definition); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#193 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#202 def array_to_ignorecase_regex(strings); end # @return [Boolean] @@ -28102,55 +28494,58 @@ 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#243 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#252 def create_message(word, message = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#217 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#226 def create_multiple_word_message_for_file(words); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#213 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#222 def create_single_word_message_for_file(word); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#189 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#198 def ensure_regex_string(regex); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#160 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#169 def extract_regexp(term, term_definition); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#251 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#260 def find_flagged_term(word); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#265 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#274 def format_suggestions(suggestions); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#197 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#206 def investigate_filepath; end # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#100 def investigate_tokens; end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#231 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#240 def mask_input(str); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#280 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#289 def offense_range(token, word); end + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#160 + def preferred_sole_term(suggestions); end + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#130 def preprocess_check_config; end # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#144 def preprocess_flagged_terms; end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#258 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#267 def preprocess_suggestions(suggestions); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#179 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#188 def process_allowed_regex(allowed); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#221 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#230 def scan_for_words(input); end - # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#174 + # source://rubocop/lib/rubocop/cop/naming/inclusive_language.rb#183 def set_regexes(flagged_term_strings, allowed_strings); end end @@ -28497,94 +28892,109 @@ class RuboCop::Cop::Naming::MethodParameterName < ::RuboCop::Cop::Base def on_defs(node); end end -# Checks that predicate methods names end with a question mark and +# Checks that predicate method names end with a question mark and # do not start with a forbidden prefix. # -# A method is determined to be a predicate method if its name starts -# with one of the prefixes defined in the `NamePrefix` configuration. -# You can change what prefixes are considered by changing this option. -# Any method name that starts with one of these prefixes is required by -# the cop to end with a `?`. Other methods can be allowed by adding to -# the `AllowedMethods` configuration. -# -# NOTE: The `is_a?` method is allowed by default. +# A method is determined to be a predicate method if its name starts with +# one of the prefixes listed in the `NamePrefix` configuration. The list +# defaults to `is_`, `has_`, and `have_` but may be overridden. # -# If `ForbiddenPrefixes` is set, methods that start with the configured -# prefixes will not be allowed and will be removed by autocorrection. +# Predicate methods must end with a question mark. # -# In other words, if `ForbiddenPrefixes` is empty, a method named `is_foo` -# will register an offense only due to the lack of question mark (and will be -# autocorrected to `is_foo?`). If `ForbiddenPrefixes` contains `is_`, -# `is_foo` will register an offense both because the ? is missing and because of -# the `is_` prefix, and will be corrected to `foo?`. +# When `ForbiddenPrefixes` is also set (as it is by default), predicate +# methods which begin with a forbidden prefix are not allowed, even if +# they end with a `?`. These methods should be changed to remove the +# prefix. # -# NOTE: `ForbiddenPrefixes` is only applied to prefixes in `NamePrefix`; -# a prefix in the former but not the latter will not be considered by -# this cop. -# -# @example +# @example NamePrefix: ['is_', 'has_', 'have_'] (default) # # bad # def is_even(value) # end # -# def is_even?(value) -# end -# +# # When ForbiddenPrefixes: ['is_', 'has_', 'have_'] (default) # # good # def even?(value) # end # +# # When ForbiddenPrefixes: [] +# # good +# def is_even?(value) +# end +# @example NamePrefix: ['seems_to_be_'] # # bad -# def has_value +# def seems_to_be_even(value) # end # -# def has_value? +# # When ForbiddenPrefixes: ['seems_to_be_'] +# # good +# def even?(value) # end # +# # When ForbiddenPrefixes: [] # # good -# def value? +# def seems_to_be_even?(value) # end # @example AllowedMethods: ['is_a?'] (default) +# # Despite starting with the `is_` prefix, this method is allowed # # good # def is_a?(value) # end +# @example AllowedMethods: ['is_even?'] +# # good +# def is_even?(value) +# end +# @example MethodDefinitionMacros: ['define_method', 'define_singleton_method'] (default) +# # bad +# define_method(:is_even) { |value| } +# +# # good +# define_method(:even?) { |value| } +# @example MethodDefinitionMacros: ['def_node_matcher'] +# # bad +# def_node_matcher(:is_even) { |value| } +# +# # good +# def_node_matcher(:even?) { |value| } # -# source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#59 +# source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#75 class RuboCop::Cop::Naming::PredicateName < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#63 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#79 def dynamic_method_define(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#82 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#98 def on_def(node); end - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#82 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#98 def on_defs(node); end - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#69 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#85 def on_send(node); end + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#112 + def validate_config; end + private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#98 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#124 def allowed_method_name?(method_name, prefix); end - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#106 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#132 def expected_name(method_name, prefix); end - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#120 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#146 def forbidden_prefixes; end - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#116 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#142 def message(method_name, new_name); end - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#128 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#154 def method_definition_macros(macro_name); end - # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#124 + # source://rubocop/lib/rubocop/cop/naming/predicate_name.rb#150 def predicate_prefixes; end end @@ -28654,31 +29064,31 @@ class RuboCop::Cop::Naming::RescuedExceptionsVariableName < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#96 def autocorrect(corrector, node, range, offending_name, preferred_name); end - # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#116 + # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#117 def correct_node(corrector, node, offending_name, preferred_name); end # If the exception variable is reassigned, that assignment needs to be corrected. # Further `lvar` nodes will not be corrected though since they now refer to a # different variable. # - # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#134 + # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#143 def correct_reassignment(corrector, node, offending_name, preferred_name); end - # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#159 + # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#168 def message(node); end # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#91 def offense_range(resbody); end - # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#143 + # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#152 def preferred_name(variable_name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#165 + # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#174 def shadowed_variable_name?(node); end - # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#152 + # source://rubocop/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#161 def variable_name(node); end # @return [Boolean] @@ -28951,7 +29361,7 @@ class RuboCop::Cop::Offense # @api private # @return [Offense] a new instance of Offense # - # source://rubocop/lib/rubocop/cop/offense.rb#84 + # source://rubocop/lib/rubocop/cop/offense.rb#83 def initialize(severity, location, message, cop_name, status = T.unsafe(nil), corrector = T.unsafe(nil)); end # Returns `-1`, `0`, or `+1` @@ -28960,105 +29370,104 @@ class RuboCop::Cop::Offense # @api public # @return [Integer] comparison result # - # source://rubocop/lib/rubocop/cop/offense.rb#230 + # source://rubocop/lib/rubocop/cop/offense.rb#229 def <=>(other); end # @api public # @return [Boolean] returns `true` if two offenses contain same attributes # - # source://rubocop/lib/rubocop/cop/offense.rb#211 + # source://rubocop/lib/rubocop/cop/offense.rb#210 def ==(other); end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#160 + # source://rubocop/lib/rubocop/cop/offense.rb#159 def column; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#170 + # source://rubocop/lib/rubocop/cop/offense.rb#169 def column_length; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#194 + # source://rubocop/lib/rubocop/cop/offense.rb#193 def column_range; end # @api public # @example - # 'LineLength' - # @return [String] a cop class name without department. - # i.e. type of the violation. + # 'Layout/LineLength' + # @return [String] the cop name as a String for which this offense is for. # - # source://rubocop/lib/rubocop/cop/offense.rb#51 + # source://rubocop/lib/rubocop/cop/offense.rb#50 def cop_name; end # @api public - # @return [Boolean] whether this offense can be automatically corrected via - # autocorrect or a todo. + # @return [Boolean] whether this offense can be automatically corrected via autocorrect. + # This includes todo comments, for example when requested with `--disable-uncorrectable`. # - # source://rubocop/lib/rubocop/cop/offense.rb#102 + # source://rubocop/lib/rubocop/cop/offense.rb#101 def correctable?; end # @api public # @return [Boolean] whether this offense is automatically corrected via # autocorrect or a todo. # - # source://rubocop/lib/rubocop/cop/offense.rb#113 + # source://rubocop/lib/rubocop/cop/offense.rb#112 def corrected?; end # @api public # @return [Boolean] whether this offense is automatically disabled via a todo. # - # source://rubocop/lib/rubocop/cop/offense.rb#123 + # source://rubocop/lib/rubocop/cop/offense.rb#122 def corrected_with_todo?; end # @api public # @return [Corrector | nil] the autocorrection for this offense, or `nil` when not available # - # source://rubocop/lib/rubocop/cop/offense.rb#62 + # source://rubocop/lib/rubocop/cop/offense.rb#61 def corrector; end # @api public # @return [Boolean] whether this offense was locally disabled with a # disable or todo where it occurred. # - # source://rubocop/lib/rubocop/cop/offense.rb#134 + # source://rubocop/lib/rubocop/cop/offense.rb#133 def disabled?; end # @api public # @return [Boolean] returns `true` if two offenses contain same attributes # - # source://rubocop/lib/rubocop/cop/offense.rb#211 + # source://rubocop/lib/rubocop/cop/offense.rb#210 def eql?(other); end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#179 + # source://rubocop/lib/rubocop/cop/offense.rb#178 def first_line; end - # source://rubocop/lib/rubocop/cop/offense.rb#219 + # source://rubocop/lib/rubocop/cop/offense.rb#218 def hash; end # @api public # @return [Parser::Source::Range] the range of the code that is highlighted # - # source://rubocop/lib/rubocop/cop/offense.rb#142 + # source://rubocop/lib/rubocop/cop/offense.rb#141 def highlighted_area; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#189 + # source://rubocop/lib/rubocop/cop/offense.rb#188 def last_column; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#184 + # source://rubocop/lib/rubocop/cop/offense.rb#183 def last_line; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#155 + # source://rubocop/lib/rubocop/cop/offense.rb#154 def line; end # @api public @@ -29082,7 +29491,7 @@ class RuboCop::Cop::Offense # # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#203 + # source://rubocop/lib/rubocop/cop/offense.rb#202 def real_column; end # @api public @@ -29093,19 +29502,19 @@ class RuboCop::Cop::Offense # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#165 + # source://rubocop/lib/rubocop/cop/offense.rb#164 def source_line; end # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#54 + # source://rubocop/lib/rubocop/cop/offense.rb#53 def status; end # This is just for debugging purpose. # # @api private # - # source://rubocop/lib/rubocop/cop/offense.rb#148 + # source://rubocop/lib/rubocop/cop/offense.rb#147 def to_s; end end @@ -29114,10 +29523,10 @@ end # source://rubocop/lib/rubocop/cop/offense.rb#10 RuboCop::Cop::Offense::COMPARISON_ATTRIBUTES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/offense.rb#81 +# source://rubocop/lib/rubocop/cop/offense.rb#80 RuboCop::Cop::Offense::NO_LOCATION = T.let(T.unsafe(nil), RuboCop::Cop::Offense::PseudoSourceRange) -# source://rubocop/lib/rubocop/cop/offense.rb#64 +# source://rubocop/lib/rubocop/cop/offense.rb#63 class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # Returns the value of attribute begin_pos # @@ -29141,7 +29550,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # @return [Object] the newly set value def column=(_); end - # source://rubocop/lib/rubocop/cop/offense.rb#70 + # source://rubocop/lib/rubocop/cop/offense.rb#69 def column_range; end # Returns the value of attribute end_pos @@ -29170,7 +29579,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # @return [Object] the current value of line def last_line; end - # source://rubocop/lib/rubocop/cop/offense.rb#74 + # source://rubocop/lib/rubocop/cop/offense.rb#73 def length; end # Returns the value of attribute line @@ -29184,7 +29593,7 @@ class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # @return [Object] the newly set value def line=(_); end - # source://rubocop/lib/rubocop/cop/offense.rb#74 + # source://rubocop/lib/rubocop/cop/offense.rb#73 def size; end # Returns the value of attribute source_line @@ -29487,7 +29896,7 @@ class RuboCop::Cop::PercentLiteralCorrector # source://rubocop/lib/rubocop/cop/correctors/percent_literal_corrector.rb#34 def delimiters_for(type); end - # source://rubocop/lib/rubocop/cop/correctors/percent_literal_corrector.rb#100 + # source://rubocop/lib/rubocop/cop/correctors/percent_literal_corrector.rb#110 def end_content(source); end # @return [Boolean] @@ -30497,64 +30906,63 @@ end module RuboCop::Cop::StatementModifier include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::RangeHelp private - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#79 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#80 def code_after(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#103 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#104 def comment_disables_cop?(comment); end - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#71 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#72 def first_line_comment(node); end - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#58 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#57 def if_body_source(if_body); end - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#44 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#43 def length_in_modifier_form(node); end - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#97 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#98 def max_line_length; end - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#67 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#66 def method_source(if_body); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#38 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#37 def modifier_fits_on_single_line?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#27 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#26 def non_eligible_body?(body); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#34 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#33 def non_eligible_condition?(condition); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#20 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#19 def non_eligible_node?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#85 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#86 def parenthesize?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#12 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#11 def single_line_as_modifier?(node); end - # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#51 + # source://rubocop/lib/rubocop/cop/mixin/statement_modifier.rb#50 def to_modifier_form(node); end end @@ -30598,6 +31006,17 @@ end module RuboCop::Cop::StringLiteralsHelp private + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/mixin/string_literals_help.rb#24 + def enforce_double_quotes?; end + + # source://rubocop/lib/rubocop/cop/mixin/string_literals_help.rb#20 + def preferred_string_literal; end + + # source://rubocop/lib/rubocop/cop/mixin/string_literals_help.rb#28 + def string_literals_config; end + # @return [Boolean] # # source://rubocop/lib/rubocop/cop/mixin/string_literals_help.rb#9 @@ -30612,6 +31031,17 @@ module RuboCop::Cop::Style; end # EnforcedStyle config covers only method definitions. # Applications of visibility methods to symbols can be controlled # using AllowModifiersOnSymbols config. +# Also, the visibility of `attr*` methods can be controlled using +# AllowModifiersOnAttrs config. +# +# In Ruby 3.0, `attr*` methods now return an array of defined method names +# as symbols. So we can write the modifier and `attr*` in inline style. +# AllowModifiersOnAttrs config allows `attr*` methods to be written in +# inline style without modifying applications that have been maintained +# for a long time in group style. Furthermore, developers who are not very +# familiar with Ruby may know that the modifier applies to `def`, but they +# may not know that it also applies to `attr*` methods. It would be easier +# to understand if we could write `attr*` methods in inline style. # # @example EnforcedStyle: group (default) # # bad @@ -30654,6 +31084,8 @@ module RuboCop::Cop::Style; end # class Foo # # private :bar, :baz +# private *%i[qux quux] +# private *METHOD_NAMES # # end # @example AllowModifiersOnSymbols: false @@ -30661,96 +31093,137 @@ module RuboCop::Cop::Style; end # class Foo # # private :bar, :baz +# private *%i[qux quux] +# private *METHOD_NAMES # # end +# @example AllowModifiersOnAttrs: true (default) +# # good +# class Foo +# +# public attr_reader :bar +# protected attr_writer :baz +# private attr_accessor :qux +# private attr :quux # -# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#70 +# def public_method; end +# +# private +# +# def private_method; end +# +# end +# @example AllowModifiersOnAttrs: false +# # bad +# class Foo +# +# public attr_reader :bar +# protected attr_writer :baz +# private attr_accessor :qux +# private attr :quux +# +# end +# +# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#113 class RuboCop::Cop::Style::AccessModifierDeclarations < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#91 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#141 + def access_modifier_with_attr?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#134 def access_modifier_with_symbol?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#95 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#146 def on_send(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#145 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#205 def access_modifier_is_inlined?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#149 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#209 def access_modifier_is_not_inlined?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#127 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#187 + def allow_modifiers_on_attrs?(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#183 def allow_modifiers_on_symbols?(node); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#112 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#164 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#219 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#279 def def_source(node, def_node); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#180 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#240 def find_argument_less_modifier_node(node); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#169 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#229 def find_corresponding_def_node(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#137 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#197 def group_style?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#141 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#201 def inline_style?; end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#211 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#271 def insert_inline_modifier(corrector, node, modifier_name); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#159 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#219 def message(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#131 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#191 def offense?(node); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#215 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#179 + def percent_symbol_array?(node); end + + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#275 def remove_node(corrector, node); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#194 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#254 def replace_def(corrector, node, def_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#153 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#213 def right_siblings_same_inline_method?(node); end - # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#188 + # source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#248 def select_grouped_def_nodes(node); end end -# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#88 +# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#131 RuboCop::Cop::Style::AccessModifierDeclarations::ALLOWED_NODE_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#76 +# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#119 RuboCop::Cop::Style::AccessModifierDeclarations::GROUP_STYLE_MESSAGE = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#81 +# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#124 RuboCop::Cop::Style::AccessModifierDeclarations::INLINE_STYLE_MESSAGE = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#86 +# source://rubocop/lib/rubocop/cop/style/access_modifier_declarations.rb#129 RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for grouping of accessors in `class` and `module` bodies. @@ -30760,6 +31233,9 @@ RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsa # NOTE: If there is a method call before the accessor method it is always allowed # as it might be intended like Sorbet. # +# NOTE: If there is a RBS::Inline annotation comment just after the accessor method +# it is always allowed. +# # @example EnforcedStyle: grouped (default) # # bad # class Foo @@ -30796,73 +31272,73 @@ RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsa # attr_reader :baz # end # -# source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#50 +# source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#53 class RuboCop::Cop::Style::AccessorGrouping < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::VisibilityHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#59 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#62 def on_class(node); end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#59 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#62 def on_module(node); end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#59 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#62 def on_sclass(node); end private - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#82 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#85 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#71 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#74 def check(send_node); end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#114 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#122 def class_send_elements(class_node); end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#157 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#165 def group_accessors(node, accessors); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#96 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#99 def groupable_accessor?(node); end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#134 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#142 def groupable_sibling_accessors(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#126 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#134 def grouped_style?; end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#143 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#151 def message(send_node); end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#148 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#156 def preferred_accessors(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#91 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#94 def previous_line_comment?(node); end - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#163 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#171 def separate_accessors(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#130 + # source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#138 def separated_style?; end end -# source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#56 +# source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#59 RuboCop::Cop::Style::AccessorGrouping::GROUPED_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#57 +# source://rubocop/lib/rubocop/cop/style/accessor_grouping.rb#60 RuboCop::Cop::Style::AccessorGrouping::SEPARATED_MSG = T.let(T.unsafe(nil), String) # Enforces the use of either `#alias` or `#alias_method` @@ -30958,6 +31434,57 @@ RuboCop::Cop::Style::Alias::MSG_SYMBOL_ARGS = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/style/alias.rb#39 RuboCop::Cop::Style::Alias::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +# Looks for endless methods inside operations of lower precedence (`and`, `or`, and +# modifier forms of `if`, `unless`, `while`, `until`) that are ambiguous due to +# lack of parentheses. This may lead to unexpected behavior as the code may appear +# to use these keywords as part of the method but in fact they modify +# the method definition itself. +# +# In these cases, using a normal method definition is more clear. +# +# @example +# +# # bad +# def foo = true if bar +# +# # good - using a non-endless method is more explicit +# def foo +# true +# end if bar +# +# # ok - method body is explicit +# def foo = (true if bar) +# +# # ok - method definition is explicit +# (def foo = true) if bar +# +# source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#29 +class RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition < ::RuboCop::Cop::Base + include ::RuboCop::Cop::EndlessMethodRewriter + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::TargetRubyVersion + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#40 + def ambiguous_endless_method_body(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#48 + def on_def(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#69 + def keyword(operation); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#63 + def modifier_form?(operation); end +end + +# source://rubocop/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb#37 +RuboCop::Cop::Style::AmbiguousEndlessMethodDefinition::MSG = T.let(T.unsafe(nil), String) + # Checks for uses of `and` and `or`, and suggests using `&&` and # `||` instead. It can be configured to check only in conditions or in # all contexts. @@ -31087,6 +31614,8 @@ RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String) # # Names not on this list are likely to be meaningful and are allowed by default. # +# This cop handles not only method forwarding but also forwarding to `super`. +# # @example RedundantBlockArgumentNames: ['blk', 'block', 'proc'] (default) # # bad - But it is good with `EnforcedStyle: explicit` set for `Naming/BlockForwarding`. # def foo(&block) @@ -31174,222 +31703,245 @@ RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String) # bar(...) # end # -# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#125 +# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#127 class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#144 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#146 def on_def(node); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#144 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#146 def on_defs(node); end private - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#185 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#188 def add_forward_all_offenses(node, send_classifications, forwardable_args); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#351 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#366 def add_parens_if_missing(node, corrector); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#212 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#215 def add_post_ruby_32_offenses(def_node, send_classifications, forwardable_args); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#343 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#352 def allow_only_rest_arguments?; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#335 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#340 def arguments_range(node, first_node); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#263 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#267 def classification_and_forwards(def_node, send_node, referenced_lvars, forwardable_args); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#248 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#252 def classify_send_nodes(def_node, send_nodes, referenced_lvars, forwardable_args); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#495 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#542 def explicit_block_name?; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#168 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#170 def extract_forwardable_args(args); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#238 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#242 def non_splat_or_block_pass_lvar_references(body); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#180 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#182 def only_forwards_all?(send_classifications); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#292 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#296 def outside_block?(node); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#172 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#174 def redundant_forwardable_named_args(restarg, kwrestarg, blockarg); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#282 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#286 def redundant_named_arg(arg, config_name, keyword); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#325 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#329 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 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#302 def register_forward_args_offense(def_arguments_or_send, rest_arg_or_splat); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#314 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#318 def register_forward_block_arg_offense(add_parens, def_arguments_or_send, block_arg); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#306 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#310 def register_forward_kwargs_offense(add_parens, def_arguments_or_send, kwrest_arg_or_splat); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#347 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#360 + def send_inside_block?(send_classifications); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#356 def use_anonymous_forwarding?; end class << self - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#140 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#142 def autocorrect_incompatible_with; end end end -# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#133 +# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#135 RuboCop::Cop::Style::ArgumentsForwarding::ADDITIONAL_ARG_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#136 +# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#138 RuboCop::Cop::Style::ArgumentsForwarding::ARGS_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#138 +# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#140 RuboCop::Cop::Style::ArgumentsForwarding::BLOCK_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#132 +# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#134 RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_LVAR_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#135 +# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#137 RuboCop::Cop::Style::ArgumentsForwarding::FORWARDING_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#137 +# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#139 RuboCop::Cop::Style::ArgumentsForwarding::KWARGS_MSG = T.let(T.unsafe(nil), String) # Classifies send nodes for possible rest/kwrest/all (including block) forwarding. # -# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#358 +# source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#374 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#370 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#403 def initialize(def_node, send_node, referenced_lvars, forwardable_args, **config); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#398 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#431 def classification; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#365 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#387 + def def_all_anonymous_args?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#381 def extract_forwarded_kwrest_arg(param0 = T.unsafe(nil), param1); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#392 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#425 def forwarded_block_arg; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#368 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#384 def forwarded_block_arg?(param0 = T.unsafe(nil), param1); end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#386 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#419 def forwarded_kwrest_arg; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#380 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#413 def forwarded_rest_arg; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#362 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#378 def forwarded_rest_arg?(param0 = T.unsafe(nil), param1); end + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#396 + def send_all_anonymous_args?(param0 = T.unsafe(nil)); end + private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#466 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#513 def additional_kwargs?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#462 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#509 def additional_kwargs_or_forwarded_kwargs?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#476 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#523 def allow_offense_for_no_block?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#447 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#494 def any_arg_referenced?; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#431 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#478 def arguments; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#410 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#446 def can_forward_all?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#470 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#517 def forward_additional_kwargs?; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#427 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#474 def forwarded_rest_and_kwrest_args; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#489 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#536 def missing_rest_arg_or_kwrest_arg?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#480 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#527 def no_additional_args?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#455 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#502 def no_post_splat_args?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#423 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#470 def offensive_block_forwarding?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#443 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#490 def referenced_block_arg?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#439 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#486 def referenced_kwrest_arg?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#435 + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#482 def referenced_rest_arg?; end + # def foo(a = 41, ...) is a syntax error in 3.0. + # # @return [Boolean] # - # 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#458 + def ruby_30_or_lower_optarg?; end - # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#451 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#462 + def ruby_32_only_anonymous_forwarding?; end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#466 + def ruby_32_or_higher_missing_rest_or_kwest?; end + + # source://rubocop/lib/rubocop/cop/style/arguments_forwarding.rb#498 def target_ruby_version; end end @@ -31926,6 +32478,60 @@ class RuboCop::Cop::Style::BisectedAttrAccessor::Macro end end +# Prefer bitwise predicate methods over direct comparison operations. +# +# @example +# +# # bad - checks any set bits +# (variable & flags).positive? +# +# # good +# variable.anybits?(flags) +# +# # bad - checks all set bits +# (variable & flags) == flags +# +# # good +# variable.allbits?(flags) +# +# # bad - checks no set bits +# (variable & flags).zero? +# +# # good +# variable.nobits?(flags) +# +# source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#32 +class RuboCop::Cop::Style::BitwisePredicate < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#52 + def allbits?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#42 + def anybits?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#68 + def bit_operation?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#60 + def nobits?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#73 + def on_send(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#88 + def preferred_method(node); end +end + +# source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#36 +RuboCop::Cop::Style::BitwisePredicate::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/bitwise_predicate.rb#37 +RuboCop::Cop::Style::BitwisePredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Looks for uses of block comments (=begin...=end). # # @example @@ -32127,165 +32733,178 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#194 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#198 def on_block(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#194 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#198 def on_numblock(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#179 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#183 def on_send(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#459 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#487 def array_or_range?(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#208 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#212 def autocorrect(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#463 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#491 def begin_required?(block_node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#236 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#240 def braces_for_chaining_message(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#400 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#428 def braces_for_chaining_style?(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#248 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#252 def braces_required_message(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#377 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#405 def braces_required_method?(method_name); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#381 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#409 def braces_required_methods; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#410 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#438 def braces_style?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#455 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#483 def conditional?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#414 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#442 def correction_would_break_code?(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#309 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#328 def end_of_chain(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#424 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#452 def functional_block?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#420 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#448 def functional_method?(method_name); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#326 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#345 def get_blocks(node, &block); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#385 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#413 def line_count_based_block_style?(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#218 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#222 def line_count_based_message(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#252 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#256 def message(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#300 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#304 def move_comment_before_block(corrector, comment, block_node, closing_brace); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#432 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#460 def procedural_method?(method_name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#428 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#456 def procedural_oneliners_may_have_braces?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#344 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#364 def proper_block_style?(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#316 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#335 def remove_trailing_whitespace(corrector, range, comment); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#263 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#267 def replace_braces_with_do_end(corrector, loc); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#279 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#283 def replace_do_end_with_braces(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#356 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#377 def require_braces?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#448 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#385 + def require_do_end?(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#476 def return_value_of_scope?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#436 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#464 def return_value_used?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#389 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#417 def semantic_block_style?(node); end - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#226 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#230 def semantic_message(node); end + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#318 + def source_range_before_comment(range, comment); end + # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#364 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#392 def special_method?(method_name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#370 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#398 def special_method_proper_block_style?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#296 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#300 def whitespace_after?(range, length = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#292 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#296 def whitespace_before?(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#322 + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#341 def with_block?(node); end + + class << self + # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#179 + def autocorrect_incompatible_with; end + end end # source://rubocop/lib/rubocop/cop/style/block_delimiters.rb#175 @@ -32989,6 +33608,7 @@ RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # array.reject(&:nil?) # array.reject { |e| e.nil? } # array.select { |e| !e.nil? } +# array.filter { |e| !e.nil? } # array.grep_v(nil) # array.grep_v(NilClass) # @@ -32997,10 +33617,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? } +# hash.filter! { |k, v| !v.nil? } # # # good # hash.compact! @@ -33015,22 +33634,22 @@ class RuboCop::Cop::Style::CollectionCompact < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion - # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#85 + # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#86 def grep_v_with_nil?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#89 + # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#90 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#89 + # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#90 def on_send(node); end - # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#64 + # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#65 def reject_method?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#57 + # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#58 def reject_method_with_block_pass?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#74 + # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#75 def select_method?(param0 = T.unsafe(nil)); end private @@ -33050,6 +33669,9 @@ class RuboCop::Cop::Style::CollectionCompact < ::RuboCop::Cop::Base def to_enum_method?(node); end end +# source://rubocop/lib/rubocop/cop/style/collection_compact.rb#53 +RuboCop::Cop::Style::CollectionCompact::FILTER_METHODS = T.let(T.unsafe(nil), Array) + # source://rubocop/lib/rubocop/cop/style/collection_compact.rb#50 RuboCop::Cop::Style::CollectionCompact::MSG = T.let(T.unsafe(nil), String) @@ -33188,10 +33810,73 @@ end # source://rubocop/lib/rubocop/cop/style/colon_method_definition.rb#25 RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String) +# Checks for multiple `defined?` calls joined by `&&` that can be combined +# into a single `defined?`. +# +# When checking that a nested constant or chained method is defined, it is +# not necessary to check each ancestor or component of the chain. +# +# @example +# # bad +# defined?(Foo) && defined?(Foo::Bar) && defined?(Foo::Bar::Baz) +# +# # good +# defined?(Foo::Bar::Baz) +# +# # bad +# defined?(foo) && defined?(foo.bar) && defined?(foo.bar.baz) +# +# # good +# defined?(foo.bar.baz) +# +# source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#24 +class RuboCop::Cop::Style::CombinableDefined < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#31 + def on_and(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#55 + def defined_calls(nodes); end + + # If the redundant `defined?` node is the LHS of an `and` node, + # the term as well as the subsequent `&&`/`and` operator will be removed. + # + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#85 + def lhs_range_to_remove(term); end + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#62 + def namespaces(nodes); end + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#72 + def remove_term(corrector, term); end + + # If the redundant `defined?` node is the RHS of an `and` node, + # the term as well as the preceding `&&`/`and` operator will be removed. + # + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#100 + def rhs_range_to_remove(term); end + + # source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#49 + def terms(node); end +end + +# source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#28 +RuboCop::Cop::Style::CombinableDefined::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/combinable_defined.rb#29 +RuboCop::Cop::Style::CombinableDefined::OPERATORS = T.let(T.unsafe(nil), Array) + # Checks for places where multiple consecutive loops over the same data # can be combined into a single loop. It is very likely that combining them # will make the code more efficient and more concise. # +# NOTE: Autocorrection is not applied when the block variable names differ in separate loops, +# as it is impossible to determine which variable name should be prioritized. +# # @example # # bad # def method @@ -33237,44 +33922,44 @@ RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String) # each_slice(3) { |slice| do_something(slice) } # end # -# source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#59 +# source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#62 class RuboCop::Cop::Style::CombinableLoops < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#64 + # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#68 def on_block(node); end - # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#77 + # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#84 def on_for(node); end - # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#64 + # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#68 def on_numblock(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#88 + # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#95 def collection_looping_method?(node); end - # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#105 + # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#112 def combine_with_left_sibling(corrector, node); end - # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#112 + # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#119 def correct_end_of_block(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#93 + # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#100 def same_collection_looping_block?(node, sibling); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#101 + # source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#108 def same_collection_looping_for?(node, sibling); end end -# source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#62 +# source://rubocop/lib/rubocop/cop/style/combinable_loops.rb#65 RuboCop::Cop::Style::CombinableLoops::MSG = T.let(T.unsafe(nil), String) # Enforces using `` or %x around command literals. @@ -33523,7 +34208,7 @@ RuboCop::Cop::Style::CommentAnnotation::MSG_SPACE_STYLE = T.let(T.unsafe(nil), S # These keywords are: `class`, `module`, `def`, `begin`, `end`. # # Note that some comments -# are allowed. +# and RBS::Inline annotation comments are allowed. # # Autocorrection removes comments from `end` keyword and keeps comments # for `class`, `module`, `def` and `begin` above the keyword. @@ -33567,10 +34252,15 @@ class RuboCop::Cop::Style::CommentedKeyword < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/commented_keyword.rb#83 def offensive?(comment); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/commented_keyword.rb#95 + def rbs_inline_annotation?(line, comment); end + # source://rubocop/lib/rubocop/cop/style/commented_keyword.rb#70 def register_offense(comment, matched_keyword); end - # source://rubocop/lib/rubocop/cop/style/commented_keyword.rb#89 + # source://rubocop/lib/rubocop/cop/style/commented_keyword.rb#91 def source_line(comment); end end @@ -34165,10 +34855,10 @@ class RuboCop::Cop::Style::Copyright < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/copyright.rb#83 + # source://rubocop/lib/rubocop/cop/style/copyright.rb#86 def encoding_token?(processed_source, token_index); end - # source://rubocop/lib/rubocop/cop/style/copyright.rb#69 + # source://rubocop/lib/rubocop/cop/style/copyright.rb#72 def insert_notice_before(processed_source); end # source://rubocop/lib/rubocop/cop/style/copyright.rb#52 @@ -34176,12 +34866,12 @@ class RuboCop::Cop::Style::Copyright < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/copyright.rb#90 + # source://rubocop/lib/rubocop/cop/style/copyright.rb#93 def notice_found?(processed_source); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/copyright.rb#76 + # source://rubocop/lib/rubocop/cop/style/copyright.rb#79 def shebang_token?(processed_source, token_index); end # @raise [Warning] @@ -34334,7 +35024,6 @@ RuboCop::Cop::Style::DateTime::COERCION_MSG = T.let(T.unsafe(nil), String) # # # good (without parentheses it's a syntax error) # def foo() do_something end -# @example # # # bad # def Baz.foo() @@ -34346,18 +35035,18 @@ RuboCop::Cop::Style::DateTime::COERCION_MSG = T.let(T.unsafe(nil), String) # do_something # end # -# source://rubocop/lib/rubocop/cop/style/def_with_parentheses.rb#42 +# source://rubocop/lib/rubocop/cop/style/def_with_parentheses.rb#40 class RuboCop::Cop::Style::DefWithParentheses < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/def_with_parentheses.rb#47 + # source://rubocop/lib/rubocop/cop/style/def_with_parentheses.rb#45 def on_def(node); end - # source://rubocop/lib/rubocop/cop/style/def_with_parentheses.rb#47 + # source://rubocop/lib/rubocop/cop/style/def_with_parentheses.rb#45 def on_defs(node); end end -# source://rubocop/lib/rubocop/cop/style/def_with_parentheses.rb#45 +# source://rubocop/lib/rubocop/cop/style/def_with_parentheses.rb#43 RuboCop::Cop::Style::DefWithParentheses::MSG = T.let(T.unsafe(nil), String) # Checks for places where the `#\_\_dir\_\_` method can replace more @@ -34849,34 +35538,52 @@ RuboCop::Cop::Style::Documentation::MSG = T.let(T.unsafe(nil), String) # def do_something # end # end +# @example AllowedMethods: ['method_missing', 'respond_to_missing?'] +# +# # good +# class Foo +# def method_missing(name, *args) +# end # -# source://rubocop/lib/rubocop/cop/style/documentation_method.rb#98 +# def respond_to_missing?(symbol, include_private) +# end +# end +# +# source://rubocop/lib/rubocop/cop/style/documentation_method.rb#109 class RuboCop::Cop::Style::DocumentationMethod < ::RuboCop::Cop::Base include ::RuboCop::Cop::DocumentationComment include ::RuboCop::Cop::VisibilityHelp include ::RuboCop::Cop::DefNode - # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#105 + # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#116 def modifier_node?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#109 + # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#120 def on_def(node); end - # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#109 + # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#120 def on_defs(node); end private - # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#119 + # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#146 + def allowed_methods; end + + # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#130 def check(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#126 + # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#142 + def method_allowed?(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/documentation_method.rb#138 def require_for_non_public_methods?; end end -# source://rubocop/lib/rubocop/cop/style/documentation_method.rb#102 +# source://rubocop/lib/rubocop/cop/style/documentation_method.rb#113 RuboCop::Cop::Style::DocumentationMethod::MSG = T.let(T.unsafe(nil), String) # Detects double disable comments on one line. This is mostly to catch @@ -35016,38 +35723,38 @@ RuboCop::Cop::Style::DoubleNegation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr # # # good # 5.times { } -# @example +# # # bad # (0...10).each {} # # # good # 10.times {} # -# source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#25 +# source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#24 class RuboCop::Cop::Style::EachForSimpleLoop < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#53 + # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#52 def each_range(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#65 + # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#64 def each_range_with_zero_origin?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#77 + # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#76 def each_range_without_block_argument?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#30 + # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#29 def on_block(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#46 + # source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#45 def offending?(node); end end -# source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#28 +# source://rubocop/lib/rubocop/cop/style/each_for_simple_loop.rb#27 RuboCop::Cop::Style::EachForSimpleLoop::MSG = T.let(T.unsafe(nil), String) # Looks for inject / reduce calls where the passed in object is @@ -35364,10 +36071,10 @@ class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/empty_else.rb#193 + # source://rubocop/lib/rubocop/cop/style/empty_else.rb#194 def autocorrect_forbidden?(type); end - # source://rubocop/lib/rubocop/cop/style/empty_else.rb#186 + # source://rubocop/lib/rubocop/cop/style/empty_else.rb#187 def base_node(node); end # source://rubocop/lib/rubocop/cop/style/empty_else.rb#145 @@ -35376,7 +36083,7 @@ class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base # @return [Boolean] # # source://rubocop/lib/rubocop/cop/style/empty_else.rb#180 - def comment_in_else?(loc); end + def comment_in_else?(node); end # source://rubocop/lib/rubocop/cop/style/empty_else.rb#160 def empty_check(node); end @@ -35386,7 +36093,7 @@ class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/empty_else.rb#156 def empty_style?; end - # source://rubocop/lib/rubocop/cop/style/empty_else.rb#197 + # source://rubocop/lib/rubocop/cop/style/empty_else.rb#198 def missing_else_style; end # source://rubocop/lib/rubocop/cop/style/empty_else.rb#166 @@ -35435,26 +36142,14 @@ RuboCop::Cop::Style::EmptyElse::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::EmptyHeredoc < ::RuboCop::Cop::Base include ::RuboCop::Cop::Heredoc include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::StringLiteralsHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/empty_heredoc.rb#43 + # source://rubocop/lib/rubocop/cop/style/empty_heredoc.rb#44 def on_heredoc(node); end - - private - - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cop/style/empty_heredoc.rb#63 - def enforce_double_quotes?; end - - # source://rubocop/lib/rubocop/cop/style/empty_heredoc.rb#59 - def preferred_string_literal; end - - # source://rubocop/lib/rubocop/cop/style/empty_heredoc.rb#67 - def string_literals_config; end end -# source://rubocop/lib/rubocop/cop/style/empty_heredoc.rb#41 +# source://rubocop/lib/rubocop/cop/style/empty_heredoc.rb#42 RuboCop::Cop::Style::EmptyHeredoc::MSG = T.let(T.unsafe(nil), String) # Checks for parentheses for empty lambda parameters. Parentheses @@ -35495,7 +36190,9 @@ RuboCop::Cop::Style::EmptyLambdaParameter::MSG = T.let(T.unsafe(nil), String) # @example # # bad # a = Array.new +# a = Array[] # h = Hash.new +# h = Hash[] # s = String.new # # # good @@ -35503,83 +36200,79 @@ RuboCop::Cop::Style::EmptyLambdaParameter::MSG = T.let(T.unsafe(nil), String) # h = {} # s = '' # -# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#19 +# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#21 class RuboCop::Cop::Style::EmptyLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::FrozenStringLiteral include ::RuboCop::Cop::RangeHelp + include ::RuboCop::Cop::StringLiteralsHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#31 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#34 def array_node(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#40 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#43 def array_with_block(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#34 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#54 + def array_with_index(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#37 def hash_node(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#43 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#46 def hash_with_block(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#50 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#62 + def hash_with_index(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#69 def on_send(node); end - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#37 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#40 def str_node(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#111 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#118 def correction(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#74 - def enforce_double_quotes?; end - - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#82 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#89 def first_argument_unparenthesized?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#129 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#136 def frozen_strings?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#102 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#109 def offense_array_node?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#106 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#113 def offense_hash_node?(node); end - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#60 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#79 def offense_message(node); end - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#70 - def preferred_string_literal; end - - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#89 + # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#96 def replacement_range(node); end - - # source://rubocop/lib/rubocop/cop/style/empty_literal.rb#78 - def string_literals_config; end end -# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#24 +# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#27 RuboCop::Cop::Style::EmptyLiteral::ARR_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#25 +# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#28 RuboCop::Cop::Style::EmptyLiteral::HASH_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#28 +# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#31 RuboCop::Cop::Style::EmptyLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#26 +# source://rubocop/lib/rubocop/cop/style/empty_literal.rb#29 RuboCop::Cop::Style::EmptyLiteral::STR_MSG = T.let(T.unsafe(nil), String) # Checks for the formatting of empty method definitions. @@ -35783,34 +36476,29 @@ RuboCop::Cop::Style::EndBlock::MSG = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/style/endless_method.rb#49 class RuboCop::Cop::Style::EndlessMethod < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::EndlessMethodRewriter extend ::RuboCop::Cop::TargetRubyVersion extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#60 + # source://rubocop/lib/rubocop/cop/style/endless_method.rb#61 def on_def(node); end private - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#95 - def arguments(node, missing = T.unsafe(nil)); end - - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#85 - def correct_to_multiline(corrector, node); end - - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#70 + # source://rubocop/lib/rubocop/cop/style/endless_method.rb#71 def handle_allow_style(node); end - # source://rubocop/lib/rubocop/cop/style/endless_method.rb#79 + # source://rubocop/lib/rubocop/cop/style/endless_method.rb#80 def handle_disallow_style(node); end end -# source://rubocop/lib/rubocop/cop/style/endless_method.rb#56 +# source://rubocop/lib/rubocop/cop/style/endless_method.rb#57 RuboCop::Cop::Style::EndlessMethod::CORRECTION_STYLES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/endless_method.rb#57 +# source://rubocop/lib/rubocop/cop/style/endless_method.rb#58 RuboCop::Cop::Style::EndlessMethod::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/endless_method.rb#58 +# source://rubocop/lib/rubocop/cop/style/endless_method.rb#59 RuboCop::Cop::Style::EndlessMethod::MSG_MULTI_LINE = T.let(T.unsafe(nil), String) # Checks for consistent usage of `ENV['HOME']`. If `nil` is used as @@ -35859,9 +36547,18 @@ RuboCop::Cop::Style::EnvHome::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # will not attempt to automatically add a binding, or add filename and # line values. # -# This cop works only when a string literal is given as a code string. +# NOTE: This cop works only when a string literal is given as a code string. # No offense is reported if a string variable is given as below: # +# [source,ruby] +# ---- +# code = <<-RUBY +# def do_something +# end +# RUBY +# eval code # not checked. +# ---- +# # @example # # bad # eval <<-RUBY @@ -35886,100 +36583,93 @@ RuboCop::Cop::Style::EnvHome::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # def do_something # end # RUBY -# @example -# # not checked -# code = <<-RUBY -# def do_something -# end -# RUBY -# eval code # -# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#56 +# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#57 class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#74 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#75 def line_with_offset?(param0 = T.unsafe(nil), param1, param2); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#81 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#82 def on_send(node); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#69 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#70 def valid_eval_receiver?(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#186 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#187 def add_offense_for_different_line(node, line_node, line_diff); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#131 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#132 def add_offense_for_incorrect_line(method_name, line_node, sign, line_diff); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#201 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#202 def add_offense_for_missing_line(node, code); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#208 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#209 def add_offense_for_missing_location(node, code); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#180 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#181 def add_offense_for_same_line(node, line_node); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#143 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#144 def check_file(node, file_node); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#156 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#157 def check_line(node, code); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#95 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#96 def check_location(node, code); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#193 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#194 def expected_line(sign, line_diff); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#122 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#123 def file_and_line(node); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#168 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#169 def line_difference(line_node, code); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#220 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#221 def missing_line(node, code); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#109 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#110 def register_offense(node, &block); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#114 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#115 def special_file_keyword?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#118 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#119 def special_line_keyword?(node); end - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#172 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#173 def string_first_line(str_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#127 + # source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#128 def with_binding?(node); end end -# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#59 +# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#60 RuboCop::Cop::Style::EvalWithLocation::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#60 +# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#61 RuboCop::Cop::Style::EvalWithLocation::MSG_EVAL = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#61 +# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#62 RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_FILE = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#63 +# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#64 RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_LINE = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#66 +# source://rubocop/lib/rubocop/cop/style/eval_with_location.rb#67 RuboCop::Cop::Style::EvalWithLocation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for places where `Integer#even?` or `Integer#odd?` @@ -36488,8 +37178,7 @@ RuboCop::Cop::Style::FileEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Favor `File.(bin)read` convenience methods. # # @example -# ## text mode -# # bad +# # bad - text mode # File.open(filename).read # File.open(filename, &:read) # File.open(filename) { |f| f.read } @@ -36504,9 +37193,8 @@ RuboCop::Cop::Style::FileEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # # # good # File.read(filename) -# @example -# ## binary mode -# # bad +# +# # bad - binary mode # File.open(filename, 'rb').read # File.open(filename, 'rb', &:read) # File.open(filename, 'rb') do |f| @@ -36516,49 +37204,49 @@ RuboCop::Cop::Style::FileEmpty::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # # good # File.binread(filename) # -# source://rubocop/lib/rubocop/cop/style/file_read.rb#38 +# source://rubocop/lib/rubocop/cop/style/file_read.rb#35 class RuboCop::Cop::Style::FileRead < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/file_read.rb#65 + # source://rubocop/lib/rubocop/cop/style/file_read.rb#62 def block_read?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/file_read.rb#49 + # source://rubocop/lib/rubocop/cop/style/file_read.rb#46 def file_open?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/file_read.rb#69 + # source://rubocop/lib/rubocop/cop/style/file_read.rb#66 def on_send(node); end - # source://rubocop/lib/rubocop/cop/style/file_read.rb#60 + # source://rubocop/lib/rubocop/cop/style/file_read.rb#57 def send_read?(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/style/file_read.rb#84 + # source://rubocop/lib/rubocop/cop/style/file_read.rb#81 def evidence(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/file_read.rb#100 + # source://rubocop/lib/rubocop/cop/style/file_read.rb#97 def file_open_read?(node); end - # source://rubocop/lib/rubocop/cop/style/file_read.rb#106 + # source://rubocop/lib/rubocop/cop/style/file_read.rb#103 def read_method(mode); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/file_read.rb#92 + # source://rubocop/lib/rubocop/cop/style/file_read.rb#89 def read_node?(node, block_pass); end end -# source://rubocop/lib/rubocop/cop/style/file_read.rb#42 +# source://rubocop/lib/rubocop/cop/style/file_read.rb#39 RuboCop::Cop::Style::FileRead::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/file_read.rb#46 +# source://rubocop/lib/rubocop/cop/style/file_read.rb#43 RuboCop::Cop::Style::FileRead::READ_FILE_START_TO_FINISH_MODES = T.let(T.unsafe(nil), Set) -# source://rubocop/lib/rubocop/cop/style/file_read.rb#44 +# source://rubocop/lib/rubocop/cop/style/file_read.rb#41 RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Favor `File.(bin)write` convenience methods. @@ -36575,8 +37263,7 @@ RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # ---- # # @example -# ## text mode -# # bad +# # bad - text mode # File.open(filename, 'w').write(content) # File.open(filename, 'w') do |f| # f.write(content) @@ -36584,9 +37271,8 @@ RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # # # good # File.write(filename, content) -# @example -# ## binary mode -# # bad +# +# # bad - binary mode # File.open(filename, 'wb').write(content) # File.open(filename, 'wb') do |f| # f.write(content) @@ -36595,24 +37281,24 @@ RuboCop::Cop::Style::FileRead::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # # good # File.binwrite(filename, content) # -# source://rubocop/lib/rubocop/cop/style/file_write.rb#41 +# source://rubocop/lib/rubocop/cop/style/file_write.rb#38 class RuboCop::Cop::Style::FileWrite < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/file_write.rb#68 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#65 def block_write?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/file_write.rb#85 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#82 def evidence(node); end - # source://rubocop/lib/rubocop/cop/style/file_write.rb#52 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#49 def file_open?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/file_write.rb#72 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#69 def on_send(node); end - # source://rubocop/lib/rubocop/cop/style/file_write.rb#63 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#60 def send_write?(param0 = T.unsafe(nil)); end private @@ -36620,31 +37306,31 @@ class RuboCop::Cop::Style::FileWrite < ::RuboCop::Cop::Base # @return [Boolean] # @yield [content] # - # source://rubocop/lib/rubocop/cop/style/file_write.rb#95 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#92 def file_open_write?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/file_write.rb#123 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#120 def heredoc?(write_node); end - # source://rubocop/lib/rubocop/cop/style/file_write.rb#128 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#125 def heredoc_range(first_argument); end - # source://rubocop/lib/rubocop/cop/style/file_write.rb#108 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#105 def replacement(mode, filename, content, write_node); end - # source://rubocop/lib/rubocop/cop/style/file_write.rb#104 + # source://rubocop/lib/rubocop/cop/style/file_write.rb#101 def write_method(mode); end end -# source://rubocop/lib/rubocop/cop/style/file_write.rb#45 +# source://rubocop/lib/rubocop/cop/style/file_write.rb#42 RuboCop::Cop::Style::FileWrite::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/file_write.rb#47 +# source://rubocop/lib/rubocop/cop/style/file_write.rb#44 RuboCop::Cop::Style::FileWrite::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) -# source://rubocop/lib/rubocop/cop/style/file_write.rb#49 +# source://rubocop/lib/rubocop/cop/style/file_write.rb#46 RuboCop::Cop::Style::FileWrite::TRUNCATING_WRITE_MODES = T.let(T.unsafe(nil), Set) # Checks for division with integers coerced to floats. @@ -36897,8 +37583,8 @@ RuboCop::Cop::Style::FormatString::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array # The reason is that _unannotated_ format is very similar # to encoded URLs or Date/Time formatting strings. # -# This cop can be customized allowed methods with `AllowedMethods`. -# By default, there are no methods to allowed. +# This cop's allowed methods can be customized with `AllowedMethods`. +# By default, there are no allowed methods. # # It is allowed to contain unannotated token # if the number of them is less than or equals to @@ -37209,11 +37895,16 @@ class RuboCop::Cop::Style::GlobalStdStream < ::RuboCop::Cop::Base private - # source://rubocop/lib/rubocop/cop/style/global_std_stream.rb#64 + # source://rubocop/lib/rubocop/cop/style/global_std_stream.rb#70 def gvar_name(const_name); end - # source://rubocop/lib/rubocop/cop/style/global_std_stream.rb#60 + # source://rubocop/lib/rubocop/cop/style/global_std_stream.rb#62 def message(const_name); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/global_std_stream.rb#66 + def namespaced?(node); end end # source://rubocop/lib/rubocop/cop/style/global_std_stream.rb#37 @@ -37376,10 +38067,10 @@ RuboCop::Cop::Style::GlobalVars::MSG = T.let(T.unsafe(nil), String) # # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#114 class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Alignment - include ::RuboCop::Cop::LineLengthHelp include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::MinBodyLength + include ::RuboCop::Cop::Alignment + include ::RuboCop::Cop::LineLengthHelp include ::RuboCop::Cop::StatementModifier extend ::RuboCop::Cop::AutoCorrector @@ -37407,12 +38098,12 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#283 + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#285 def accepted_if?(node, ending); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#297 + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#312 def allowed_consecutive_conditionals?; end # @return [Boolean] @@ -37420,6 +38111,11 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#265 def and_or_guard_clause?(guard_clause); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#296 + def assigned_lvar_used_in_if_branch?(node); end + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#210 def autocorrect(corrector, node, condition, replacement, guard); end @@ -37451,7 +38147,7 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#188 def register_offense(node, scope_exiting_keyword, conditional_keyword, guard = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#293 + # source://rubocop/lib/rubocop/cop/style/guard_clause.rb#308 def remove_whole_lines(corrector, range); end # @return [Boolean] @@ -37647,80 +38343,83 @@ class RuboCop::Cop::Style::HashEachMethods < ::RuboCop::Cop::Base include ::RuboCop::Cop::Lint::UnusedArgument extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#74 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#79 def check_unused_block_args(node, key, value); end # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#51 def each_arguments(param0 = T.unsafe(nil)); end + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#61 + def hash_mutated?(param0 = T.unsafe(nil), param1); end + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#46 def kv_each(param0 = T.unsafe(nil)); end # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#56 def kv_each_with_block_pass(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#60 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#65 def on_block(node); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#95 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#100 def on_block_pass(node); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#60 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#65 def on_numblock(node); end private - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#180 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#186 def check_argument(variable); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#204 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#210 def correct_args(node, corrector); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#190 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#196 def correct_implicit(node, corrector, method_name); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#195 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#201 def correct_key_value_each(node, corrector); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#176 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#182 def format_message(method_name, current); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#103 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#108 def handleable?(node); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#211 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#217 def kv_range(outer_node); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#133 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#139 def message(prefer, method_name, unused_code); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#139 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#145 def register_each_args_offense(node, message, prefer, unused_range); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#110 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#116 def register_kv_offense(target, method); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#146 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#152 def register_kv_with_block_pass_offense(node, target, method); end - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#167 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#173 def root_receiver(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#121 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#127 def unused_block_arg_exist?(node, block_arg); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#157 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#163 def use_array_converter_method_as_preceding?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#186 + # source://rubocop/lib/rubocop/cop/style/hash_each_methods.rb#192 def used?(arg); end end @@ -37749,9 +38448,9 @@ RuboCop::Cop::Style::HashEachMethods::UNUSED_BLOCK_ARG_MSG = T.let(T.unsafe(nil) # {foo: 1, bar: 2, baz: 3}.reject {|k, v| k == :bar } # {foo: 1, bar: 2, baz: 3}.select {|k, v| k != :bar } # {foo: 1, bar: 2, baz: 3}.filter {|k, v| k != :bar } -# {foo: 1, bar: 2, baz: 3}.reject {|k, v| %i[foo bar].include?(k) } -# {foo: 1, bar: 2, baz: 3}.select {|k, v| !%i[foo bar].include?(k) } -# {foo: 1, bar: 2, baz: 3}.filter {|k, v| !%i[foo bar].include?(k) } +# {foo: 1, bar: 2, baz: 3}.reject {|k, v| %i[bar].include?(k) } +# {foo: 1, bar: 2, baz: 3}.select {|k, v| !%i[bar].include?(k) } +# {foo: 1, bar: 2, baz: 3}.filter {|k, v| !%i[bar].include?(k) } # # # good # {foo: 1, bar: 2, baz: 3}.except(:bar) @@ -37778,42 +38477,42 @@ class RuboCop::Cop::Style::HashExcept < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#94 - def bad_method?(block); end + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#95 + def bad_method?(method_name, block); end - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#166 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#169 def decorate_source(value); end - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#174 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#177 def except_key(node); end - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#153 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#156 def except_key_source(key); end - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#147 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#150 def extract_body_if_negated(body); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#128 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#131 def included?(negated, body); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#132 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#135 def not_included?(negated, body); end - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#183 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#186 def offense_range(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#136 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#139 def safe_to_register_offense?(block, except_key); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_except.rb#112 + # source://rubocop/lib/rubocop/cop/style/hash_except.rb#115 def semantically_except_method?(send, block); end end @@ -37902,10 +38601,12 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) # * never - forces use of explicit hash literal value # * either - accepts both shorthand and explicit use of hash literal value # * consistent - forces use of the 3.1 syntax only if all values can be omitted in the hash +# * either_consistent - accepts both shorthand and explicit use of hash literal value, +# but they must be consistent # -# @example EnforcedShorthandSyntax: consistent +# @example EnforcedShorthandSyntax: either_consistent # -# # bad - `foo` and `bar` values can be omitted +# # good - `foo` and `bar` values can be omitted, but they are consistent, so it's accepted # {foo: foo, bar: bar} # # # bad - `bar` value can be omitted @@ -37942,7 +38643,7 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) # # good # {a: 1, b: 2} # {:c => 3, 'd' => 4} -# @example EnforcedShorthandSyntax: always (default) +# @example EnforcedShorthandSyntax: always # # # bad # {foo: foo, bar: bar} @@ -37956,7 +38657,7 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) # # # good # {foo: foo, bar: bar} -# @example EnforcedShorthandSyntax: either +# @example EnforcedShorthandSyntax: either (default) # # # good # {foo: foo, bar: bar} @@ -37966,6 +38667,22 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) # # # good # {foo:, bar:} +# @example EnforcedShorthandSyntax: consistent +# +# # bad - `foo` and `bar` values can be omitted +# {foo: foo, bar: bar} +# +# # bad - `bar` value can be omitted +# {foo:, bar: bar} +# +# # bad - mixed syntaxes +# {foo:, bar: baz} +# +# # good +# {foo:, bar:} +# +# # good - can't omit `baz` +# {foo: foo, bar: baz} # @example EnforcedStyle: ruby19 (default) # # bad # {:a => 2} @@ -37976,84 +38693,84 @@ RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) # {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol # {d: 1, 'e' => 2} # technically not forbidden # -# source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#113 +# source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#131 class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::HashShorthandSyntax include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#167 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#185 def alternative_style; end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#145 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#163 def hash_rockets_check(pairs); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#159 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#177 def no_mixed_keys_check(pairs); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#123 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#141 def on_hash(node); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#141 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#159 def ruby19_check(pairs); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#149 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#167 def ruby19_no_mixed_keys_check(pairs); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#199 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#217 def acceptable_19_syntax_symbol?(sym_name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#256 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#274 def argument_without_space?(node); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#178 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#196 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#260 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#278 def autocorrect_hash_rockets(corrector, pair_node); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#269 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#287 def autocorrect_no_mixed_keys(corrector, pair_node); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#235 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#253 def autocorrect_ruby19(corrector, pair_node); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#220 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#238 def check(pairs, delim, msg); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#277 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#295 def force_hash_rockets?(pairs); end - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#248 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#266 def range_for_autocorrect_ruby19(pair_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#188 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#206 def sym_indices?(pairs); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#192 + # source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#210 def word_symbol_pair?(pair); end end -# source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#119 +# source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#137 RuboCop::Cop::Style::HashSyntax::MSG_19 = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#121 +# source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#139 RuboCop::Cop::Style::HashSyntax::MSG_HASH_ROCKETS = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#120 +# source://rubocop/lib/rubocop/cop/style/hash_syntax.rb#138 RuboCop::Cop::Style::HashSyntax::MSG_NO_MIXED_KEYS = T.let(T.unsafe(nil), String) # Looks for uses of `\_.each_with_object({}) {...}`, @@ -38473,9 +39190,9 @@ RuboCop::Cop::Style::IfInsideElse::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::IfUnlessModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::StatementModifier include ::RuboCop::Cop::AllowedPattern + include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::CommentsHelp extend ::RuboCop::Cop::AutoCorrector @@ -38619,7 +39336,6 @@ RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_NORMAL = T.let(T.unsafe(nil), Str class RuboCop::Cop::Style::IfUnlessModifierOfIfUnless < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::StatementModifier extend ::RuboCop::Cop::AutoCorrector @@ -38666,7 +39382,7 @@ RuboCop::Cop::Style::IfUnlessModifierOfIfUnless::MSG = T.let(T.unsafe(nil), Stri # # # good # foo == bar -# @example +# # # bad # if foo.do_something? # true @@ -38680,61 +39396,61 @@ RuboCop::Cop::Style::IfUnlessModifierOfIfUnless::MSG = T.let(T.unsafe(nil), Stri # # good # num.nonzero? ? true : false # -# source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#62 +# source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#61 class RuboCop::Cop::Style::IfWithBooleanLiteralBranches < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#74 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#73 def double_negative?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#70 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#69 def if_with_boolean_literal_branches?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#76 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#75 def on_if(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#134 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#135 def assume_boolean_value?(condition); end - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#114 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#113 def message(node, keyword); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#96 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#95 def multiple_elsif?(node); end - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#102 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#101 def offense_range_with_keyword(node, condition); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#151 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#152 def opposite_condition?(node); end - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#141 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#142 def replacement_condition(node, condition); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#156 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#157 def require_parentheses?(condition); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#120 + # source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#121 def return_boolean_value?(condition); end end -# source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#66 +# source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#65 RuboCop::Cop::Style::IfWithBooleanLiteralBranches::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#67 +# source://rubocop/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb#66 RuboCop::Cop::Style::IfWithBooleanLiteralBranches::MSG_FOR_ELSIF = T.let(T.unsafe(nil), String) # Checks for uses of semicolon in if statements. @@ -38752,25 +39468,47 @@ class RuboCop::Cop::Style::IfWithSemicolon < ::RuboCop::Cop::Base include ::RuboCop::Cop::OnNormalIfUnless extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#23 + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#24 def on_normal_if_unless(node); end private - # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#38 - def autocorrect(node); end + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#54 + def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#56 + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#93 def build_else_branch(second_condition); end - # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#47 + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#84 + def build_expression(expr); end + + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#75 def correct_elsif(node); end + + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#40 + def message(node); end + + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#66 + def replacement(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#113 + def require_argument_parentheses?(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#62 + def use_block_in_branches?(node); end end # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#20 RuboCop::Cop::Style::IfWithSemicolon::MSG_IF_ELSE = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#21 +RuboCop::Cop::Style::IfWithSemicolon::MSG_NEWLINE = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/if_with_semicolon.rb#22 RuboCop::Cop::Style::IfWithSemicolon::MSG_TERNARY = T.let(T.unsafe(nil), String) # Checks for `raise` or `fail` statements which do not specify an @@ -38827,6 +39565,9 @@ class RuboCop::Cop::Style::InPatternThen < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/in_pattern_then.rb#46 def alternative_pattern_source(pattern); end + + # source://rubocop/lib/rubocop/cop/style/in_pattern_then.rb#50 + def collect_alternative_patterns(pattern); end end # source://rubocop/lib/rubocop/cop/style/in_pattern_then.rb#27 @@ -39218,6 +39959,40 @@ RuboCop::Cop::Style::IpAddresses::IPV6_MAX_SIZE = T.let(T.unsafe(nil), Integer) # source://rubocop/lib/rubocop/cop/style/ip_addresses.rb#25 RuboCop::Cop::Style::IpAddresses::MSG = T.let(T.unsafe(nil), String) +# When passing an existing hash as keyword arguments, provide additional arguments +# directly rather than using `merge`. +# +# Providing arguments directly is more performant, than using `merge`, and +# also leads to a shorter and simpler code. +# +# @example +# # bad +# some_method(**opts.merge(foo: true)) +# some_method(**opts.merge(other_opts)) +# +# # good +# some_method(**opts, foo: true) +# some_method(**opts, **other_opts) +# +# source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#21 +class RuboCop::Cop::Style::KeywordArgumentsMerging < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#27 + def merge_kwargs?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#36 + def on_kwsplat(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#48 + def autocorrect(corrector, kwsplat_node, hash_node, other_hash_node); end +end + +# source://rubocop/lib/rubocop/cop/style/keyword_arguments_merging.rb#24 +RuboCop::Cop::Style::KeywordArgumentsMerging::MSG = T.let(T.unsafe(nil), String) + # Enforces that optional keyword parameters are placed at the # end of the parameters list. # @@ -39657,7 +40432,7 @@ end # # source://rubocop/lib/rubocop/cop/style/magic_comment_format.rb#107 class RuboCop::Cop::Style::MagicCommentFormat::CommentRange - extend ::Forwardable + extend ::RuboCop::SimpleForwardable # @return [CommentRange] a new instance of CommentRange # @@ -39675,11 +40450,11 @@ class RuboCop::Cop::Style::MagicCommentFormat::CommentRange # source://rubocop/lib/rubocop/cop/style/magic_comment_format.rb#125 def directives; end - # source://forwardable/1.3.3forwardable.rb#231 - def loc(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def loc(*_arg0, **_arg1, &_arg2); end - # source://forwardable/1.3.3forwardable.rb#231 - def text(*args, **_arg1, &block); end + # source://rubocop-ast/1.34.0lib/rubocop/ast/utilities/simple_forwardable.rb#9 + def text(*_arg0, **_arg1, &_arg2); end # A magic comment can contain one value (normal style) or # multiple directives (emacs style) @@ -39707,6 +40482,7 @@ RuboCop::Cop::Style::MagicCommentFormat::MSG_VALUE = T.let(T.unsafe(nil), String RuboCop::Cop::Style::MagicCommentFormat::SNAKE_SEPARATOR = T.let(T.unsafe(nil), String) # Prefer `select` or `reject` over `map { ... }.compact`. +# This cop also handles `filter_map { ... }`, similar to `map { ... }.compact`. # # @example # @@ -39714,6 +40490,9 @@ RuboCop::Cop::Style::MagicCommentFormat::SNAKE_SEPARATOR = T.let(T.unsafe(nil), # array.map { |e| some_condition? ? e : next }.compact # # # bad +# array.filter_map { |e| some_condition? ? e : next } +# +# # bad # array.map do |e| # if some_condition? # e @@ -39740,48 +40519,60 @@ RuboCop::Cop::Style::MagicCommentFormat::SNAKE_SEPARATOR = T.let(T.unsafe(nil), # # good # array.reject { |e| some_condition? } # -# source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#40 +# source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#44 class RuboCop::Cop::Style::MapCompactWithConditionalBlock < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#46 - def map_and_compact?(param0 = T.unsafe(nil)); end + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#51 + def conditional_block(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#72 + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#76 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#72 + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#76 def on_send(node); end private - # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#126 - def range(node); end + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#148 + def current(node); end + + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#162 + def filter_map_range(node); end + + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#96 + def inspect(node, block_argument_node, condition_node, return_value_node, range); end + + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#158 + def map_with_compact_range(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#92 + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#114 def returns_block_argument?(block_argument_node, return_value_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#96 + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#118 def truthy_branch?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#116 + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#138 def truthy_branch_for_guard?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#106 + # source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#128 def truthy_branch_for_if?(node); end end -# source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#43 +# source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#47 RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil), String) +# source://rubocop/lib/rubocop/cop/style/map_compact_with_conditional_block.rb#48 +RuboCop::Cop::Style::MapCompactWithConditionalBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks for usages of `each` with `<<`, `push`, or `append` which # can be replaced by `map`. # @@ -39792,8 +40583,10 @@ RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil), # 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. +# NOTE: It only detects when the mapping destination is either: +# * a local variable initialized as an empty array and referred to only by the +# pushing operation; +# * or, if it is the single block argument to a `[].tap` block. # This is because, if not, it's challenging to statically guarantee that the # mapping destination variable remains an empty array: # @@ -39815,74 +40608,96 @@ RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil), # # good # dest = src.map { |e| e * 2 } # +# # bad +# [].tap do |dest| +# src.each { |e| dest << e * 2 } +# end +# +# # 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 +# source://rubocop/lib/rubocop/cop/style/map_into_array.rb#60 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 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#109 def after_leaving_scope(scope, _variable_table); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#57 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#72 def each_block_with_push?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#66 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#81 def empty_array_asgn?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#69 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#93 + def empty_array_tap(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#103 def lvar_ref?(param0 = T.unsafe(nil), param1); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#79 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#113 def on_block(node); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#79 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#113 def on_numblock(node); end + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#67 + def suitable_argument_node?(param0 = T.unsafe(nil)); end + private - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#155 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#213 def correct_push_node(corrector, push_node); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#163 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#221 def correct_return_value_handling(corrector, block, dest_var); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#108 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#156 def dest_used_only_for_mapping?(block, dest_var, asgn); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#102 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#150 def find_closest_assignment(block, dest_var); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#94 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#133 def find_dest_var(block); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#127 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#181 def new_method_name; end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#116 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#141 + def offending_empty_array_tap?(node, dest_var); end + + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#164 def register_offense(block, dest_var, asgn); end - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#148 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#200 def remove_assignment(corrector, asgn); end + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#207 + def remove_tap(corrector, node, block_node); end + # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#133 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#187 def return_value_used?(node); end class << self - # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#71 + # source://rubocop/lib/rubocop/cop/style/map_into_array.rb#105 def joining_forces; end end end -# source://rubocop/lib/rubocop/cop/style/map_into_array.rb#54 +# source://rubocop/lib/rubocop/cop/style/map_into_array.rb#64 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 @@ -39977,7 +40792,7 @@ RuboCop::Cop::Style::MapToSet::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::MapToSet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Enforces the presence (default) or absence of parentheses in -# method calls containing parameters. +# method calls containing arguments. # # In the default style (require_parentheses), macro methods are allowed. # Additional methods can be added to the `AllowedMethods` or @@ -40168,6 +40983,7 @@ class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::AllowedPattern include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses + include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses extend ::RuboCop::Cop::AutoCorrector @@ -40203,114 +41019,116 @@ end # # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#9 module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses + include ::RuboCop::Cop::RangeHelp + private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#70 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#80 def allowed_camel_case_method_call?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#174 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#184 def allowed_chained_call_with_parentheses?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#170 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#180 def allowed_multiline_call_with_parentheses?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#75 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#85 def allowed_string_interpolation_method_call?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#183 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#193 def ambiguous_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#212 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#222 def assigned_before?(node, target); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#220 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#230 def assignment_in_condition?(node); end - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#31 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#34 def autocorrect(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#151 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#161 def call_as_argument_or_chain?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#144 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#154 def call_in_argument_with_block?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#100 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#110 def call_in_literals?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#111 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#121 def call_in_logical_operators?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#157 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#167 def call_in_match_pattern?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#120 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#130 def call_in_optional_arguments?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#124 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#134 def call_in_single_line_inheritance?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#128 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#138 def call_with_ambiguous_arguments?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#140 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#150 def call_with_braced_block?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#230 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#240 def forwards_anonymous_rest_arguments?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#199 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#209 def hash_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#163 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#173 def hash_literal_in_arguments?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#44 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#50 def inside_endless_method_def?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#216 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#226 def inside_string_interpolation?(node); end # Require hash value omission be enclosed in parentheses to prevent the following issue: @@ -40318,70 +41136,75 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#58 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#64 def last_expression?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#87 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#97 def legitimate_call_with_parentheses?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#195 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#205 def logical_operator?(node); end - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#40 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#72 + def method_call_before_constant_resolution?(node); end + + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#46 def offense_range(node); end - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#16 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#18 def omit_parentheses(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#80 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#90 def parentheses_at_the_end_of_multiline_call?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#203 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#213 def regexp_slash_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#49 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#55 def require_parentheses_for_hash_value_omission?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#187 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#197 def splat?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#66 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#76 def super_call_without_arguments?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#62 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#68 def syntax_like_method_call?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#191 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#201 def ternary_if?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#207 + # source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#217 def unary_literal?(node); end end -# source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#11 +# source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#13 RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::OMIT_MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#10 +# source://rubocop/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#12 RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::TRAILING_WHITESPACE_REGEX = T.let(T.unsafe(nil), Regexp) # Style require_parentheses @@ -40417,8 +41240,8 @@ RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses::REQUIRE_ # Checks for unwanted parentheses in parameterless method calls. # -# This cop can be customized allowed methods with `AllowedMethods`. -# By default, there are no methods to allowed. +# This cop's allowed methods can be customized with `AllowedMethods`. +# By default, there are no allowed methods. # # NOTE: This cop allows the use of `it()` without arguments in blocks, # as in `0.times { it() }`, following `Lint/ItWithoutArgumentsInBlock` cop. @@ -40893,15 +41716,10 @@ class RuboCop::Cop::Style::MissingElse < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/missing_else.rb#127 def check(node); end - # source://rubocop/lib/rubocop/cop/style/missing_else.rb#181 + # source://rubocop/lib/rubocop/cop/style/missing_else.rb#177 def empty_else_config; end - # @return [Boolean] - # # source://rubocop/lib/rubocop/cop/style/missing_else.rb#171 - def empty_else_cop_enabled?; end - - # source://rubocop/lib/rubocop/cop/style/missing_else.rb#175 def empty_else_style; end # @return [Boolean] @@ -41279,7 +42097,6 @@ RuboCop::Cop::Style::MultilineBlockChain::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::MultilineIfModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::StatementModifier extend ::RuboCop::Cop::AutoCorrector @@ -41613,11 +42430,6 @@ class RuboCop::Cop::Style::MultilineWhenThen < ::RuboCop::Cop::Base private - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cop/style/multiline_when_then.rb#58 - def accept_node_type?(node); end - # Requires `then` for write `when` and its body on the same line. # # @return [Boolean] @@ -41676,64 +42488,50 @@ class RuboCop::Cop::Style::MultipleComparison < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#58 - def on_new_investigation; end - - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#62 def on_or(node); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#88 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#80 def simple_comparison_lhs?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#93 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#85 def simple_comparison_rhs?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#85 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#77 def simple_double_comparison?(param0 = T.unsafe(nil)); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#161 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#142 def allow_method_comparison?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#136 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#121 def comparison?(node); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#165 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#146 def comparisons_threshold; end - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#128 - def nested_comparison?(node); end + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#90 + def find_offending_var(node, variables = T.unsafe(nil), values = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#97 - def nested_variable_comparison?(node); end - - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#156 - def reset_comparison; end + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#113 + def nested_comparison?(node); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#140 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#132 def root_of_or_node(or_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#150 - def switch_comparison?(node); end + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#125 + def simple_comparison?(node); end - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#124 + # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#109 def variable_name(node); end - - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#103 - def variables_in_node(node); end - - # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#111 - def variables_in_simple_node(node); end end # source://rubocop/lib/rubocop/cop/style/multiple_comparison.rb#55 @@ -41815,7 +42613,7 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector - # source://rubocop-sorbet/0.8.3lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18 + # source://rubocop-sorbet/0.8.7lib/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 @@ -41833,7 +42631,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.8.3lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 + # source://rubocop-sorbet/0.8.7lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#12 def t_let(param0 = T.unsafe(nil)); end private @@ -43077,8 +43875,8 @@ RuboCop::Cop::Style::NumericLiterals::MSG = T.let(T.unsafe(nil), String) # These can be replaced by their respective predicate methods. # This cop can also be configured to do the reverse. # -# This cop can be customized allowed methods with `AllowedMethods`. -# By default, there are no methods to allowed. +# This cop's allowed methods can be customized with `AllowedMethods`. +# By default, there are no allowed methods. # # This cop disregards `#nonzero?` as its value is truthy or falsey, # but not `true` and `false`, and thus not always interchangeable with @@ -43141,16 +43939,16 @@ class RuboCop::Cop::Style::NumericPredicate < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedPattern extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#166 + # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#174 def comparison(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#171 + # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#179 def inverted_comparison(param0 = T.unsafe(nil)); end # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#90 def on_send(node); end - # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#161 + # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#169 def predicate(param0 = T.unsafe(nil)); end private @@ -43163,23 +43961,28 @@ class RuboCop::Cop::Style::NumericPredicate < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#111 def check(node); end - # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#152 + # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#154 def invert; end - # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#132 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#162 + def negated?(node); end + + # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#134 def parenthesized_source(node); end # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#124 - def replacement(numeric, operation); end + def replacement(node, numeric, operation); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#144 + # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#146 def replacement_supported?(operator); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#140 + # source://rubocop/lib/rubocop/cop/style/numeric_predicate.rb#142 def require_parentheses?(node); end end @@ -43284,42 +44087,42 @@ class RuboCop::Cop::Style::OneLineConditional < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#77 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#81 def always_multiline?; end - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#59 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#63 def autocorrect(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#81 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#85 def cannot_replace_to_ternary?(node); end - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#93 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#97 def expr_replacement(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#114 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#118 def keyword_with_changed_precedence?(node); end - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#55 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#59 def message(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#107 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#111 def method_call_with_changed_precedence?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#99 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#103 def requires_parentheses?(node); end - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#67 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#71 def ternary_correction(node); end - # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#85 + # source://rubocop/lib/rubocop/cop/style/one_line_conditional.rb#89 def ternary_replacement(node); end end @@ -43385,27 +44188,35 @@ RuboCop::Cop::Style::OpenStructUse::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::OperatorMethodCall < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#27 + # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#30 def on_send(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#53 - def anonymous_forwarding?(argument); end + # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#75 + def insert_space_after?(node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#58 + def invalid_syntax_argument?(argument); end # Checks for an acceptable case of `foo.+(bar).baz`. # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#47 + # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#52 def method_call_with_parenthesized_arg?(argument); end - # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#60 + # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#64 def wrap_in_parentheses_if_chained(corrector, node); end end +# source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#25 +RuboCop::Cop::Style::OperatorMethodCall::INVALID_SYNTAX_ARG_TYPES = T.let(T.unsafe(nil), Array) + # source://rubocop/lib/rubocop/cop/style/operator_method_call.rb#23 RuboCop::Cop::Style::OperatorMethodCall::MSG = T.let(T.unsafe(nil), String) @@ -43755,14 +44566,14 @@ class RuboCop::Cop::Style::ParallelAssignment::GenericCorrector private - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#233 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#234 def cop_config; end - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#229 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#230 def extract_sources(node); end # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#219 - def source(node); end + def source(node, loc); end end # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#29 @@ -43771,37 +44582,37 @@ RuboCop::Cop::Style::ParallelAssignment::MSG = T.let(T.unsafe(nil), String) # An internal class for correcting parallel assignment # guarded by if, unless, while, or until # -# source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#275 +# source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#276 class RuboCop::Cop::Style::ParallelAssignment::ModifierCorrector < ::RuboCop::Cop::Style::ParallelAssignment::GenericCorrector - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#276 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#277 def correction; end - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#285 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#286 def correction_range; end private - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#291 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#292 def modifier_range(node); end end # An internal class for correcting parallel assignment # protected by rescue # -# source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#240 +# source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#241 class RuboCop::Cop::Style::ParallelAssignment::RescueCorrector < ::RuboCop::Cop::Style::ParallelAssignment::GenericCorrector - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#241 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#242 def correction; end - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#252 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#253 def correction_range; end private - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#263 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#264 def begin_correction(rescue_result); end - # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#258 + # source://rubocop/lib/rubocop/cop/style/parallel_assignment.rb#259 def def_correction(rescue_result); end end @@ -44211,7 +45022,7 @@ RuboCop::Cop::Style::Proc::MSG = T.let(T.unsafe(nil), String) # # String interpolation is always kept in double quotes. # -# Note: `Lint/SymbolConversion` can be used in parallel to ensure that symbols +# NOTE: `Lint/SymbolConversion` can be used in parallel to ensure that symbols # are not quoted that don't need to be. This cop is for configuring the quoting # style to use for symbols that require quotes. # @@ -44244,7 +45055,7 @@ class RuboCop::Cop::Style::QuotedSymbols < ::RuboCop::Cop::Base private - # source://rubocop/lib/rubocop/cop/style/quoted_symbols.rb#108 + # source://rubocop/lib/rubocop/cop/style/quoted_symbols.rb#106 def alternative_style; end # source://rubocop/lib/rubocop/cop/style/quoted_symbols.rb#71 @@ -44265,7 +45076,7 @@ class RuboCop::Cop::Style::QuotedSymbols < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/quoted_symbols.rb#112 + # source://rubocop/lib/rubocop/cop/style/quoted_symbols.rb#110 def quoted?(sym_node); end # source://rubocop/lib/rubocop/cop/style/quoted_symbols.rb#99 @@ -44273,7 +45084,7 @@ class RuboCop::Cop::Style::QuotedSymbols < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/quoted_symbols.rb#116 + # source://rubocop/lib/rubocop/cop/style/quoted_symbols.rb#114 def wrong_quotes?(node); end end @@ -44706,81 +45517,86 @@ class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#72 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#76 def offensive_kwbegins(param0); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#84 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#88 def on_block(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#76 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#80 def on_def(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#76 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#80 def on_defs(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#95 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#99 def on_kwbegin(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#84 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#88 def on_numblock(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#103 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#107 def allowable_kwbegin?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#177 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#181 def begin_block_has_multiline_statements?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#169 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#173 def condition_range(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#181 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#185 def contain_rescue_or_ensure?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#162 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#166 def correct_modifier_form_after_multiline_begin_block(corrector, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#173 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#177 def empty_begin?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#110 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#114 def register_offense(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#139 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#143 def remove_begin(corrector, offense_range, node); end - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#127 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#131 def replace_begin_with_statement(corrector, offense_range, node); end # Restore comments that occur between "begin" and "first_child". # These comments will be moved to above the assignment line. # - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#149 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#153 def restore_removed_comments(corrector, offense_range, node, first_child); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#156 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#160 def use_modifier_form_after_multiline_begin_block?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#194 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#198 def valid_begin_assignment?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#187 + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#191 def valid_context_using_only_begin?(node); end + + class << self + # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#71 + def autocorrect_incompatible_with; end + end end # source://rubocop/lib/rubocop/cop/style/redundant_begin.rb#69 @@ -44829,7 +45645,7 @@ RuboCop::Cop::Style::RedundantCapitalW::MSG = T.let(T.unsafe(nil), String) # # # good # a = b || c -# @example +# # # bad # if b # b @@ -44847,7 +45663,7 @@ RuboCop::Cop::Style::RedundantCapitalW::MSG = T.let(T.unsafe(nil), String) # c # end # -# source://rubocop/lib/rubocop/cop/style/redundant_condition.rb#33 +# source://rubocop/lib/rubocop/cop/style/redundant_condition.rb#32 class RuboCop::Cop::Style::RedundantCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector @@ -44965,13 +45781,13 @@ class RuboCop::Cop::Style::RedundantCondition < ::RuboCop::Cop::Base def without_argument_parentheses_method?(node); end end -# source://rubocop/lib/rubocop/cop/style/redundant_condition.rb#39 +# source://rubocop/lib/rubocop/cop/style/redundant_condition.rb#38 RuboCop::Cop::Style::RedundantCondition::ARGUMENT_WITH_OPERATOR_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/redundant_condition.rb#37 +# source://rubocop/lib/rubocop/cop/style/redundant_condition.rb#36 RuboCop::Cop::Style::RedundantCondition::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/redundant_condition.rb#38 +# source://rubocop/lib/rubocop/cop/style/redundant_condition.rb#37 RuboCop::Cop::Style::RedundantCondition::REDUNDANT_CONDITION = T.let(T.unsafe(nil), String) # Checks for redundant returning of true/false in conditionals. @@ -45411,7 +46227,7 @@ RuboCop::Cop::Style::RedundantFetchBlock::MSG = T.let(T.unsafe(nil), String) # Checks for the presence of superfluous `.rb` extension in # the filename provided to `require` and `require_relative`. # -# Note: If the extension is omitted, Ruby tries adding '.rb', '.so', +# NOTE: If the extension is omitted, Ruby tries adding '.rb', '.so', # and so on to the name until found. If the file named cannot be found, # a `LoadError` will be raised. # There is an edge case where `foo.so` file is loaded instead of a `LoadError` @@ -45821,6 +46637,37 @@ end # source://rubocop/lib/rubocop/cop/style/redundant_interpolation.rb#43 RuboCop::Cop::Style::RedundantInterpolation::MSG = T.let(T.unsafe(nil), String) +# Before Ruby 3.0, interpolated strings followed the frozen string literal +# magic comment which sometimes made it necessary to explicitly unfreeze them. +# Ruby 3.0 changed interpolated strings to always be unfrozen which makes +# unfreezing them redundant. +# +# @example +# # bad +# +"#{foo} bar" +# +# # bad +# "#{foo} bar".dup +# +# # good +# "#{foo} bar" +# +# source://rubocop/lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#21 +class RuboCop::Cop::Style::RedundantInterpolationUnfreeze < ::RuboCop::Cop::Base + include ::RuboCop::Cop::FrozenStringLiteral + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + # source://rubocop/lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#32 + def on_send(node); end +end + +# source://rubocop/lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#26 +RuboCop::Cop::Style::RedundantInterpolationUnfreeze::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb#28 +RuboCop::Cop::Style::RedundantInterpolationUnfreeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Check for redundant line continuation. # # This cop marks a line continuation as redundant if removing the backslash @@ -45888,47 +46735,50 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base include ::RuboCop::Cop::MatchRange extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#78 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#81 def on_new_investigation; end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#182 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#201 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#165 def argument_newline?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#101 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#106 def ends_with_backslash_without_comment?(source_line); end - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#162 - def find_node_for_line(line); end + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#181 + def find_node_for_line(last_line); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#131 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#150 def inside_string_literal?(range, token); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#109 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#114 def inside_string_literal_or_method_with_argument?(range); end + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#139 + def inspect_eof_line_continuation; end + # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#117 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#122 def leading_dot_method_chain_with_blank_line?(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#189 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#208 def method_call_with_arguments?(node); end # A method call without parentheses such as the following cannot remove `\`: @@ -45938,41 +46788,50 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#139 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#158 def method_with_argument?(current_token, next_token); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#123 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#128 def redundant_line_continuation?(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#93 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#98 def require_line_continuation?(range); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#168 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#187 def same_line?(node, line); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#193 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#212 def start_with_arithmetic_operator?(source_line); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#105 + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#110 def string_concatenation?(source_line); end end -# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#72 +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#74 RuboCop::Cop::Style::RedundantLineContinuation::ALLOWED_STRING_TOKENS = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#73 +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#79 +RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TAKING_FLOW_TOKEN_TYPES = T.let(T.unsafe(nil), Array) + +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#75 RuboCop::Cop::Style::RedundantLineContinuation::ARGUMENT_TYPES = T.let(T.unsafe(nil), Array) +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#72 +RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#73 +RuboCop::Cop::Style::RedundantLineContinuation::LINE_CONTINUATION_PATTERN = T.let(T.unsafe(nil), Regexp) + # source://rubocop/lib/rubocop/cop/style/redundant_line_continuation.rb#71 RuboCop::Cop::Style::RedundantLineContinuation::MSG = T.let(T.unsafe(nil), String) @@ -45994,25 +46853,22 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#32 def allowed_pin_operator?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#35 - def arg_in_call_with_block?(param0 = T.unsafe(nil)); end - - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#269 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#261 def first_send_argument?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#274 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#266 def first_super_argument?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#279 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#271 def first_yield_argument?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#175 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#166 def interpolation?(param0 = T.unsafe(nil)); end # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#26 def method_node_and_args(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#37 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#34 def on_begin(node); end # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#29 @@ -46025,130 +46881,130 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#177 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#168 def allow_in_multiline_conditions?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#68 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#64 def allowed_ancestor?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#60 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#57 def allowed_expression?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#73 - def allowed_method_call?(node); end - - # @return [Boolean] - # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#78 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#69 def allowed_multiple_expression?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#87 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#78 def allowed_ternary?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#283 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#275 def call_chain_starts_with_int?(begin_node, send_node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#136 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#127 def check(begin_node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#184 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#175 def check_send(begin_node, node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#193 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#185 def check_unary(begin_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#217 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#209 def disallowed_literal?(begin_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#114 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#281 + def do_end_block_in_method_chain?(begin_node, node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#105 def empty_parentheses?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#147 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#138 def find_offense_message(begin_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#119 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#110 def first_arg_begins_with_hash_literal?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#258 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#250 def first_argument?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#53 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#50 def ignore_syntax?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#213 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#205 def keyword_ancestor?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#232 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#224 def keyword_with_redundant_parentheses?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#100 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#91 def like_method_argument_parentheses?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#245 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#237 def method_call_with_redundant_parentheses?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#128 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#119 def method_chain_begins_with_hash_literal(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#107 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#98 def multiline_control_flow_statements?(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#203 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#195 def offense(node, msg); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#254 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#246 def only_begin_arg?(args); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#45 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#42 def parens_allowed?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#221 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#213 def raised_to_power_negative_numeric?(begin_node, node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#209 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#201 def suspect_unary?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#93 + # source://rubocop/lib/rubocop/cop/style/redundant_parentheses.rb#84 def ternary_parentheses_required?; end end @@ -46277,38 +47133,39 @@ RuboCop::Cop::Style::RedundantPercentQ::STRING_INTERPOLATION_REGEXP = T.let(T.un # # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#35 class RuboCop::Cop::Style::RedundantRegexpArgument < ::RuboCop::Cop::Base + include ::RuboCop::Cop::StringLiteralsHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#47 + # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#48 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#47 + # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#48 def on_send(node); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#64 + # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#65 def determinist_regexp?(regexp_node); end - # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#68 + # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#69 def preferred_argument(regexp_node); end - # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#81 + # source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#84 def replacement(regexp_node); end end -# source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#42 +# source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#43 RuboCop::Cop::Style::RedundantRegexpArgument::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp) -# source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#38 +# source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#39 RuboCop::Cop::Style::RedundantRegexpArgument::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#39 +# source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#40 RuboCop::Cop::Style::RedundantRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#43 +# source://rubocop/lib/rubocop/cop/style/redundant_regexp_argument.rb#44 RuboCop::Cop::Style::RedundantRegexpArgument::STR_SPECIAL_CHARS = T.let(T.unsafe(nil), Array) # Checks for unnecessary single-element Regexp character classes. @@ -46477,13 +47334,10 @@ class RuboCop::Cop::Style::RedundantRegexpEscape < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/redundant_regexp_escape.rb#92 def delimiter?(node, char); end - # Please remove this `else` branch when support for regexp_parser 1.8 will be dropped. - # It's for compatibility with regexp_parser 1.8 and will never be maintained. - # - # source://rubocop/lib/rubocop/cop/style/redundant_regexp_escape.rb#99 + # source://rubocop/lib/rubocop/cop/style/redundant_regexp_escape.rb#98 def each_escape(node); end - # source://rubocop/lib/rubocop/cop/style/redundant_regexp_escape.rb#126 + # source://rubocop/lib/rubocop/cop/style/redundant_regexp_escape.rb#110 def escape_range_at_index(node, index); end end @@ -47516,6 +48370,9 @@ class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/rescue_modifier.rb#70 def correct_rescue_block(corrector, node, parenthesized); end + # source://rubocop/lib/rubocop/cop/style/rescue_modifier.rb#96 + def heredoc_end(node); end + # source://rubocop/lib/rubocop/cop/style/rescue_modifier.rb#86 def indentation_and_offset(node, parenthesized); end @@ -47702,7 +48559,8 @@ RuboCop::Cop::Style::ReturnNil::RETURN_MSG = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/style/return_nil.rb#40 RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String) -# Checks if `return` or `return nil` is used in predicate method definitions. +# Checks for predicate method definitions that return `nil`. +# A predicate method should only return a boolean value. # # @example # # bad @@ -47725,6 +48583,24 @@ RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String) # # do_something? # end +# +# # bad +# def foo? +# if condition +# nil +# else +# true +# end +# end +# +# # good +# def foo? +# if condition +# false +# else +# true +# end +# end # @example AllowedMethods: ['foo?'] # # good # def foo? @@ -47740,31 +48616,48 @@ RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String) # do_something? # end # -# source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#50 +# source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#69 class RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::AllowedPattern extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#62 + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#81 def on_def(node); end - # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#62 + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#81 def on_defs(node); end - # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#58 + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#77 def return_nil?(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#79 - def nil_node_at_the_end_of_method_body(body); end + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#128 + def handle_if(if_node); end + + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#113 + def handle_implicit_return_values(node); end + + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#122 + def handle_nil(nil_node); end + + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#118 + def handle_return(return_node); end - # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#87 + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#94 + def last_node_of_type(node, type); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#103 + def node_type?(node, type); end + + # source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#107 def register_offense(offense_node, replacement); end end -# source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#55 +# source://rubocop/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb#74 RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe(nil), String) # Transforms usages of a method call safeguarded by a non `nil` @@ -47781,9 +48674,14 @@ RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe( # `foo&.bar` can start returning `nil` as well as what the method # returns. # -# The default for `MaxChainLength` is `2` +# The default for `MaxChainLength` is `2`. # We have limited the cop to not register an offense for method chains -# that exceed this option is set. +# that exceed this option's value. +# +# NOTE: This cop will recognize offenses but not autocorrect code when the +# right hand side (RHS) of the `&&` statement is an `||` statement +# (eg. `foo && (foo.bar? || foo.baz?)`). It can be corrected +# manually by removing the `foo &&` and adding `&.` to each `foo` on the RHS. # # @example # # bad @@ -47835,7 +48733,7 @@ RuboCop::Cop::Style::ReturnNilInPredicateMethodDefinition::MSG = T.let(T.unsafe( # foo.baz + bar if foo # foo.bar > 2 if foo # -# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#84 +# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#89 class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::NilMethods @@ -47843,114 +48741,165 @@ class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#136 + def and_inside_begin?(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#130 + def and_with_rhs_or?(param0 = T.unsafe(nil)); end + # if format: (if checked_variable body nil) # unless format: (if checked_variable nil body) # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#99 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#104 def modifier_if_safe_navigation_candidate(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#125 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#133 def not_nil_check?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#133 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#157 def on_and(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#127 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#141 def on_if(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#114 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#181 + def report_offense(node, rhs, rhs_receiver, *removal_ranges, offense_range: T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#139 + def strip_begin(param0 = T.unsafe(nil)); end + + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#119 def ternary_safe_navigation_candidate(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#307 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#360 def add_safe_nav_to_all_methods_in_chain(corrector, start_method, method_chain); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#200 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#277 def allowed_if_condition?(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#154 - def autocorrect(corrector, node); end + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#222 + def and_parts(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#299 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#352 def begin_range(node, method_call); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#261 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#314 def chain_length(method_chain, method); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#139 - def check_node(node); end + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#204 + def collect_and_clauses(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#181 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#258 def comments(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#303 - def end_range(node, method_call); end + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#216 + def concat_nodes(nodes, and_node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#166 - def extract_body(node); end + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#356 + def end_range(node, method_call); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#243 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#296 def extract_common_parts(method_chain, checked_variable); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#209 - def extract_parts(node); end - - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#233 - def extract_parts_from_and(node); end + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#243 + def extract_if_body(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#218 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#281 def extract_parts_from_if(node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#251 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#304 def find_matching_receiver_invocation(method_chain, checked_variable); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#174 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#198 + def find_method_chain(node); end + + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#251 def handle_comments(corrector, node, method_call); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#320 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#374 def max_chain_length; end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#204 - def method_call(node); end - # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#295 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#348 def method_called?(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#287 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#340 def negated?(send_node); end - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#187 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#229 + def offending_node?(node, lhs_receiver, rhs, rhs_receiver); end + + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#264 def relevant_comment_ranges(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#281 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#334 def unsafe_method?(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#269 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#322 def unsafe_method_used?(method_chain, method); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#150 + # source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#239 def use_var_only_in_unless_modifier?(node, variable); end end -# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#92 +# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#97 RuboCop::Cop::Style::SafeNavigation::LOGIC_JUMP_KEYWORDS = T.let(T.unsafe(nil), Array) -# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#90 +# source://rubocop/lib/rubocop/cop/style/safe_navigation.rb#95 RuboCop::Cop::Style::SafeNavigation::MSG = T.let(T.unsafe(nil), String) +# Enforces safe navigation chains length to not exceed the configured maximum. +# The longer the chain is, the harder it becomes to track what on it could be +# returning `nil`. +# +# There is a potential interplay with `Style/SafeNavigation` - if both are enabled +# and their settings are "incompatible", one of the cops will complain about what +# the other proposes. +# +# E.g. if `Style/SafeNavigation` is configured with `MaxChainLength: 2` (default) +# and this cop is configured with `Max: 1`, then for `foo.bar.baz if foo` the former +# will suggest `foo&.bar&.baz`, which is an offense for the latter. +# +# @example Max: 2 (default) +# # bad +# user&.address&.zip&.upcase +# +# # good +# user&.address&.zip +# user.address.zip if user +# +# source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#26 +class RuboCop::Cop::Style::SafeNavigationChainLength < ::RuboCop::Cop::Base + # source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#29 + def on_csend(node); end + + private + + # source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#46 + def max; end + + # source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#38 + def safe_navigation_chains(node); end +end + +# source://rubocop/lib/rubocop/cop/style/safe_navigation_chain_length.rb#27 +RuboCop::Cop::Style::SafeNavigationChainLength::MSG = T.let(T.unsafe(nil), String) + # Identifies usages of `shuffle.first`, # `shuffle.last`, and `shuffle[]` and change them to use # `sample` instead. @@ -48045,7 +48994,7 @@ RuboCop::Cop::Style::Sample::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # See https://bugs.ruby-lang.org/issues/17030 # # @example -# # bad (select or find_all) +# # bad (select, filter, or find_all) # array.select { |x| x.match? /regexp/ } # array.select { |x| /regexp/.match?(x) } # array.select { |x| x =~ /regexp/ } @@ -48066,53 +49015,53 @@ class RuboCop::Cop::Style::SelectByRegexp < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#79 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#81 def calls_lvar?(param0 = T.unsafe(nil), param1); end # Returns true if a node appears to return a hash # - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#65 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#67 def creates_hash?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#74 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#76 def env_const?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#88 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#90 def on_csend(node); end - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#88 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#90 def on_send(node); end - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#56 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#58 def regexp_match?(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#133 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#136 def extract_send_node(block_node); end - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#146 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#149 def find_regexp(node, block); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#157 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#160 def match_predicate_without_receiver?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#142 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#145 def opposite?(regexp_method_send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#107 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#110 def receiver_allowed?(node); end - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#121 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#124 def register_offense(node, block_node, regexp, replacement); end - # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#113 + # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#116 def replacement(regexp_method_send_node, node); end end @@ -48122,7 +49071,7 @@ RuboCop::Cop::Style::SelectByRegexp::MSG = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#52 RuboCop::Cop::Style::SelectByRegexp::OPPOSITE_REPLACEMENTS = T.let(T.unsafe(nil), Hash) -# source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#53 +# source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#55 RuboCop::Cop::Style::SelectByRegexp::REGEXP_METHODS = T.let(T.unsafe(nil), Set) # source://rubocop/lib/rubocop/cop/style/select_by_regexp.rb#51 @@ -48311,6 +49260,83 @@ RuboCop::Cop::Style::Send::MSG = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/cop/style/send.rb#18 RuboCop::Cop::Style::Send::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +# Detects the use of the `public_send` method with a literal method name argument. +# Since the `send` method can be used to call private methods, by default, +# only the `public_send` method is detected. +# +# NOTE: Writer methods with names ending in `=` are always permitted because their +# behavior differs as follows: +# +# [source,ruby] +# ---- +# def foo=(foo) +# @foo = foo +# 42 +# end +# +# self.foo = 1 # => 1 +# send(:foo=, 1) # => 42 +# ---- +# +# @example +# # bad +# obj.public_send(:method_name) +# obj.public_send('method_name') +# +# # good +# obj.method_name +# @example AllowSend: true (default) +# # good +# obj.send(:method_name) +# obj.send('method_name') +# obj.__send__(:method_name) +# obj.__send__('method_name') +# @example AllowSend: false +# # bad +# obj.send(:method_name) +# obj.send('method_name') +# obj.__send__(:method_name) +# obj.__send__('method_name') +# +# # good +# obj.method_name +# +# source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#54 +class RuboCop::Cop::Style::SendWithLiteralMethodName < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#68 + def on_send(node); end + + private + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#90 + def allow_send?; end + + # source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#94 + def offense_range(node); end + + # source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#98 + def removal_argument_range(first_argument, second_argument); end +end + +# source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#60 +RuboCop::Cop::Style::SendWithLiteralMethodName::METHOD_NAME_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#57 +RuboCop::Cop::Style::SendWithLiteralMethodName::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#61 +RuboCop::Cop::Style::SendWithLiteralMethodName::RESERVED_WORDS = T.let(T.unsafe(nil), Array) + +# source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#58 +RuboCop::Cop::Style::SendWithLiteralMethodName::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +# source://rubocop/lib/rubocop/cop/style/send_with_literal_method_name.rb#59 +RuboCop::Cop::Style::SendWithLiteralMethodName::STATIC_METHOD_NAME_NODE_TYPES = T.let(T.unsafe(nil), Array) + # Checks for uses of `fail` and `raise`. # # @example EnforcedStyle: only_raise (default) @@ -48833,10 +49859,10 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#242 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#261 def allow_modifier?; end - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#227 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#233 def arguments_range(node); end # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#81 @@ -48854,25 +49880,25 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#145 def correct_for_basic_condition_style(corrector, node, if_branch, and_operator); end - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#175 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#181 def correct_for_comment(corrector, node, if_branch); end # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#136 def correct_for_guard_condition_style(corrector, outer_condition, if_branch, and_operator); end - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#165 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#171 def correct_for_outer_condition_modify_form_style(corrector, node, if_branch); end # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#130 def correct_from_unless_to_if(corrector, node, is_modify_form: T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#184 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#190 def correct_outer_condition(corrector, condition); end - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#197 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#203 def insert_bang(corrector, node, is_modify_form); end - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#210 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#216 def insert_bang_for_and(corrector, node); end # @return [Boolean] @@ -48882,15 +49908,18 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#246 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#265 def outer_condition_modify_form?(node, if_branch); end - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#238 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#254 + def parenthesized_method_arguments(node); end + + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#244 def replace_condition(condition); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#222 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#228 def require_parentheses?(condition); end # @return [Boolean] @@ -48903,7 +49932,7 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#233 + # source://rubocop/lib/rubocop/cop/style/sole_nested_conditional.rb#239 def wrap_condition?(node); end class << self @@ -48920,13 +49949,30 @@ RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String) # will add a require statement to the top of the file if # enabled by RequireEnglish config. # -# Like `use_perl_names` but allows builtin global vars. -# +# @example EnforcedStyle: use_english_names (default) # # good +# require 'English' # or this could be in another file. +# # puts $LOAD_PATH # puts $LOADED_FEATURES # puts $PROGRAM_NAME -# puts ARGV +# puts $ERROR_INFO +# puts $ERROR_POSITION +# puts $FIELD_SEPARATOR # or $FS +# puts $OUTPUT_FIELD_SEPARATOR # or $OFS +# puts $INPUT_RECORD_SEPARATOR # or $RS +# puts $OUTPUT_RECORD_SEPARATOR # or $ORS +# puts $INPUT_LINE_NUMBER # or $NR +# puts $LAST_READ_LINE +# puts $DEFAULT_OUTPUT +# puts $DEFAULT_INPUT +# puts $PROCESS_ID # or $PID +# puts $CHILD_STATUS +# puts $LAST_MATCH_INFO +# puts $IGNORECASE +# puts $ARGV # or ARGV +# @example EnforcedStyle: use_perl_names +# # good # puts $: # puts $" # puts $0 @@ -48945,31 +49991,14 @@ RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String) # puts $~ # puts $= # puts $* +# @example EnforcedStyle: use_builtin_english_names # -# @example EnforcedStyle: use_english_names (default) # # good -# require 'English' # or this could be in another file. -# +# # Like `use_perl_names` but allows builtin global vars. # puts $LOAD_PATH # puts $LOADED_FEATURES # puts $PROGRAM_NAME -# puts $ERROR_INFO -# puts $ERROR_POSITION -# puts $FIELD_SEPARATOR # or $FS -# puts $OUTPUT_FIELD_SEPARATOR # or $OFS -# puts $INPUT_RECORD_SEPARATOR # or $RS -# puts $OUTPUT_RECORD_SEPARATOR # or $ORS -# puts $INPUT_LINE_NUMBER # or $NR -# puts $LAST_READ_LINE -# puts $DEFAULT_OUTPUT -# puts $DEFAULT_INPUT -# puts $PROCESS_ID # or $PID -# puts $CHILD_STATUS -# puts $LAST_MATCH_INFO -# puts $IGNORECASE -# puts $ARGV # or ARGV -# @example EnforcedStyle: use_perl_names -# # good +# puts ARGV # puts $: # puts $" # puts $0 @@ -48988,90 +50017,89 @@ RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String) # puts $~ # puts $= # puts $* -# @example EnforcedStyle: use_builtin_english_names # -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#87 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#86 class RuboCop::Cop::Style::SpecialGlobalVars < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::RequireLibrary extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#176 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#175 def autocorrect(corrector, node, global_var); end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#168 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#167 def message(global_var); end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#152 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#151 def on_gvar(node); end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#147 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#146 def on_new_investigation; end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#247 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#246 def add_require_english?; end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#241 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#240 def english_name_replacement(preferred_name, node); end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#190 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#189 def format_english_message(global_var); end # For now, we assume that lists are 2 items or less. Easy grammar! # - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#212 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#211 def format_list(items); end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#198 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#197 def format_message(english, regular, global); end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#235 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#234 def matching_styles(global); end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#227 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#226 def preferred_names(global); end - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#216 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#215 def replacement(node, global_var); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#251 + # source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#250 def should_require_english?(global_var); end end -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#128 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#127 RuboCop::Cop::Style::SpecialGlobalVars::BUILTIN_VARS = T.let(T.unsafe(nil), Hash) -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#100 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#99 RuboCop::Cop::Style::SpecialGlobalVars::ENGLISH_VARS = T.let(T.unsafe(nil), Hash) -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#145 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#144 RuboCop::Cop::Style::SpecialGlobalVars::LIBRARY_NAME = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#93 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#92 RuboCop::Cop::Style::SpecialGlobalVars::MSG_BOTH = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#96 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#95 RuboCop::Cop::Style::SpecialGlobalVars::MSG_ENGLISH = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#98 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#97 RuboCop::Cop::Style::SpecialGlobalVars::MSG_REGULAR = T.let(T.unsafe(nil), String) # Anything *not* in this set is provided by the English library. # -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#122 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#121 RuboCop::Cop::Style::SpecialGlobalVars::NON_ENGLISH_VARS = T.let(T.unsafe(nil), Set) -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#124 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#123 RuboCop::Cop::Style::SpecialGlobalVars::PERL_VARS = T.let(T.unsafe(nil), Hash) -# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#139 +# source://rubocop/lib/rubocop/cop/style/special_global_vars.rb#138 RuboCop::Cop::Style::SpecialGlobalVars::STYLE_VARS_MAP = T.let(T.unsafe(nil), Hash) # Check for parentheses around stabby lambda arguments. @@ -49673,6 +50701,118 @@ end # source://rubocop/lib/rubocop/cop/style/struct_inheritance.rb#30 RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String) +# Checks for redundant argument forwarding when calling super with arguments identical to +# the method definition. +# +# Using zero arity `super` within a `define_method` block results in `RuntimeError`: +# +# [source,ruby] +# ---- +# def m +# define_method(:foo) { super() } # => OK +# end +# +# def m +# define_method(:foo) { super } # => RuntimeError +# end +# ---- +# +# Furthermore, any arguments accompanied by a block may potentially be delegating to +# `define_method`, therefore, `super` used within these blocks will be allowed. +# This approach might result in false negatives, yet ensuring safe detection takes precedence. +# +# @example +# # bad +# def method(*args, **kwargs) +# super(*args, **kwargs) +# end +# +# # good - implicitly passing all arguments +# def method(*args, **kwargs) +# super +# end +# +# # good - forwarding a subset of the arguments +# def method(*args, **kwargs) +# super(*args) +# end +# +# # good - forwarding no arguments +# def method(*args, **kwargs) +# super() +# end +# +# # good - assigning to the block variable before calling super +# def method(&block) +# # Assigning to the block variable would pass the old value to super, +# # under this circumstance the block must be referenced explicitly. +# block ||= proc { 'fallback behavior' } +# super(&block) +# end +# +# source://rubocop/lib/rubocop/cop/style/super_arguments.rb#54 +class RuboCop::Cop::Style::SuperArguments < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#62 + def on_super(super_node); end + + private + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#81 + def arguments_identical?(def_node, def_args, super_args); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#136 + def block_arg_same?(def_node, def_arg, super_arg); end + + # Reassigning the block argument will still pass along the original block to super + # https://bugs.ruby-lang.org/issues/20505 + # + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#147 + def block_reassigned?(def_node, block_arg_name); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#158 + def forward_arg_same?(def_arg, super_arg); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#116 + def keyword_arg_same?(def_arg, super_arg); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#126 + def keyword_rest_arg_same?(def_arg, super_arg); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#99 + def positional_arg_same?(def_arg, super_arg); end + + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#106 + def positional_rest_arg_same(def_arg, super_arg); end + + # source://rubocop/lib/rubocop/cop/style/super_arguments.rb#162 + def preprocess_super_args(super_args); end +end + +# source://rubocop/lib/rubocop/cop/style/super_arguments.rb#58 +RuboCop::Cop::Style::SuperArguments::ASSIGN_TYPES = T.let(T.unsafe(nil), Array) + +# source://rubocop/lib/rubocop/cop/style/super_arguments.rb#57 +RuboCop::Cop::Style::SuperArguments::DEF_TYPES = T.let(T.unsafe(nil), Array) + +# source://rubocop/lib/rubocop/cop/style/super_arguments.rb#60 +RuboCop::Cop::Style::SuperArguments::MSG = T.let(T.unsafe(nil), String) + # Enforces the presence of parentheses in `super` containing arguments. # # `super` is a keyword and is provided as a distinct cop from those designed for method call. @@ -49896,9 +51036,11 @@ RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String) # `define_method?` methods are allowed by default. # These are customizable with `AllowedMethods` option. # -# @example AllowedPatterns: ['map'] (default) +# @example AllCops:ActiveSupportExtensionsEnabled: true # # good -# something.map { |s| s.upcase } +# ->(x) { x.foo } +# proc { |x| x.foo } +# Proc.new { |x| x.foo } # @example AllowMethodsWithArguments: false (default) # # bad # something.do_something(foo) { |o| o.bar } @@ -49928,6 +51070,19 @@ RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String) # @example AllowedPatterns: [] (default) # # bad # something.map { |s| s.upcase } +# @example AllowedPatterns: ['map'] (default) +# # good +# something.map { |s| s.upcase } +# @example AllCops:ActiveSupportExtensionsEnabled: false (default) +# # bad +# ->(x) { x.foo } +# proc { |x| x.foo } +# Proc.new { |x| x.foo } +# +# # good +# lambda(&:foo) +# proc(&:foo) +# Proc.new(&:foo) # @example # # bad # something.map { |s| s.upcase } @@ -49936,7 +51091,7 @@ RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String) # # good # something.map(&:upcase) # -# source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#123 +# source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#140 class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base include ::RuboCop::Cop::CommentsHelp include ::RuboCop::Cop::RangeHelp @@ -49946,81 +51101,87 @@ class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#172 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#189 def destructuring_block_argument?(argument_node); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#152 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#170 def on_block(node); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#152 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#170 def on_numblock(node); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#134 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#152 def proc_node?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#140 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#158 def symbol_proc?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#137 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#155 def symbol_proc_receiver?(param0 = T.unsafe(nil)); end private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#240 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#274 def allow_comments?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#236 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#270 def allow_if_method_has_argument?(send_node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#187 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#204 def allowed_method_name?(name); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#200 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#217 def autocorrect(corrector, node); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#212 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#247 + def autocorrect_lambda_block(corrector, node); end + + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#238 def autocorrect_with_args(corrector, node, args, method_name); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#208 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#225 def autocorrect_without_args(corrector, node); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#226 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#260 def begin_pos_for_replacement(node); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#221 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#255 def block_range_with_space(node); end - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#191 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#208 def register_offense(node, method_name, block_method_name); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#183 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#200 def unsafe_array_usage?(node); end # See: https://github.com/rubocop/rubocop/issues/10864 # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#179 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#196 def unsafe_hash_usage?(node); end class << self - # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#147 + # source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#165 def autocorrect_incompatible_with; end end end -# source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#130 +# source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#149 +RuboCop::Cop::Style::SymbolProc::LAMBDA_OR_PROC = T.let(T.unsafe(nil), Array) + +# source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#147 RuboCop::Cop::Style::SymbolProc::MSG = T.let(T.unsafe(nil), String) -# source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#131 +# source://rubocop/lib/rubocop/cop/style/symbol_proc.rb#148 RuboCop::Cop::Style::SymbolProc::SUPER_TYPES = T.let(T.unsafe(nil), Array) # Corrector to correct conditional assignment in ternary conditions. @@ -50116,7 +51277,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#193 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#191 def method_name(param0 = T.unsafe(nil)); end # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#69 @@ -50129,7 +51290,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#183 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#181 def below_ternary_precedence?(child); end # If the condition is parenthesized we recurse and check for any @@ -50145,15 +51306,25 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#89 def condition_as_parenthesized_one_line_pattern_matching?(condition); end - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#198 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#196 def correct_parenthesized(corrector, condition); end - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#208 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#210 def correct_unparenthesized(corrector, condition); end # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#151 def message(node); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#227 + def node_args_need_parens?(send_node); end + + # @return [Boolean] + # + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#234 + def node_with_args?(node); end + # Anything that is not a variable, constant, or method/.method call # will be counted as a complex expression. # @@ -50177,6 +51348,9 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#85 def only_closing_parenthesis_is_last_line?(condition); end + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#214 + def parenthesize_condition_arguments(corrector, send_node); end + # @return [Boolean] # # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#169 @@ -50194,7 +51368,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#179 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#177 def unparenthesized_method_call?(child); end # @return [Boolean] @@ -50204,7 +51378,7 @@ class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#212 + # source://rubocop/lib/rubocop/cop/style/ternary_parentheses.rb#222 def whitespace_after?(node); end end @@ -51298,7 +52472,6 @@ RuboCop::Cop::Style::WhenThen::MSG = T.let(T.unsafe(nil), String) # while x.any? # do_something(x.pop) # end -# @example # # # bad # until x.empty? do @@ -51310,18 +52483,18 @@ RuboCop::Cop::Style::WhenThen::MSG = T.let(T.unsafe(nil), String) # do_something(x.pop) # end # -# source://rubocop/lib/rubocop/cop/style/while_until_do.rb#31 +# source://rubocop/lib/rubocop/cop/style/while_until_do.rb#29 class RuboCop::Cop::Style::WhileUntilDo < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/while_until_do.rb#36 + # source://rubocop/lib/rubocop/cop/style/while_until_do.rb#34 def on_until(node); end - # source://rubocop/lib/rubocop/cop/style/while_until_do.rb#36 + # source://rubocop/lib/rubocop/cop/style/while_until_do.rb#34 def on_while(node); end end -# source://rubocop/lib/rubocop/cop/style/while_until_do.rb#34 +# source://rubocop/lib/rubocop/cop/style/while_until_do.rb#32 RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String) # Checks for while and until statements that would fit on one line @@ -51336,7 +52509,7 @@ RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String) # # # good # x += 1 while x < 10 -# @example +# # # bad # until x > 10 # x += 1 @@ -51353,22 +52526,21 @@ RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String) # x += 100 # end # -# source://rubocop/lib/rubocop/cop/style/while_until_modifier.rb#36 +# source://rubocop/lib/rubocop/cop/style/while_until_modifier.rb#35 class RuboCop::Cop::Style::WhileUntilModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::LineLengthHelp - include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::StatementModifier extend ::RuboCop::Cop::AutoCorrector - # source://rubocop/lib/rubocop/cop/style/while_until_modifier.rb#42 + # source://rubocop/lib/rubocop/cop/style/while_until_modifier.rb#41 def on_until(node); end - # source://rubocop/lib/rubocop/cop/style/while_until_modifier.rb#42 + # source://rubocop/lib/rubocop/cop/style/while_until_modifier.rb#41 def on_while(node); end end -# source://rubocop/lib/rubocop/cop/style/while_until_modifier.rb#40 +# source://rubocop/lib/rubocop/cop/style/while_until_modifier.rb#39 RuboCop::Cop::Style::WhileUntilModifier::MSG = T.let(T.unsafe(nil), String) # Checks for array literals made up of word-like @@ -51788,39 +52960,42 @@ class RuboCop::Cop::Style::ZeroLengthPredicate < ::RuboCop::Cop::Base # implement `#size`, but not `#empty`. We ignore those to # reduce false positives. # - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#139 + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#147 def non_polymorphic_collection?(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#109 + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#114 def nonzero_length_comparison(param0 = T.unsafe(nil)); end + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#51 + def on_csend(node); end + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#45 def on_send(node); end - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#130 - def other_receiver(param0 = T.unsafe(nil)); end + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#138 + def other_length_node(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#101 + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#106 def zero_length_comparison(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#96 - def zero_length_predicate(param0 = T.unsafe(nil)); end + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#130 + def zero_length_node(param0 = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#122 - def zero_length_receiver(param0 = T.unsafe(nil)); end + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#101 + def zero_length_predicate?(param0 = T.unsafe(nil)); end private - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#80 + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#85 def check_nonzero_length_comparison(node); end - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#65 + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#70 def check_zero_length_comparison(node); end - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#53 + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#58 def check_zero_length_predicate(node); end - # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#114 + # source://rubocop/lib/rubocop/cop/style/zero_length_predicate.rb#119 def replacement(node); end end @@ -51940,138 +53115,138 @@ end # first the ones needed for autocorrection (if any), then the rest # (unless autocorrections happened). # -# source://rubocop/lib/rubocop/cop/team.rb#12 +# source://rubocop/lib/rubocop/cop/team.rb#13 class RuboCop::Cop::Team # @return [Team] a new instance of Team # - # source://rubocop/lib/rubocop/cop/team.rb#55 + # source://rubocop/lib/rubocop/cop/team.rb#61 def initialize(cops, config = T.unsafe(nil), options = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/team.rb#66 + # source://rubocop/lib/rubocop/cop/team.rb#72 def autocorrect?; end # Returns the value of attribute cops. # - # source://rubocop/lib/rubocop/cop/team.rb#51 + # source://rubocop/lib/rubocop/cop/team.rb#57 def cops; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/team.rb#70 + # source://rubocop/lib/rubocop/cop/team.rb#76 def debug?; end # Returns the value of attribute errors. # - # source://rubocop/lib/rubocop/cop/team.rb#51 + # source://rubocop/lib/rubocop/cop/team.rb#57 def errors; end - # source://rubocop/lib/rubocop/cop/team.rb#114 + # source://rubocop/lib/rubocop/cop/team.rb#128 def external_dependency_checksum; end # @deprecated # - # source://rubocop/lib/rubocop/cop/team.rb#110 + # source://rubocop/lib/rubocop/cop/team.rb#120 def forces; end - # source://rubocop/lib/rubocop/cop/team.rb#76 + # source://rubocop/lib/rubocop/cop/team.rb#82 def inspect_file(processed_source); end # @return [Commissioner::InvestigationReport] # - # source://rubocop/lib/rubocop/cop/team.rb#81 + # source://rubocop/lib/rubocop/cop/team.rb#91 def investigate(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end # Returns the value of attribute updated_source_file. # - # source://rubocop/lib/rubocop/cop/team.rb#51 + # source://rubocop/lib/rubocop/cop/team.rb#57 def updated_source_file; end # Returns the value of attribute updated_source_file. # - # source://rubocop/lib/rubocop/cop/team.rb#51 + # source://rubocop/lib/rubocop/cop/team.rb#57 def updated_source_file?; end # Returns the value of attribute warnings. # - # source://rubocop/lib/rubocop/cop/team.rb#51 + # source://rubocop/lib/rubocop/cop/team.rb#57 def warnings; end private - # source://rubocop/lib/rubocop/cop/team.rb#121 + # source://rubocop/lib/rubocop/cop/team.rb#139 def autocorrect(processed_source, report, original:, offset:); end - # source://rubocop/lib/rubocop/cop/team.rb#185 + # source://rubocop/lib/rubocop/cop/team.rb#203 def autocorrect_report(report, offset:, original:); end - # source://rubocop/lib/rubocop/cop/team.rb#140 + # source://rubocop/lib/rubocop/cop/team.rb#158 def be_ready; end - # source://rubocop/lib/rubocop/cop/team.rb#191 + # source://rubocop/lib/rubocop/cop/team.rb#209 def collate_corrections(report, offset:, original:); end - # source://rubocop/lib/rubocop/cop/team.rb#207 + # source://rubocop/lib/rubocop/cop/team.rb#225 def each_corrector(report); end - # source://rubocop/lib/rubocop/cop/team.rb#257 + # source://rubocop/lib/rubocop/cop/team.rb#277 def handle_error(error, location, cop); end - # source://rubocop/lib/rubocop/cop/team.rb#249 + # source://rubocop/lib/rubocop/cop/team.rb#269 def handle_warning(error, location); end # @return [Commissioner::InvestigationReport] # - # source://rubocop/lib/rubocop/cop/team.rb#154 + # source://rubocop/lib/rubocop/cop/team.rb#172 def investigate_partial(cops, processed_source, offset:, original:); end - # source://rubocop/lib/rubocop/cop/team.rb#234 + # source://rubocop/lib/rubocop/cop/team.rb#252 def process_errors(file, errors); end - # source://rubocop/lib/rubocop/cop/team.rb#148 + # source://rubocop/lib/rubocop/cop/team.rb#166 def reset; end # @return [Array<cop>] # - # source://rubocop/lib/rubocop/cop/team.rb#160 + # source://rubocop/lib/rubocop/cop/team.rb#178 def roundup_relevant_cops(processed_source); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/team.rb#176 + # source://rubocop/lib/rubocop/cop/team.rb#194 def support_target_rails_version?(cop); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/team.rb#170 + # source://rubocop/lib/rubocop/cop/team.rb#188 def support_target_ruby_version?(cop); end - # source://rubocop/lib/rubocop/cop/team.rb#222 + # source://rubocop/lib/rubocop/cop/team.rb#240 def suppress_clobbering; end - # source://rubocop/lib/rubocop/cop/team.rb#228 + # source://rubocop/lib/rubocop/cop/team.rb#246 def validate_config; end class << self # @return [Array<Force>] needed for the given cops # - # source://rubocop/lib/rubocop/cop/team.rb#37 + # source://rubocop/lib/rubocop/cop/team.rb#43 def forces_for(cops); end # @return [Team] with cops assembled from the given `cop_classes` # - # source://rubocop/lib/rubocop/cop/team.rb#22 + # source://rubocop/lib/rubocop/cop/team.rb#28 def mobilize(cop_classes, config, options = T.unsafe(nil)); end # @return [Array<Cop::Base>] # - # source://rubocop/lib/rubocop/cop/team.rb#28 + # source://rubocop/lib/rubocop/cop/team.rb#34 def mobilize_cops(cop_classes, config, options = T.unsafe(nil)); end # @return [Team] # - # source://rubocop/lib/rubocop/cop/team.rb#14 + # source://rubocop/lib/rubocop/cop/team.rb#15 def new(cop_or_classes, config, options = T.unsafe(nil)); end end end @@ -52301,19 +53476,19 @@ module RuboCop::Cop::Util private - # source://rubocop/lib/rubocop/cop/util.rb#35 + # source://rubocop/lib/rubocop/cop/util.rb#39 def add_parentheses(node, corrector); end - # source://rubocop/lib/rubocop/cop/util.rb#56 + # source://rubocop/lib/rubocop/cop/util.rb#60 def any_descendant?(node, *types); end - # source://rubocop/lib/rubocop/cop/util.rb#71 + # source://rubocop/lib/rubocop/cop/util.rb#75 def args_begin(node); end - # source://rubocop/lib/rubocop/cop/util.rb#83 + # source://rubocop/lib/rubocop/cop/util.rb#87 def args_end(node); end - # source://rubocop/lib/rubocop/cop/util.rb#104 + # source://rubocop/lib/rubocop/cop/util.rb#108 def begins_its_line?(range); end # This is a bad API @@ -52326,78 +53501,78 @@ module RuboCop::Cop::Util # source://rubocop/lib/rubocop/cop/util.rb#22 def comment_lines?(node); end - # source://rubocop/lib/rubocop/cop/util.rb#192 + # source://rubocop/lib/rubocop/cop/util.rb#198 def compatible_external_encoding_for?(src); end # If converting a string to Ruby string literal source code, must # double quotes be used? # - # source://rubocop/lib/rubocop/cop/util.rb#130 + # source://rubocop/lib/rubocop/cop/util.rb#134 def double_quotes_required?(string); end - # source://rubocop/lib/rubocop/cop/util.rb#144 + # source://rubocop/lib/rubocop/cop/util.rb#148 def escape_string(string); end # Returns, for example, a bare `if` node if the given node is an `if` # with calls chained to the end of it. # - # source://rubocop/lib/rubocop/cop/util.rb#114 + # source://rubocop/lib/rubocop/cop/util.rb#118 def first_part_of_call_chain(node); end - # source://rubocop/lib/rubocop/cop/util.rb#197 + # source://rubocop/lib/rubocop/cop/util.rb#203 def include_or_equal?(source, target); end - # source://rubocop/lib/rubocop/cop/util.rb#179 + # source://rubocop/lib/rubocop/cop/util.rb#185 def indent(node, offset: T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/util.rb#161 + # source://rubocop/lib/rubocop/cop/util.rb#165 def interpret_string_escapes(string); end - # source://rubocop/lib/rubocop/cop/util.rb#165 + # source://rubocop/lib/rubocop/cop/util.rb#169 def line(node_or_range); end - # source://rubocop/lib/rubocop/cop/util.rb#26 + # source://rubocop/lib/rubocop/cop/util.rb#30 def line_range(node); end - # source://rubocop/lib/rubocop/cop/util.rb#140 + # source://rubocop/lib/rubocop/cop/util.rb#144 def needs_escaping?(string); end - # source://rubocop/lib/rubocop/cop/util.rb#87 + # source://rubocop/lib/rubocop/cop/util.rb#91 def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end - # source://rubocop/lib/rubocop/cop/util.rb#30 + # source://rubocop/lib/rubocop/cop/util.rb#34 def parentheses?(node); end - # source://rubocop/lib/rubocop/cop/util.rb#173 + # source://rubocop/lib/rubocop/cop/util.rb#177 def same_line?(node1, node2); end - # source://rubocop/lib/rubocop/cop/util.rb#148 + # source://rubocop/lib/rubocop/cop/util.rb#152 def to_string_literal(string); end - # source://rubocop/lib/rubocop/cop/util.rb#185 + # source://rubocop/lib/rubocop/cop/util.rb#191 def to_supported_styles(enforced_style); end - # source://rubocop/lib/rubocop/cop/util.rb#157 + # source://rubocop/lib/rubocop/cop/util.rb#161 def trim_string_interpolation_escape_character(str); end class << self - # source://rubocop/lib/rubocop/cop/util.rb#35 + # source://rubocop/lib/rubocop/cop/util.rb#39 def add_parentheses(node, corrector); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/util.rb#56 + # source://rubocop/lib/rubocop/cop/util.rb#60 def any_descendant?(node, *types); end - # source://rubocop/lib/rubocop/cop/util.rb#71 + # source://rubocop/lib/rubocop/cop/util.rb#75 def args_begin(node); end - # source://rubocop/lib/rubocop/cop/util.rb#83 + # source://rubocop/lib/rubocop/cop/util.rb#87 def args_end(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/util.rb#104 + # source://rubocop/lib/rubocop/cop/util.rb#108 def begins_its_line?(range); end # This is a bad API @@ -52418,62 +53593,62 @@ module RuboCop::Cop::Util # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/util.rb#130 + # source://rubocop/lib/rubocop/cop/util.rb#134 def double_quotes_required?(string); end - # source://rubocop/lib/rubocop/cop/util.rb#144 + # source://rubocop/lib/rubocop/cop/util.rb#148 def escape_string(string); end # Returns, for example, a bare `if` node if the given node is an `if` # with calls chained to the end of it. # - # source://rubocop/lib/rubocop/cop/util.rb#114 + # source://rubocop/lib/rubocop/cop/util.rb#118 def first_part_of_call_chain(node); end - # source://rubocop/lib/rubocop/cop/util.rb#179 + # source://rubocop/lib/rubocop/cop/util.rb#185 def indent(node, offset: T.unsafe(nil)); end - # source://rubocop/lib/rubocop/cop/util.rb#161 + # source://rubocop/lib/rubocop/cop/util.rb#165 def interpret_string_escapes(string); end - # source://rubocop/lib/rubocop/cop/util.rb#165 + # source://rubocop/lib/rubocop/cop/util.rb#169 def line(node_or_range); end - # source://rubocop/lib/rubocop/cop/util.rb#26 + # source://rubocop/lib/rubocop/cop/util.rb#30 def line_range(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/util.rb#140 + # source://rubocop/lib/rubocop/cop/util.rb#144 def needs_escaping?(string); end # @yield [sexp] # - # source://rubocop/lib/rubocop/cop/util.rb#87 + # source://rubocop/lib/rubocop/cop/util.rb#91 def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/util.rb#30 + # source://rubocop/lib/rubocop/cop/util.rb#34 def parentheses?(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/util.rb#173 + # source://rubocop/lib/rubocop/cop/util.rb#177 def same_line?(node1, node2); end - # source://rubocop/lib/rubocop/cop/util.rb#148 + # source://rubocop/lib/rubocop/cop/util.rb#152 def to_string_literal(string); end - # source://rubocop/lib/rubocop/cop/util.rb#185 + # source://rubocop/lib/rubocop/cop/util.rb#191 def to_supported_styles(enforced_style); end - # source://rubocop/lib/rubocop/cop/util.rb#157 + # source://rubocop/lib/rubocop/cop/util.rb#161 def trim_string_interpolation_escape_character(str); end end end -# source://rubocop/lib/rubocop/cop/util.rb#99 +# source://rubocop/lib/rubocop/cop/util.rb#103 RuboCop::Cop::Util::LINE_BEGINS_REGEX_CACHE = T.let(T.unsafe(nil), Hash) # Match literal regex characters, not including anchors, character @@ -52485,7 +53660,7 @@ RuboCop::Cop::Util::LITERAL_REGEX = T.let(T.unsafe(nil), Regexp) # Arbitrarily chosen value, should be enough to cover # the most nested source code in real world projects. # -# source://rubocop/lib/rubocop/cop/util.rb#98 +# source://rubocop/lib/rubocop/cop/util.rb#102 RuboCop::Cop::Util::MAX_LINE_BEGINS_REGEX_INDEX = T.let(T.unsafe(nil), Integer) # source://rubocop/lib/rubocop/cop/utils/format_string.rb#5 @@ -52718,59 +53893,59 @@ class RuboCop::Cop::VariableForce < ::RuboCop::Cop::Force # # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#76 + # source://rubocop/lib/rubocop/cop/variable_force.rb#79 def investigate(processed_source); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#85 + # source://rubocop/lib/rubocop/cop/variable_force.rb#88 def process_node(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#71 + # source://rubocop/lib/rubocop/cop/variable_force.rb#74 def variable_table; end private - # source://rubocop/lib/rubocop/cop/variable_force.rb#368 + # source://rubocop/lib/rubocop/cop/variable_force.rb#380 def after_declaring_variable(arg); end - # source://rubocop/lib/rubocop/cop/variable_force.rb#368 + # source://rubocop/lib/rubocop/cop/variable_force.rb#380 def after_entering_scope(arg); end - # source://rubocop/lib/rubocop/cop/variable_force.rb#368 + # source://rubocop/lib/rubocop/cop/variable_force.rb#380 def after_leaving_scope(arg); end - # source://rubocop/lib/rubocop/cop/variable_force.rb#368 + # source://rubocop/lib/rubocop/cop/variable_force.rb#380 def before_declaring_variable(arg); end - # source://rubocop/lib/rubocop/cop/variable_force.rb#368 + # source://rubocop/lib/rubocop/cop/variable_force.rb#380 def before_entering_scope(arg); end - # source://rubocop/lib/rubocop/cop/variable_force.rb#368 + # source://rubocop/lib/rubocop/cop/variable_force.rb#380 def before_leaving_scope(arg); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#339 + # source://rubocop/lib/rubocop/cop/variable_force.rb#351 def descendant_reference(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#329 + # source://rubocop/lib/rubocop/cop/variable_force.rb#341 def each_descendant_reference(loop_node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#314 + # source://rubocop/lib/rubocop/cop/variable_force.rb#326 def find_variables_in_loop(loop_node); end # This is called for each scope recursively. # # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#94 + # source://rubocop/lib/rubocop/cop/variable_force.rb#97 def inspect_variables_in_scope(scope_node); end # Mark all assignments which are referenced in the same loop @@ -52779,104 +53954,109 @@ class RuboCop::Cop::VariableForce < ::RuboCop::Cop::Force # # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#295 + # source://rubocop/lib/rubocop/cop/variable_force.rb#307 def mark_assignments_as_referenced_in_loop(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#126 + # source://rubocop/lib/rubocop/cop/variable_force.rb#130 def node_handler_method_name(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#100 + # source://rubocop/lib/rubocop/cop/variable_force.rb#103 def process_children(origin_node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#231 + # source://rubocop/lib/rubocop/cop/variable_force.rb#243 def process_loop(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#160 + # source://rubocop/lib/rubocop/cop/variable_force.rb#182 + def process_pattern_match_variable(node); end + + # @api private + # + # source://rubocop/lib/rubocop/cop/variable_force.rb#164 def process_regexp_named_captures(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#246 + # source://rubocop/lib/rubocop/cop/variable_force.rb#258 def process_rescue(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#265 + # source://rubocop/lib/rubocop/cop/variable_force.rb#277 def process_scope(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#284 + # source://rubocop/lib/rubocop/cop/variable_force.rb#296 def process_send(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#142 + # source://rubocop/lib/rubocop/cop/variable_force.rb#146 def process_variable_assignment(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#130 + # source://rubocop/lib/rubocop/cop/variable_force.rb#134 def process_variable_declaration(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#219 + # source://rubocop/lib/rubocop/cop/variable_force.rb#231 def process_variable_multiple_assignment(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#184 + # source://rubocop/lib/rubocop/cop/variable_force.rb#196 def process_variable_operator_assignment(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#226 + # source://rubocop/lib/rubocop/cop/variable_force.rb#238 def process_variable_referencing(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#257 + # source://rubocop/lib/rubocop/cop/variable_force.rb#269 def process_zero_arity_super(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#178 + # source://rubocop/lib/rubocop/cop/variable_force.rb#190 def regexp_captured_names(node); end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force.rb#351 + # source://rubocop/lib/rubocop/cop/variable_force.rb#363 def scanned_node?(node); end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#355 + # source://rubocop/lib/rubocop/cop/variable_force.rb#367 def scanned_nodes; end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#108 + # source://rubocop/lib/rubocop/cop/variable_force.rb#111 def skip_children!; end # @api private # - # source://rubocop/lib/rubocop/cop/variable_force.rb#278 + # source://rubocop/lib/rubocop/cop/variable_force.rb#290 def twisted_nodes(node); end end # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#32 +# source://rubocop/lib/rubocop/cop/variable_force.rb#35 RuboCop::Cop::VariableForce::ARGUMENT_DECLARATION_TYPES = T.let(T.unsafe(nil), Array) # This class represents each assignment of a variable. @@ -52887,28 +54067,28 @@ class RuboCop::Cop::VariableForce::Assignment # @return [Assignment] a new instance of Assignment # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#16 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#17 def initialize(node, variable); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#50 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#58 def exception_assignment?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#72 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#80 def for_assignment?; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#83 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#91 def meta_assignment_node; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#60 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#68 def multiple_assignment?; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#29 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#31 def name; end # Returns the value of attribute node. @@ -52916,15 +54096,28 @@ class RuboCop::Cop::VariableForce::Assignment # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#12 def node; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#78 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#86 def operator; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#54 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#62 def operator_assignment?; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#37 + # Returns the value of attribute reassigned. + # + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#12 + def reassigned; end + + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#44 + def reassigned!; end + + # Returns the value of attribute reassigned. + # + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#12 + def reassigned?; end + + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#39 def reference!(node); end # Returns the value of attribute referenced. @@ -52944,20 +54137,20 @@ class RuboCop::Cop::VariableForce::Assignment # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#46 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#54 def regexp_named_capture?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#66 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#74 def rest_assignment?; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#33 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#35 def scope; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#42 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#50 def used?; end # Returns the value of attribute variable. @@ -52967,19 +54160,19 @@ class RuboCop::Cop::VariableForce::Assignment private - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#125 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#140 def find_multiple_assignment_node(grandparent_node); end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#121 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#130 def for_assignment_node; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#104 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#112 def multiple_assignment_node; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#96 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#104 def operator_assignment_node; end - # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#114 + # source://rubocop/lib/rubocop/cop/variable_force/assignment.rb#123 def rest_assignment_node; end end @@ -52988,12 +54181,12 @@ RuboCop::Cop::VariableForce::Assignment::MULTIPLE_LEFT_HAND_SIDE_TYPE = T.let(T. # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#65 +# source://rubocop/lib/rubocop/cop/variable_force.rb#68 class RuboCop::Cop::VariableForce::AssignmentReference < ::Struct # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force.rb#66 + # source://rubocop/lib/rubocop/cop/variable_force.rb#69 def assignment?; end # Returns the value of attribute node @@ -53433,32 +54626,37 @@ end # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#39 +# source://rubocop/lib/rubocop/cop/variable_force.rb#42 RuboCop::Cop::VariableForce::LOGICAL_OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#48 +# source://rubocop/lib/rubocop/cop/variable_force.rb#51 RuboCop::Cop::VariableForce::LOOP_TYPES = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#42 +# source://rubocop/lib/rubocop/cop/variable_force.rb#45 RuboCop::Cop::VariableForce::MULTIPLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#112 +# source://rubocop/lib/rubocop/cop/variable_force.rb#115 RuboCop::Cop::VariableForce::NODE_HANDLER_METHOD_NAMES = T.let(T.unsafe(nil), Hash) # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#40 +# source://rubocop/lib/rubocop/cop/variable_force.rb#43 RuboCop::Cop::VariableForce::OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#47 +# source://rubocop/lib/rubocop/cop/variable_force.rb#30 +RuboCop::Cop::VariableForce::PATTERN_MATCH_VARIABLE_TYPE = T.let(T.unsafe(nil), Symbol) + +# @api private +# +# source://rubocop/lib/rubocop/cop/variable_force.rb#50 RuboCop::Cop::VariableForce::POST_CONDITION_LOOP_TYPES = T.let(T.unsafe(nil), Array) # @api private @@ -53468,12 +54666,12 @@ RuboCop::Cop::VariableForce::REGEXP_NAMED_CAPTURE_TYPE = T.let(T.unsafe(nil), Sy # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#50 +# source://rubocop/lib/rubocop/cop/variable_force.rb#53 RuboCop::Cop::VariableForce::RESCUE_TYPE = T.let(T.unsafe(nil), Symbol) # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#43 +# source://rubocop/lib/rubocop/cop/variable_force.rb#46 RuboCop::Cop::VariableForce::REST_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) # This class represents each reference of a variable. @@ -53523,12 +54721,12 @@ RuboCop::Cop::VariableForce::Reference::VARIABLE_REFERENCE_TYPES = T.let(T.unsaf # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#55 +# source://rubocop/lib/rubocop/cop/variable_force.rb#58 RuboCop::Cop::VariableForce::SCOPE_TYPES = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#57 +# source://rubocop/lib/rubocop/cop/variable_force.rb#60 RuboCop::Cop::VariableForce::SEND_TYPE = T.let(T.unsafe(nil), Symbol) # A Scope represents a context of local variable visibility. @@ -53607,7 +54805,7 @@ RuboCop::Cop::VariableForce::Scope::OUTER_SCOPE_CHILD_INDICES = T.let(T.unsafe(n # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#54 +# source://rubocop/lib/rubocop/cop/variable_force.rb#57 RuboCop::Cop::VariableForce::TWISTED_SCOPE_TYPES = T.let(T.unsafe(nil), Array) # @api private @@ -53617,12 +54815,12 @@ RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Sym # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#30 +# source://rubocop/lib/rubocop/cop/variable_force.rb#31 RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#45 +# source://rubocop/lib/rubocop/cop/variable_force.rb#48 RuboCop::Cop::VariableForce::VARIABLE_REFERENCE_TYPE = T.let(T.unsafe(nil), Symbol) # A Variable represents existence of a local variable. @@ -53637,7 +54835,7 @@ class RuboCop::Cop::VariableForce::Variable # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#94 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#98 def argument?; end # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#31 @@ -53650,10 +54848,10 @@ class RuboCop::Cop::VariableForce::Variable # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#102 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#106 def block_argument?; end - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#74 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#78 def capture_with_block!; end # Returns the value of attribute captured_by_block. @@ -53673,22 +54871,22 @@ class RuboCop::Cop::VariableForce::Variable # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#110 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#114 def explicit_block_local_variable?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#66 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#70 def in_modifier_conditional?(assignment); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#106 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#110 def keyword_argument?; end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#98 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#102 def method_argument?; end # Returns the value of attribute name. @@ -53696,12 +54894,12 @@ class RuboCop::Cop::VariableForce::Variable # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#11 def name; end - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#40 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#44 def reference!(node); end # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#35 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#39 def referenced?; end # Returns the value of attribute references. @@ -53716,7 +54914,7 @@ class RuboCop::Cop::VariableForce::Variable # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#90 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#94 def should_be_unused?; end # This is a convenient way to check whether the variable is used @@ -53730,7 +54928,7 @@ class RuboCop::Cop::VariableForce::Variable # # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#86 + # source://rubocop/lib/rubocop/cop/variable_force/variable.rb#90 def used?; end end @@ -53739,12 +54937,12 @@ RuboCop::Cop::VariableForce::Variable::VARIABLE_DECLARATION_TYPES = T.let(T.unsa # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#59 +# source://rubocop/lib/rubocop/cop/variable_force.rb#62 class RuboCop::Cop::VariableForce::VariableReference < ::Struct # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/cop/variable_force.rb#60 + # source://rubocop/lib/rubocop/cop/variable_force.rb#63 def assignment?; end # Returns the value of attribute name @@ -53826,7 +55024,7 @@ end # @api private # -# source://rubocop/lib/rubocop/cop/variable_force.rb#52 +# source://rubocop/lib/rubocop/cop/variable_force.rb#55 RuboCop::Cop::VariableForce::ZERO_ARITY_SUPER_TYPE = T.let(T.unsafe(nil), Symbol) # Help methods for determining node visibility. @@ -54176,13 +55374,10 @@ end # # source://rubocop/lib/rubocop/ext/regexp_node.rb#6 module RuboCop::Ext::RegexpNode - # Please remove this `else` branch when support for regexp_parser 1.8 will be dropped. - # It's for compatibility with regexp_parser 1.8 and will never be maintained. - # - # source://rubocop/lib/rubocop/ext/regexp_node.rb#19 + # source://rubocop/lib/rubocop/ext/regexp_node.rb#18 def assign_properties(*_arg0); end - # source://rubocop/lib/rubocop/ext/regexp_node.rb#53 + # source://rubocop/lib/rubocop/ext/regexp_node.rb#31 def each_capture(named: T.unsafe(nil)); end # Note: we extend Regexp nodes to provide `loc` and `expression` @@ -54197,10 +55392,10 @@ module RuboCop::Ext::RegexpNode # @return [Boolean] # - # source://rubocop/lib/rubocop/ext/regexp_node.rb#65 + # source://rubocop/lib/rubocop/ext/regexp_node.rb#43 def named_capturing?(exp, event, named); end - # source://rubocop/lib/rubocop/ext/regexp_node.rb#73 + # source://rubocop/lib/rubocop/ext/regexp_node.rb#51 def with_interpolations_blanked; end end @@ -54221,7 +55416,7 @@ module RuboCop::Ext::RegexpParser::Expression; end module RuboCop::Ext::RegexpParser::Expression::Base # Shortcut to `loc.expression` # - # source://rubocop/lib/rubocop/ext/regexp_parser.rb#27 + # source://rubocop/lib/rubocop/ext/regexp_parser.rb#26 def expression; end # E.g. @@ -54234,7 +55429,7 @@ module RuboCop::Ext::RegexpParser::Expression::Base # # Please open issue if you need other locations # - # source://rubocop/lib/rubocop/ext/regexp_parser.rb#61 + # source://rubocop/lib/rubocop/ext/regexp_parser.rb#44 def loc; end # Returns the value of attribute origin. @@ -54251,15 +55446,15 @@ module RuboCop::Ext::RegexpParser::Expression::Base private - # source://rubocop/lib/rubocop/ext/regexp_parser.rb#67 + # source://rubocop/lib/rubocop/ext/regexp_parser.rb#50 def build_location; end end # Provide `CharacterSet` with `begin` and `end` locations. # -# source://rubocop/lib/rubocop/ext/regexp_parser.rb#79 +# source://rubocop/lib/rubocop/ext/regexp_parser.rb#62 module RuboCop::Ext::RegexpParser::Expression::CharacterSet - # source://rubocop/lib/rubocop/ext/regexp_parser.rb#80 + # source://rubocop/lib/rubocop/ext/regexp_parser.rb#63 def build_location; end end @@ -54387,11 +55582,16 @@ module RuboCop::FileFinder # source://rubocop/lib/rubocop/file_finder.rb#20 def find_last_file_upwards(filename, start_dir, stop_dir = T.unsafe(nil)); end + # @api private + # + # source://rubocop/lib/rubocop/file_finder.rb#26 + def traverse_directories_upwards(start_dir, stop_dir = T.unsafe(nil)); end + private # @api private # - # source://rubocop/lib/rubocop/file_finder.rb#28 + # source://rubocop/lib/rubocop/file_finder.rb#36 def traverse_files_upwards(filename, start_dir, stop_dir); end class << self @@ -54658,16 +55858,16 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#73 def command; end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#161 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#165 def cop_config_params(default_cfg, cfg); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#181 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#185 def default_config(cop_name); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#225 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#229 def excludes(offending_files, cop_name, parent); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#196 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#200 def filtered_config(cfg); end # Returns true if the given arr include the given elm or if any of the @@ -54675,38 +55875,38 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo # # @return [Boolean] # - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#273 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#277 def include_or_match?(arr, elm); end # @return [Boolean] # - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#246 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#250 def merge_mode_for_exclude?(cfg); end # @return [Boolean] # - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#267 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#271 def no_exclude_limit?; end # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#102 def output_cop(cop_name, offense_count); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#133 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#137 def output_cop_comments(output_buffer, cfg, cop_name, offense_count); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#185 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#189 def output_cop_config(output_buffer, cfg, cop_name); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#168 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#172 def output_cop_param_comments(output_buffer, params, default_cfg); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#215 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#219 def output_exclude_list(output_buffer, offending_files, cop_name); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#250 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#254 def output_exclude_path(output_buffer, exclude_path, parent); end - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#204 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#208 def output_offending_files(output_buffer, cfg, cop_name); end # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#96 @@ -54714,12 +55914,17 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo # @return [Boolean] # - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#263 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#267 def safe_autocorrect?(config); end # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#116 def set_max(cfg, cop_name); end + # @return [Boolean] + # + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#125 + def should_set_max?(cop_name); end + # @return [Boolean] # # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#65 @@ -54732,12 +55937,12 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo # @return [Boolean] # - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#153 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#157 def supports_safe_autocorrect?(cop_class, default_cfg); end # @return [Boolean] # - # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#157 + # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#161 def supports_unsafe_autocorrect?(cop_class, default_cfg); end # source://rubocop/lib/rubocop/formatter/disabled_config_formatter.rb#92 @@ -54810,43 +56015,46 @@ end class RuboCop::Formatter::FormatterSet < ::Array # @return [FormatterSet] a new instance of FormatterSet # - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#39 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#40 def initialize(options = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#55 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#56 def add_formatter(formatter_type, output_path = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#67 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#68 def close_output_files; end - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#50 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#51 def file_finished(file, offenses); end - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#44 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#45 def file_started(file, options); end - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#34 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#35 def finished(*args); end - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#34 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#35 def started(*args); end private - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#86 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#87 def builtin_formatter_class(specified_key); end - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#99 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#105 def custom_formatter_class(specified_class_name); end - # source://rubocop/lib/rubocop/formatter/formatter_set.rb#75 + # source://rubocop/lib/rubocop/formatter/formatter_set.rb#76 def formatter_class(formatter_type); end end # source://rubocop/lib/rubocop/formatter/formatter_set.rb#11 RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTERS_FOR_KEYS = T.let(T.unsafe(nil), Hash) -# source://rubocop/lib/rubocop/formatter/formatter_set.rb#31 +# source://rubocop/lib/rubocop/formatter/formatter_set.rb#30 +RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTER_NAMES = T.let(T.unsafe(nil), Array) + +# source://rubocop/lib/rubocop/formatter/formatter_set.rb#32 RuboCop::Formatter::FormatterSet::FORMATTER_APIS = T.let(T.unsafe(nil), Array) # This formatter displays a progress bar and shows details of offenses as @@ -54946,15 +56154,15 @@ end # This class provides helper methods used in the ERB CSS template. # -# source://rubocop/lib/rubocop/formatter/html_formatter.rb#135 +# source://rubocop/lib/rubocop/formatter/html_formatter.rb#137 class RuboCop::Formatter::HTMLFormatter::CSSContext # Make Kernel#binding public. # - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#146 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#148 def binding; end end -# source://rubocop/lib/rubocop/formatter/html_formatter.rb#136 +# source://rubocop/lib/rubocop/formatter/html_formatter.rb#138 RuboCop::Formatter::HTMLFormatter::CSSContext::SEVERITY_COLORS = T.let(T.unsafe(nil), Hash) # source://rubocop/lib/rubocop/formatter/html_formatter.rb#12 @@ -55026,60 +56234,60 @@ RuboCop::Formatter::HTMLFormatter::ELLIPSES = T.let(T.unsafe(nil), String) # This class provides helper methods used in the ERB template. # -# source://rubocop/lib/rubocop/formatter/html_formatter.rb#61 +# source://rubocop/lib/rubocop/formatter/html_formatter.rb#63 class RuboCop::Formatter::HTMLFormatter::ERBContext include ::RuboCop::PathUtil include ::RuboCop::Formatter::TextUtil # @return [ERBContext] a new instance of ERBContext # - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#69 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#71 def initialize(files, summary); end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#116 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#118 def base64_encoded_logo_image; end # Make Kernel#binding public. # - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#76 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#78 def binding; end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#81 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#83 def decorated_message(offense); end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#112 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#114 def escape(string); end # Returns the value of attribute files. # - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#67 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#69 def files; end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#92 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#94 def highlight_source_tag(offense); end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#85 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#87 def highlighted_source_line(offense); end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#108 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#110 def possible_ellipses(location); end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#124 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#126 def render_css; end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#103 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#105 def source_after_highlight(offense); end - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#98 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#100 def source_before_highlight(offense); end # Returns the value of attribute summary. # - # source://rubocop/lib/rubocop/formatter/html_formatter.rb#67 + # source://rubocop/lib/rubocop/formatter/html_formatter.rb#69 def summary; end end -# source://rubocop/lib/rubocop/formatter/html_formatter.rb#65 +# source://rubocop/lib/rubocop/formatter/html_formatter.rb#67 RuboCop::Formatter::HTMLFormatter::ERBContext::LOGO_IMAGE_PATH = T.let(T.unsafe(nil), String) # source://rubocop/lib/rubocop/formatter/html_formatter.rb#25 @@ -55207,40 +56415,92 @@ end # This formatter formats the report data in JUnit format. # -# source://rubocop/lib/rubocop/formatter/junit_formatter.rb#17 +# source://rubocop/lib/rubocop/formatter/junit_formatter.rb#15 class RuboCop::Formatter::JUnitFormatter < ::RuboCop::Formatter::BaseFormatter # @return [JUnitFormatter] a new instance of JUnitFormatter # - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#18 + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#24 def initialize(output, options = T.unsafe(nil)); end - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#55 - def add_testcase_element_to_testsuite_element(file, target_offenses, cop); end - - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#64 - def classname_attribute_value(file); end - - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#29 + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#32 def file_finished(file, offenses); end - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#71 + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#51 def finished(_inspected_files); end - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#51 + private + + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#106 + def add_failure_to(testcase, offenses, cop_name); end + + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#85 + def add_testcase_element_to_testsuite_element(file, target_offenses, cop); end + + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#94 + def classname_attribute_value(file); end + + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#81 def offenses_for_cop(all_offenses, cop); end # @return [Boolean] # - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#47 + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#77 def relevant_for_output?(options, target_offenses); end - private + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#101 + def reset_count; end - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#83 - def add_failure_to(testcase, offenses, cop_name); end + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#118 + def xml_escape(string); end +end - # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#78 - def reset_count; end +# source://rubocop/lib/rubocop/formatter/junit_formatter.rb#16 +RuboCop::Formatter::JUnitFormatter::ESCAPE_MAP = T.let(T.unsafe(nil), Hash) + +# source://rubocop/lib/rubocop/formatter/junit_formatter.rb#132 +class RuboCop::Formatter::JUnitFormatter::FailureElement + # @return [FailureElement] a new instance of FailureElement + # + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#135 + def initialize(type:, message:, text:); end + + # Returns the value of attribute message. + # + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#133 + def message; end + + # Returns the value of attribute text. + # + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#133 + def text; end + + # Returns the value of attribute type. + # + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#133 + def type; end +end + +# source://rubocop/lib/rubocop/formatter/junit_formatter.rb#122 +class RuboCop::Formatter::JUnitFormatter::TestCaseElement + # @return [TestCaseElement] a new instance of TestCaseElement + # + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#125 + def initialize(classname:, name:); end + + # Returns the value of attribute classname. + # + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#123 + def classname; end + + # Returns the value of attribute failures. + # + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#123 + def failures; end + + # Returns the value of attribute name. + # + # source://rubocop/lib/rubocop/formatter/junit_formatter.rb#123 + def name; end end # This formatter displays the report data in markdown @@ -55607,7 +56867,7 @@ module RuboCop::LSP # @return [void] # # source://rubocop/lib/rubocop/lsp.rb#25 - def disable; end + def disable(&block); end # Enable LSP. # @@ -55629,7 +56889,7 @@ module RuboCop::LSP # @return [void] # # source://rubocop/lib/rubocop/lsp.rb#25 - def disable; end + def disable(&block); end # Enable LSP. # @@ -55647,227 +56907,6 @@ module RuboCop::LSP end end -# Log for Language Server Protocol of RuboCop. -# -# @api private -# -# source://rubocop/lib/rubocop/lsp/logger.rb#16 -class RuboCop::LSP::Logger - class << self - # @api private - # - # source://rubocop/lib/rubocop/lsp/logger.rb#17 - def log(message); end - end -end - -# Routes for Language Server Protocol of RuboCop. -# -# @api private -# -# source://rubocop/lib/rubocop/lsp/routes.rb#18 -class RuboCop::LSP::Routes - # @api private - # @return [Routes] a new instance of Routes - # - # source://rubocop/lib/rubocop/lsp/routes.rb#25 - def initialize(server); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#31 - def for(name); end - - # source://rubocop/lib/rubocop/lsp/routes.rb#38 - def handle_initialize(request); end - - # source://rubocop/lib/rubocop/lsp/routes.rb#61 - def handle_initialized(_request); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#168 - def handle_method_missing(request); end - - # source://rubocop/lib/rubocop/lsp/routes.rb#67 - def handle_shutdown(request); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#157 - def handle_unsupported_method(request, method = T.unsafe(nil)); end - - private - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#206 - def diagnostic(file_uri, text); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#176 - def extract_initialization_options_from(request); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#186 - def format_file(file_uri, command: T.unsafe(nil)); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#220 - def remove_file_protocol_from(uri); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#224 - def to_diagnostic(offense); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#236 - def to_range(location); end - - class << self - private - - # @api private - # - # source://rubocop/lib/rubocop/lsp/routes.rb#19 - def handle(name, &block); end - end -end - -# Runtime for Language Server Protocol of RuboCop. -# -# @api private -# -# source://rubocop/lib/rubocop/lsp/runtime.rb#16 -class RuboCop::LSP::Runtime - # @api private - # @return [Runtime] a new instance of Runtime - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#19 - def initialize(config_store); end - - # This abuses the `--stdin` option of rubocop and reads the formatted text - # from the `options[:stdin]` that rubocop mutates. This depends on - # `parallel: false` as well as the fact that RuboCop doesn't otherwise dup - # or reassign that options object. Risky business! - # - # Reassigning `options[:stdin]` is done here: - # https://github.com/rubocop/rubocop/blob/v1.52.0/lib/rubocop/cop/team.rb#L131 - # Printing `options[:stdin]` - # https://github.com/rubocop/rubocop/blob/v1.52.0/lib/rubocop/cli/command/execute_runner.rb#L95 - # Setting `parallel: true` would break this here: - # https://github.com/rubocop/rubocop/blob/v1.52.0/lib/rubocop/runner.rb#L72 - # - # @api private - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#38 - def format(path, text, command:); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#17 - def layout_mode=(_arg0); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#17 - def lint_mode=(_arg0); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#55 - def offenses(path, text); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#17 - def safe_autocorrect=(_arg0); end - - private - - # @api private - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#77 - def config_only_options; end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#84 - def redirect_stdout(&block); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/runtime.rb#92 - def run_rubocop(options, path); end -end - -# Language Server Protocol of RuboCop. -# -# @api private -# -# source://rubocop/lib/rubocop/lsp/server.rb#22 -class RuboCop::LSP::Server - # @api private - # @return [Server] a new instance of Server - # - # source://rubocop/lib/rubocop/lsp/server.rb#23 - def initialize(config_store); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/server.rb#61 - def configure(options); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/server.rb#53 - def format(path, text, command:); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/server.rb#57 - def offenses(path, text); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/server.rb#34 - def start; end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/server.rb#67 - def stop(&block); end - - # @api private - # - # source://rubocop/lib/rubocop/lsp/server.rb#49 - def write(response); end -end - -# Severity for Language Server Protocol of RuboCop. -# -# @api private -# -# source://rubocop/lib/rubocop/lsp/severity.rb#7 -class RuboCop::LSP::Severity - class << self - # @api private - # - # source://rubocop/lib/rubocop/lsp/severity.rb#17 - def find_by(rubocop_severity); end - end -end - -# @api private -# -# source://rubocop/lib/rubocop/lsp/severity.rb#8 -RuboCop::LSP::Severity::SEVERITIES = T.let(T.unsafe(nil), Hash) - # Encapsulation of a lockfile for use when checking for gems. # Does not actually resolve gems, just parses the lockfile. # @@ -55918,17 +56957,17 @@ class RuboCop::Lockfile private - # @api private - # @return [Boolean] - # - # source://rubocop/lib/rubocop/lockfile.rb#85 - def bundler_lock_parser_defined?; end - # @api private # @return [Bundler::LockfileParser, nil] # # source://rubocop/lib/rubocop/lockfile.rb#72 def parser; end + + # @api private + # @return [Boolean] + # + # source://rubocop/lib/rubocop/lockfile.rb#85 + def use_bundler_lock_parser?; end end # Parse different formats of magic comments. @@ -56693,12 +57732,12 @@ class RuboCop::RemoteConfig # @api private # - # source://rubocop/lib/rubocop/remote_config.rb#19 + # source://rubocop/lib/rubocop/remote_config.rb#23 def file; end # @api private # - # source://rubocop/lib/rubocop/remote_config.rb#32 + # source://rubocop/lib/rubocop/remote_config.rb#36 def inherit_from_remote(file, path); end # @api private @@ -56710,46 +57749,46 @@ class RuboCop::RemoteConfig # @api private # - # source://rubocop/lib/rubocop/remote_config.rb#95 + # source://rubocop/lib/rubocop/remote_config.rb#99 def cache_name_from_uri; end # @api private # - # source://rubocop/lib/rubocop/remote_config.rb#78 + # source://rubocop/lib/rubocop/remote_config.rb#82 def cache_path; end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/remote_config.rb#82 + # source://rubocop/lib/rubocop/remote_config.rb#86 def cache_path_exists?; end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/remote_config.rb#86 + # source://rubocop/lib/rubocop/remote_config.rb#90 def cache_path_expired?; end # @api private # - # source://rubocop/lib/rubocop/remote_config.rb#101 + # source://rubocop/lib/rubocop/remote_config.rb#105 def cloned_url; end # @api private # @yield [request] # - # source://rubocop/lib/rubocop/remote_config.rb#53 + # source://rubocop/lib/rubocop/remote_config.rb#57 def generate_request(uri); end # @api private # - # source://rubocop/lib/rubocop/remote_config.rb#62 + # source://rubocop/lib/rubocop/remote_config.rb#66 def handle_response(response, limit, &block); end # @api private # @raise [ArgumentError] # - # source://rubocop/lib/rubocop/remote_config.rb#40 + # source://rubocop/lib/rubocop/remote_config.rb#44 def request(uri = T.unsafe(nil), limit = T.unsafe(nil), &block); end end @@ -56812,7 +57851,7 @@ class RuboCop::ResultCache # # @api private # - # source://rubocop/lib/rubocop/result_cache.rb#236 + # source://rubocop/lib/rubocop/result_cache.rb#229 def context_checksum(team, options); end # @api private @@ -56852,14 +57891,6 @@ class RuboCop::ResultCache # source://rubocop/lib/rubocop/result_cache.rb#142 def symlink_protection_triggered?(path); end - # The external dependency checksums are cached per RuboCop team so that - # the checksums don't need to be recomputed for each file. - # - # @api private - # - # source://rubocop/lib/rubocop/result_cache.rb#227 - def team_checksum(team); end - class << self # @api private # @return [Boolean] @@ -57005,10 +58036,10 @@ class RuboCop::Runner # @return [Boolean] # - # source://rubocop/lib/rubocop/runner.rb#427 + # source://rubocop/lib/rubocop/runner.rb#434 def considered_failure?(offense); end - # source://rubocop/lib/rubocop/runner.rb#460 + # source://rubocop/lib/rubocop/runner.rb#471 def default_config(cop_name); end # source://rubocop/lib/rubocop/runner.rb#276 @@ -57037,16 +58068,16 @@ class RuboCop::Runner # source://rubocop/lib/rubocop/runner.rb#244 def file_started(file); end - # source://rubocop/lib/rubocop/runner.rb#407 + # source://rubocop/lib/rubocop/runner.rb#414 def filter_cop_classes(cop_classes, config); end # source://rubocop/lib/rubocop/runner.rb#108 def find_target_files(paths); end - # source://rubocop/lib/rubocop/runner.rb#418 + # source://rubocop/lib/rubocop/runner.rb#425 def formatter_set; end - # source://rubocop/lib/rubocop/runner.rb#475 + # source://rubocop/lib/rubocop/runner.rb#486 def get_processed_source(file); end # source://rubocop/lib/rubocop/runner.rb#346 @@ -57063,25 +58094,30 @@ class RuboCop::Runner # @return [Boolean] # - # source://rubocop/lib/rubocop/runner.rb#456 + # source://rubocop/lib/rubocop/runner.rb#467 def mark_as_safe_by_config?(config); end - # source://rubocop/lib/rubocop/runner.rb#464 + # source://rubocop/lib/rubocop/runner.rb#475 def minimum_severity_to_fail; end - # source://rubocop/lib/rubocop/runner.rb#368 + # source://rubocop/lib/rubocop/runner.rb#375 def mobilize_team(processed_source); end - # source://rubocop/lib/rubocop/runner.rb#373 + # source://rubocop/lib/rubocop/runner.rb#380 def mobilized_cop_classes(config); end - # source://rubocop/lib/rubocop/runner.rb#436 + # @return [Boolean] + # + # source://rubocop/lib/rubocop/runner.rb#443 + def offense_displayed?(offense); end + + # source://rubocop/lib/rubocop/runner.rb#455 def offenses_to_report(offenses); end # source://rubocop/lib/rubocop/runner.rb#156 def process_file(file); end - # source://rubocop/lib/rubocop/runner.rb#397 + # source://rubocop/lib/rubocop/runner.rb#404 def qualify_option_cop_names; end # @yield [cop] @@ -57097,17 +58133,17 @@ class RuboCop::Runner # otherwise dormant team that can be used for config- and option- # level caching in ResultCache. # - # source://rubocop/lib/rubocop/runner.rb#503 + # source://rubocop/lib/rubocop/runner.rb#514 def standby_team(config); end # @return [Boolean] # - # source://rubocop/lib/rubocop/runner.rb#414 + # source://rubocop/lib/rubocop/runner.rb#421 def style_guide_cops_only?(config); end # @return [Boolean] # - # source://rubocop/lib/rubocop/runner.rb#448 + # source://rubocop/lib/rubocop/runner.rb#459 def supports_safe_autocorrect?(offense); end # @yield [team] @@ -57379,34 +58415,34 @@ class RuboCop::TargetRuby # @api private # @return [TargetRuby] a new instance of TargetRuby # - # source://rubocop/lib/rubocop/target_ruby.rb#254 + # source://rubocop/lib/rubocop/target_ruby.rb#258 def initialize(config); end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#270 + # source://rubocop/lib/rubocop/target_ruby.rb#274 def rubocop_version_with_support; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#258 + # source://rubocop/lib/rubocop/target_ruby.rb#262 def source; end # @api private # @return [Boolean] # - # source://rubocop/lib/rubocop/target_ruby.rb#266 + # source://rubocop/lib/rubocop/target_ruby.rb#270 def supported?; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#262 + # source://rubocop/lib/rubocop/target_ruby.rb#266 def version; end class << self # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#240 + # source://rubocop/lib/rubocop/target_ruby.rb#244 def supported_versions; end end end @@ -57415,23 +58451,23 @@ end # # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#187 +# source://rubocop/lib/rubocop/target_ruby.rb#191 class RuboCop::TargetRuby::BundlerLockFile < ::RuboCop::TargetRuby::Source # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#188 + # source://rubocop/lib/rubocop/target_ruby.rb#192 def name; end private # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#221 + # source://rubocop/lib/rubocop/target_ruby.rb#225 def bundler_lock_file_path; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#194 + # source://rubocop/lib/rubocop/target_ruby.rb#198 def find_version; end end @@ -57444,18 +58480,18 @@ RuboCop::TargetRuby::DEFAULT_VERSION = T.let(T.unsafe(nil), Float) # # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#228 +# source://rubocop/lib/rubocop/target_ruby.rb#232 class RuboCop::TargetRuby::Default < ::RuboCop::TargetRuby::Source # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#229 + # source://rubocop/lib/rubocop/target_ruby.rb#233 def name; end private # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#235 + # source://rubocop/lib/rubocop/target_ruby.rb#239 def find_version; end end @@ -57467,42 +58503,37 @@ end class RuboCop::TargetRuby::GemspecFile < ::RuboCop::TargetRuby::Source extend ::RuboCop::AST::NodePattern::Macros - # source://rubocop/lib/rubocop/target_ruby.rb#64 + # source://rubocop/lib/rubocop/target_ruby.rb#62 def gem_requirement_versions(param0 = T.unsafe(nil)); end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#70 + # source://rubocop/lib/rubocop/target_ruby.rb#68 def name; end - # source://rubocop/lib/rubocop/target_ruby.rb#59 + # source://rubocop/lib/rubocop/target_ruby.rb#57 def required_ruby_version(param0); end private # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#121 - def find_default_minimal_known_ruby(right_hand_side); end + # source://rubocop/lib/rubocop/target_ruby.rb#123 + def find_minimal_known_ruby(right_hand_side); end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#76 + # source://rubocop/lib/rubocop/target_ruby.rb#74 def find_version; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#86 - def gemspec_filename; end - - # @api private - # - # source://rubocop/lib/rubocop/target_ruby.rb#93 + # source://rubocop/lib/rubocop/target_ruby.rb#84 def gemspec_filepath; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#117 + # source://rubocop/lib/rubocop/target_ruby.rb#119 def version_from_array(array); end # @api private @@ -57512,15 +58543,10 @@ class RuboCop::TargetRuby::GemspecFile < ::RuboCop::TargetRuby::Source # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#105 + # source://rubocop/lib/rubocop/target_ruby.rb#107 def version_from_right_hand_side(right_hand_side); end end -# @api private -# -# source://rubocop/lib/rubocop/target_ruby.rb#56 -RuboCop::TargetRuby::GemspecFile::GEMSPEC_EXTENSION = T.let(T.unsafe(nil), String) - # @api private # # source://rubocop/lib/rubocop/target_ruby.rb#7 @@ -57554,49 +58580,49 @@ end # # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#133 +# source://rubocop/lib/rubocop/target_ruby.rb#137 class RuboCop::TargetRuby::RubyVersionFile < ::RuboCop::TargetRuby::Source # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#137 + # source://rubocop/lib/rubocop/target_ruby.rb#141 def name; end private # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#143 + # source://rubocop/lib/rubocop/target_ruby.rb#147 def filename; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#151 + # source://rubocop/lib/rubocop/target_ruby.rb#155 def find_version; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#147 + # source://rubocop/lib/rubocop/target_ruby.rb#151 def pattern; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#158 + # source://rubocop/lib/rubocop/target_ruby.rb#162 def version_file; end end # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#134 +# source://rubocop/lib/rubocop/target_ruby.rb#138 RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_FILENAME = T.let(T.unsafe(nil), String) # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#135 +# source://rubocop/lib/rubocop/target_ruby.rb#139 RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp) # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#244 +# source://rubocop/lib/rubocop/target_ruby.rb#248 RuboCop::TargetRuby::SOURCES = T.let(T.unsafe(nil), Array) # A place where information about a target ruby version is found. @@ -57632,34 +58658,34 @@ end # # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#166 +# source://rubocop/lib/rubocop/target_ruby.rb#170 class RuboCop::TargetRuby::ToolVersionsFile < ::RuboCop::TargetRuby::RubyVersionFile # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#170 + # source://rubocop/lib/rubocop/target_ruby.rb#174 def name; end private # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#176 + # source://rubocop/lib/rubocop/target_ruby.rb#180 def filename; end # @api private # - # source://rubocop/lib/rubocop/target_ruby.rb#180 + # source://rubocop/lib/rubocop/target_ruby.rb#184 def pattern; end end # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#167 +# source://rubocop/lib/rubocop/target_ruby.rb#171 RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_FILENAME = T.let(T.unsafe(nil), String) # @api private # -# source://rubocop/lib/rubocop/target_ruby.rb#168 +# source://rubocop/lib/rubocop/target_ruby.rb#172 RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_PATTERN = T.let(T.unsafe(nil), Regexp) # source://rubocop/lib/rubocop/ast_aliases.rb#7 @@ -57685,12 +58711,17 @@ module RuboCop::Version class << self # @api private # - # source://rubocop/lib/rubocop/version.rb#108 + # source://rubocop/lib/rubocop/version.rb#99 + def config_for_pwd(env); end + + # @api private + # + # source://rubocop/lib/rubocop/version.rb#129 def document_version; end # @api private # - # source://rubocop/lib/rubocop/version.rb#58 + # source://rubocop/lib/rubocop/version.rb#66 def extension_versions(env); end # Returns feature version in one of two ways: @@ -57700,30 +58731,42 @@ module RuboCop::Version # # @api private # - # source://rubocop/lib/rubocop/version.rb#92 + # source://rubocop/lib/rubocop/version.rb#113 def feature_version(feature); end # @api private # - # source://rubocop/lib/rubocop/version.rb#43 + # source://rubocop/lib/rubocop/version.rb#51 def parser_version; end # @api private # - # source://rubocop/lib/rubocop/version.rb#113 + # source://rubocop/lib/rubocop/version.rb#134 def server_mode; end # @api private # - # source://rubocop/lib/rubocop/version.rb#21 + # source://rubocop/lib/rubocop/version.rb#90 + def target_ruby_version(env); end + + # @api private + # + # source://rubocop/lib/rubocop/version.rb#46 + def verbose(env: T.unsafe(nil)); end + + # NOTE: Marked as private but used by gems like standard. + # + # @api private + # + # source://rubocop/lib/rubocop/version.rb#23 def version(debug: T.unsafe(nil), env: T.unsafe(nil)); end end end -# source://rubocop/lib/rubocop/version.rb#12 +# source://rubocop/lib/rubocop/version.rb#13 RuboCop::Version::CANONICAL_FEATURE_NAMES = T.let(T.unsafe(nil), Hash) -# source://rubocop/lib/rubocop/version.rb#16 +# source://rubocop/lib/rubocop/version.rb#17 RuboCop::Version::EXTENSION_PATH_NAMES = T.let(T.unsafe(nil), Hash) # source://rubocop/lib/rubocop/version.rb#8 @@ -57752,14 +58795,23 @@ module RuboCop::YAMLDuplicationChecker # # source://rubocop/lib/rubocop/yaml_duplication_checker.rb#7 def check(yaml_string, filename, &on_duplicated); end + end +end - private +# @api private +# +# source://rubocop/lib/rubocop/yaml_duplication_checker.rb#14 +class RuboCop::YAMLDuplicationChecker::DuplicationCheckHandler < ::Psych::TreeBuilder + # @api private + # @return [DuplicationCheckHandler] a new instance of DuplicationCheckHandler + # + # source://rubocop/lib/rubocop/yaml_duplication_checker.rb#15 + def initialize(&block); end - # @api private - # - # source://rubocop/lib/rubocop/yaml_duplication_checker.rb#21 - def traverse(tree, &on_duplicated); end - end + # @api private + # + # source://rubocop/lib/rubocop/yaml_duplication_checker.rb#20 + def end_mapping; end end # Extensions to the core String class diff --git a/sorbet/rbi/gems/ruby-lsp@0.21.2.rbi b/sorbet/rbi/gems/ruby-lsp@0.21.2.rbi index 79f8bf17..8d862182 100644 --- a/sorbet/rbi/gems/ruby-lsp@0.21.2.rbi +++ b/sorbet/rbi/gems/ruby-lsp@0.21.2.rbi @@ -357,7 +357,7 @@ class RubyIndexer::Entry # @return [RubyIndexer::Location] # - # source://sorbet-runtime/0.5.11577lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def name_location(*args, **_arg1, &blk); end # source://ruby-lsp/lib/ruby_indexer/lib/ruby_indexer/entry.rb#57 @@ -705,7 +705,7 @@ class RubyIndexer::Entry::Parameter # # @return [Symbol] # - # source://sorbet-runtime/0.5.11577lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def decorated_name(*args, **_arg1, &blk); end # Name includes just the name of the parameter, excluding symbols like splats @@ -5070,7 +5070,7 @@ class RubyLsp::Requests::Support::RuboCopDiagnostic end # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb#22 -RubyLsp::Requests::Support::RuboCopDiagnostic::ENHANCED_DOC_URL = T.let(T.unsafe(nil), FalseClass) +RubyLsp::Requests::Support::RuboCopDiagnostic::ENHANCED_DOC_URL = T.let(T.unsafe(nil), TrueClass) # source://ruby-lsp/lib/ruby_lsp/requests/support/rubocop_diagnostic.rb#10 RubyLsp::Requests::Support::RuboCopDiagnostic::RUBOCOP_TO_LSP_SEVERITY = T.let(T.unsafe(nil), Hash) @@ -5249,7 +5249,7 @@ class RubyLsp::ResponseBuilders::DocumentSymbol < ::RubyLsp::ResponseBuilders::R # @param symbol [Interface::DocumentSymbol] # @return [void] # - # source://sorbet-runtime/0.5.11577lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def <<(*args, **_arg1, &blk); end # source://ruby-lsp/lib/ruby_lsp/response_builders/document_symbol.rb#47 @@ -5663,7 +5663,7 @@ class RubyLsp::Server < ::RubyLsp::BaseServer # @param message [Hash{Symbol => T.untyped}] # @return [void] # - # source://sorbet-runtime/0.5.11577lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def text_document_code_lens(*args, **_arg1, &blk); end # source://ruby-lsp/lib/ruby_lsp/server.rb#865 @@ -5701,19 +5701,19 @@ class RubyLsp::Server < ::RubyLsp::BaseServer # @param message [Hash{Symbol => T.untyped}] # @return [void] # - # source://sorbet-runtime/0.5.11577lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def text_document_document_link(*args, **_arg1, &blk); end # @param message [Hash{Symbol => T.untyped}] # @return [void] # - # source://sorbet-runtime/0.5.11577lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def text_document_document_symbol(*args, **_arg1, &blk); end # @param message [Hash{Symbol => T.untyped}] # @return [void] # - # source://sorbet-runtime/0.5.11577lib/types/private/methods/_methods.rb#257 + # source://sorbet-runtime/0.5.11635lib/types/private/methods/_methods.rb#257 def text_document_folding_range(*args, **_arg1, &blk); end # source://ruby-lsp/lib/ruby_lsp/server.rb#595 diff --git a/sorbet/rbi/gems/spoom@1.3.0.rbi b/sorbet/rbi/gems/spoom@1.5.0.rbi similarity index 76% rename from sorbet/rbi/gems/spoom@1.3.0.rbi rename to sorbet/rbi/gems/spoom@1.5.0.rbi index f7c1d862..af3a0e1d 100644 --- a/sorbet/rbi/gems/spoom@1.3.0.rbi +++ b/sorbet/rbi/gems/spoom@1.5.0.rbi @@ -6,7 +6,13 @@ # source://spoom/lib/spoom.rb#7 -module Spoom; end +module Spoom + class << self + # source://spoom/lib/spoom/parse.rb#13 + sig { params(ruby: ::String, file: ::String).returns(::Prism::Node) } + def parse_ruby(ruby, file:); end + end +end # source://spoom/lib/spoom/backtrace_filter/minitest.rb#7 module Spoom::BacktraceFilter; end @@ -35,7 +41,7 @@ class Spoom::Cli::Deadcode < ::Thor def help(command = T.unsafe(nil), subcommand = T.unsafe(nil)); end - # source://spoom/lib/spoom/cli/deadcode.rb#150 + # source://spoom/lib/spoom/cli/deadcode.rb#154 def remove(location_string); end end @@ -433,7 +439,7 @@ module Spoom::Context::Bundle # Returns `nil` if `gem` cannot be found in the Gemfile. # # source://spoom/lib/spoom/context/bundle.rb#62 - sig { params(gem: ::String).returns(T.nilable(::String)) } + sig { params(gem: ::String).returns(T.nilable(::Gem::Version)) } def gem_version_from_gemfile_lock(gem); end # source://spoom/lib/spoom/context/bundle.rb#51 @@ -1011,7 +1017,7 @@ class Spoom::Coverage::D3::ColorPalette < ::T::Struct prop :strong, ::String class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -1351,7 +1357,7 @@ class Spoom::Coverage::Snapshot < ::T::Struct sig { params(obj: T::Hash[::String, T.untyped]).returns(::Spoom::Coverage::Snapshot) } def from_obj(obj); end - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -1403,53 +1409,15 @@ class Spoom::Coverage::Template def html; end end -# source://spoom/lib/spoom/deadcode/visitor.rb#5 +# source://spoom/lib/spoom/deadcode/erb.rb#27 module Spoom::Deadcode class << self - # source://spoom/lib/spoom/deadcode.rb#81 - sig do - params( - index: ::Spoom::Deadcode::Index, - erb: ::String, - file: ::String, - plugins: T::Array[::Spoom::Deadcode::Plugins::Base] - ).void - end - def index_erb(index, erb, file:, plugins: T.unsafe(nil)); end - - # source://spoom/lib/spoom/deadcode.rb#67 - sig do - params( - index: ::Spoom::Deadcode::Index, - node: ::Prism::Node, - ruby: ::String, - file: ::String, - plugins: T::Array[::Spoom::Deadcode::Plugins::Base] - ).void - end - def index_node(index, node, ruby, file:, plugins: T.unsafe(nil)); end - - # source://spoom/lib/spoom/deadcode.rb#75 - sig do - params( - index: ::Spoom::Deadcode::Index, - ruby: ::String, - file: ::String, - plugins: T::Array[::Spoom::Deadcode::Plugins::Base] - ).void - end - def index_ruby(index, ruby, file:, plugins: T.unsafe(nil)); end - # source://spoom/lib/spoom/deadcode/plugins.rb#75 - sig { params(context: ::Spoom::Context).returns(T::Array[::Spoom::Deadcode::Plugins::Base]) } + sig { params(context: ::Spoom::Context).returns(T::Array[T.class_of(Spoom::Deadcode::Plugins::Base)]) } def load_custom_plugins(context); end - # source://spoom/lib/spoom/deadcode.rb#43 - sig { params(ruby: ::String, file: ::String).returns(::Prism::Node) } - def parse_ruby(ruby, file:); end - # source://spoom/lib/spoom/deadcode/plugins.rb#61 - sig { params(context: ::Spoom::Context).returns(T::Array[::Spoom::Deadcode::Plugins::Base]) } + sig { params(context: ::Spoom::Context).returns(T::Set[T.class_of(Spoom::Deadcode::Plugins::Base)]) } def plugins_from_gemfile_lock(context); end end end @@ -1467,7 +1435,7 @@ class Spoom::Deadcode::Definition < ::T::Struct const :kind, ::Spoom::Deadcode::Definition::Kind const :name, ::String const :full_name, ::String - const :location, ::Spoom::Deadcode::Location + const :location, ::Spoom::Location const :status, ::Spoom::Deadcode::Definition::Status, default: T.unsafe(nil) # source://spoom/lib/spoom/deadcode/definition.rb#78 @@ -1525,7 +1493,7 @@ class Spoom::Deadcode::Definition < ::T::Struct def to_json(*args); end class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -1585,40 +1553,35 @@ end # source://spoom/lib/spoom/deadcode/erb.rb#63 Spoom::Deadcode::ERB::BLOCK_EXPR = T.let(T.unsafe(nil), Regexp) -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom/lib/spoom/deadcode.rb#21 -class Spoom::Deadcode::Error < ::Spoom::Error - abstract! -end - # source://spoom/lib/spoom/deadcode/index.rb#6 class Spoom::Deadcode::Index - # source://spoom/lib/spoom/deadcode/index.rb#16 - sig { void } - def initialize; end + # source://spoom/lib/spoom/deadcode/index.rb#29 + sig { params(model: ::Spoom::Model).void } + def initialize(model); end - # source://spoom/lib/spoom/deadcode/index.rb#51 + # source://spoom/lib/spoom/deadcode/index.rb#219 sig { returns(T::Array[::Spoom::Deadcode::Definition]) } def all_definitions; end - # source://spoom/lib/spoom/deadcode/index.rb#56 - sig { returns(T::Array[::Spoom::Deadcode::Reference]) } + # source://spoom/lib/spoom/deadcode/index.rb#224 + sig { returns(T::Array[::Spoom::Model::Reference]) } def all_references; end - # Indexing - # - # source://spoom/lib/spoom/deadcode/index.rb#24 + # source://spoom/lib/spoom/deadcode/index.rb#99 + sig { params(plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def apply_plugins!(plugins); end + + # source://spoom/lib/spoom/deadcode/index.rb#79 sig { params(definition: ::Spoom::Deadcode::Definition).void } def define(definition); end - # source://spoom/lib/spoom/deadcode/index.rb#10 + # source://spoom/lib/spoom/deadcode/index.rb#23 sig { returns(T::Hash[::String, T::Array[::Spoom::Deadcode::Definition]]) } def definitions; end # Utils # - # source://spoom/lib/spoom/deadcode/index.rb#46 + # source://spoom/lib/spoom/deadcode/index.rb#214 sig { params(name: ::String).returns(T::Array[::Spoom::Deadcode::Definition]) } def definitions_for_name(name); end @@ -1626,324 +1589,111 @@ class Spoom::Deadcode::Index # # To be called once all the files have been indexed and all the definitions and references discovered. # - # source://spoom/lib/spoom/deadcode/index.rb#37 + # source://spoom/lib/spoom/deadcode/index.rb#122 sig { void } def finalize!; end - # source://spoom/lib/spoom/deadcode/index.rb#29 - sig { params(reference: ::Spoom::Deadcode::Reference).void } - def reference(reference); end + # source://spoom/lib/spoom/deadcode/index.rb#94 + sig { params(symbol_def: ::Spoom::Model::SymbolDef).void } + def ignore(symbol_def); end - # source://spoom/lib/spoom/deadcode/index.rb#13 - sig { returns(T::Hash[::String, T::Array[::Spoom::Deadcode::Reference]]) } + # source://spoom/lib/spoom/deadcode/index.rb#50 + sig { params(erb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_erb(erb, file:, plugins: T.unsafe(nil)); end + + # Indexing + # + # source://spoom/lib/spoom/deadcode/index.rb#39 + sig { params(file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_file(file, plugins: T.unsafe(nil)); end + + # source://spoom/lib/spoom/deadcode/index.rb#55 + sig { params(rb: ::String, file: ::String, plugins: T::Array[::Spoom::Deadcode::Plugins::Base]).void } + def index_ruby(rb, file:, plugins: T.unsafe(nil)); end + + # source://spoom/lib/spoom/deadcode/index.rb#20 + sig { returns(::Spoom::Model) } + def model; end + + # source://spoom/lib/spoom/deadcode/index.rb#84 + sig { params(name: ::String, location: ::Spoom::Location).void } + def reference_constant(name, location); end + + # source://spoom/lib/spoom/deadcode/index.rb#89 + sig { params(name: ::String, location: ::Spoom::Location).void } + def reference_method(name, location); end + + # source://spoom/lib/spoom/deadcode/index.rb#26 + sig { returns(T::Hash[::String, T::Array[::Spoom::Model::Reference]]) } def references; end end +# source://spoom/lib/spoom/deadcode/index.rb#9 +class Spoom::Deadcode::Index::Error < ::Spoom::Error + # source://spoom/lib/spoom/deadcode/index.rb#13 + sig { params(message: ::String, parent: ::Exception).void } + def initialize(message, parent:); end +end + # source://spoom/lib/spoom/deadcode/indexer.rb#6 -class Spoom::Deadcode::Indexer < ::Spoom::Deadcode::Visitor +class Spoom::Deadcode::Indexer < ::Spoom::Visitor # source://spoom/lib/spoom/deadcode/indexer.rb#16 sig do params( path: ::String, - source: ::String, index: ::Spoom::Deadcode::Index, plugins: T::Array[::Spoom::Deadcode::Plugins::Base] ).void end - def initialize(path, source, index, plugins: T.unsafe(nil)); end - - # Context - # - # source://spoom/lib/spoom/deadcode/indexer.rb#408 - sig { returns(::Prism::Node) } - def current_node; end - - # Definition indexing - # - # source://spoom/lib/spoom/deadcode/indexer.rb#322 - sig { params(name: ::String, full_name: ::String, node: ::Prism::Node).void } - def define_attr_reader(name, full_name, node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#334 - sig { params(name: ::String, full_name: ::String, node: ::Prism::Node).void } - def define_attr_writer(name, full_name, node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#346 - sig { params(name: ::String, full_name: ::String, node: ::Prism::Node).void } - def define_class(name, full_name, node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#358 - sig { params(name: ::String, full_name: ::String, node: ::Prism::Node).void } - def define_constant(name, full_name, node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#370 - sig { params(name: ::String, full_name: ::String, node: ::Prism::Node).void } - def define_method(name, full_name, node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#382 - sig { params(name: ::String, full_name: ::String, node: ::Prism::Node).void } - def define_module(name, full_name, node); end + def initialize(path, index, plugins: T.unsafe(nil)); end # source://spoom/lib/spoom/deadcode/indexer.rb#13 sig { returns(::Spoom::Deadcode::Index) } def index; end - # source://spoom/lib/spoom/deadcode/indexer.rb#453 - sig { returns(T.nilable(::String)) } - def last_sig; end - - # source://spoom/lib/spoom/deadcode/indexer.rb#427 - sig { returns(T.nilable(::Prism::BlockNode)) } - def nesting_block; end - - # source://spoom/lib/spoom/deadcode/indexer.rb#432 - sig { returns(T.nilable(::Prism::CallNode)) } - def nesting_call; end - - # source://spoom/lib/spoom/deadcode/indexer.rb#422 - sig { returns(T.nilable(::Prism::ClassNode)) } - def nesting_class; end - - # source://spoom/lib/spoom/deadcode/indexer.rb#437 - sig { returns(T.nilable(::String)) } - def nesting_class_name; end - - # source://spoom/lib/spoom/deadcode/indexer.rb#445 - sig { returns(T.nilable(::String)) } - def nesting_class_superclass_name; end - - # source://spoom/lib/spoom/deadcode/indexer.rb#413 - sig { type_parameters(:N).params(type: T::Class[T.type_parameter(:N)]).returns(T.nilable(T.type_parameter(:N))) } - def nesting_node(type); end - - # Node utils - # - # source://spoom/lib/spoom/deadcode/indexer.rb#464 - sig { params(node: ::Prism::Node).returns(::Spoom::Deadcode::Location) } - def node_location(node); end - # source://spoom/lib/spoom/deadcode/indexer.rb#10 sig { returns(::String) } def path; end - # Reference indexing - # - # source://spoom/lib/spoom/deadcode/indexer.rb#396 - sig { params(name: ::String, node: ::Prism::Node).void } - def reference_constant(name, node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#401 - sig { params(name: ::String, node: ::Prism::Node).void } - def reference_method(name, node); end - # Visit # - # source://spoom/lib/spoom/deadcode/indexer.rb#35 - sig { override.params(node: T.nilable(::Prism::Node)).void } - def visit(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#45 - sig { override.params(node: ::Prism::AliasMethodNode).void } - def visit_alias_method_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#50 - sig { override.params(node: ::Prism::AndNode).void } - def visit_and_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#56 - sig { override.params(node: ::Prism::BlockArgumentNode).void } - def visit_block_argument_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#67 - sig { override.params(node: ::Prism::CallAndWriteNode).void } - def visit_call_and_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#91 + # source://spoom/lib/spoom/deadcode/indexer.rb#27 sig { override.params(node: ::Prism::CallNode).void } def visit_call_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#75 - sig { override.params(node: ::Prism::CallOperatorWriteNode).void } - def visit_call_operator_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#83 - sig { override.params(node: ::Prism::CallOrWriteNode).void } - def visit_call_or_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#104 - sig { override.params(node: ::Prism::ClassNode).void } - def visit_class_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#137 - sig { override.params(node: ::Prism::ConstantAndWriteNode).void } - def visit_constant_and_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#143 - sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#149 - sig { override.params(node: ::Prism::ConstantOrWriteNode).void } - def visit_constant_or_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#155 - sig { override.params(node: ::Prism::ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#173 - sig { override.params(node: ::Prism::ConstantReadNode).void } - def visit_constant_read_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#178 - sig { override.params(node: ::Prism::ConstantWriteNode).void } - def visit_constant_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#186 - sig { override.params(node: ::Prism::DefNode).void } - def visit_def_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#194 - sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } - def visit_local_variable_and_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#202 - sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } - def visit_local_variable_operator_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#210 - sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } - def visit_local_variable_or_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#218 - sig { override.params(node: ::Prism::LocalVariableWriteNode).void } - def visit_local_variable_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#224 - sig { override.params(node: ::Prism::ModuleNode).void } - def visit_module_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#254 - sig { override.params(node: ::Prism::MultiWriteNode).void } - def visit_multi_write_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#268 - sig { override.params(node: ::Prism::OrNode).void } - def visit_or_node(node); end - - # source://spoom/lib/spoom/deadcode/indexer.rb#274 - sig { params(send: ::Spoom::Deadcode::Send).void } - def visit_send(send); end -end - -# source://spoom/lib/spoom/deadcode.rb#29 -class Spoom::Deadcode::IndexerError < ::Spoom::Deadcode::Error - # source://spoom/lib/spoom/deadcode.rb#33 - sig { params(message: ::String, parent: ::Exception).void } - def initialize(message, parent:); end -end - -# source://spoom/lib/spoom/deadcode/location.rb#6 -class Spoom::Deadcode::Location - include ::Comparable - - # source://spoom/lib/spoom/deadcode/location.rb#54 - sig do - params( - file: ::String, - start_line: ::Integer, - start_column: ::Integer, - end_line: ::Integer, - end_column: ::Integer - ).void - end - def initialize(file, start_line, start_column, end_line, end_column); end - - # source://spoom/lib/spoom/deadcode/location.rb#74 - sig { override.params(other: ::BasicObject).returns(T.nilable(::Integer)) } - def <=>(other); end - - # @return [Integer] - # - # source://spoom/lib/spoom/deadcode/location.rb#43 - def end_column; end - - # @return [Integer] - # - # source://spoom/lib/spoom/deadcode/location.rb#43 - def end_line; end - - # source://spoom/lib/spoom/deadcode/location.rb#40 - sig { returns(::String) } - def file; end - - # source://spoom/lib/spoom/deadcode/location.rb#63 - sig { params(other: ::Spoom::Deadcode::Location).returns(T::Boolean) } - def include?(other); end - - # @return [Integer] - # - # source://spoom/lib/spoom/deadcode/location.rb#43 - def start_column; end - - # source://spoom/lib/spoom/deadcode/location.rb#43 - sig { returns(::Integer) } - def start_line; end - - # source://spoom/lib/spoom/deadcode/location.rb#81 - sig { returns(::String) } - def to_s; end - - class << self - # source://spoom/lib/spoom/deadcode/location.rb#34 - sig { params(file: ::String, location: ::Prism::Location).returns(::Spoom::Deadcode::Location) } - def from_prism(file, location); end - - # @raise [LocationError] - # - # source://spoom/lib/spoom/deadcode/location.rb#17 - sig { params(location_string: ::String).returns(::Spoom::Deadcode::Location) } - def from_string(location_string); end - end end -# source://spoom/lib/spoom/deadcode/location.rb#11 -class Spoom::Deadcode::Location::LocationError < ::Spoom::Error; end - # source://spoom/lib/spoom/deadcode/plugins.rb#36 Spoom::Deadcode::PLUGINS_FOR_GEM = T.let(T.unsafe(nil), Hash) -# source://spoom/lib/spoom/deadcode.rb#27 -class Spoom::Deadcode::ParserError < ::Spoom::Deadcode::Error; end - # source://spoom/lib/spoom/deadcode/plugins/base.rb#8 module Spoom::Deadcode::Plugins; end # source://spoom/lib/spoom/deadcode/plugins/action_mailer.rb#7 class Spoom::Deadcode::Plugins::ActionMailer < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/action_mailer.rb#11 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def on_send(indexer, send); end + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end end # source://spoom/lib/spoom/deadcode/plugins/action_mailer_preview.rb#7 class Spoom::Deadcode::Plugins::ActionMailerPreview < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/action_mailer_preview.rb#13 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_method(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end end # source://spoom/lib/spoom/deadcode/plugins/actionpack.rb#7 class Spoom::Deadcode::Plugins::ActionPack < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/actionpack.rb#31 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_method(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end - # source://spoom/lib/spoom/deadcode/plugins/actionpack.rb#36 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def on_send(indexer, send); end + # source://spoom/lib/spoom/deadcode/plugins/actionpack.rb#39 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end end -# source://spoom/lib/spoom/deadcode/plugins/actionpack.rb#10 +# source://spoom/lib/spoom/deadcode/plugins/actionpack.rb#12 Spoom::Deadcode::Plugins::ActionPack::CALLBACKS = T.let(T.unsafe(nil), Array) # source://spoom/lib/spoom/deadcode/plugins/active_job.rb#7 @@ -1952,15 +1702,15 @@ class Spoom::Deadcode::Plugins::ActiveJob < ::Spoom::Deadcode::Plugins::Base; en # source://spoom/lib/spoom/deadcode/plugins/active_model.rb#7 class Spoom::Deadcode::Plugins::ActiveModel < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/active_model.rb#14 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def on_send(indexer, send); end + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end end # source://spoom/lib/spoom/deadcode/plugins/active_record.rb#7 class Spoom::Deadcode::Plugins::ActiveRecord < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/active_record.rb#74 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def on_send(indexer, send); end + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end end # source://spoom/lib/spoom/deadcode/plugins/active_record.rb#64 @@ -1975,8 +1725,8 @@ Spoom::Deadcode::Plugins::ActiveRecord::CRUD_METHODS = T.let(T.unsafe(nil), Arra # source://spoom/lib/spoom/deadcode/plugins/active_support.rb#7 class Spoom::Deadcode::Plugins::ActiveSupport < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/active_support.rb#22 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def on_send(indexer, send); end + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end end # source://spoom/lib/spoom/deadcode/plugins/active_support.rb#19 @@ -1988,41 +1738,43 @@ Spoom::Deadcode::Plugins::ActiveSupport::SETUP_AND_TEARDOWN_METHODS = T.let(T.un class Spoom::Deadcode::Plugins::Base abstract! + # source://spoom/lib/spoom/deadcode/plugins/base.rb#132 + sig { params(index: ::Spoom::Deadcode::Index).void } + def initialize(index); end + + # source://spoom/lib/spoom/deadcode/plugins/base.rb#129 + sig { returns(::Spoom::Deadcode::Index) } + def index; end + # Do not override this method, use `on_define_accessor` instead. # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#150 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def internal_on_define_accessor(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#158 + sig { params(definition: ::Spoom::Model::Attr).void } + def internal_on_define_accessor(definition); end # Do not override this method, use `on_define_class` instead. # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#174 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def internal_on_define_class(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#182 + sig { params(definition: ::Spoom::Model::Class).void } + def internal_on_define_class(definition); end # Do not override this method, use `on_define_constant` instead. # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#204 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def internal_on_define_constant(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#212 + sig { params(definition: ::Spoom::Model::Constant).void } + def internal_on_define_constant(definition); end # Do not override this method, use `on_define_method` instead. # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#232 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def internal_on_define_method(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#238 + sig { params(definition: ::Spoom::Model::Method).void } + def internal_on_define_method(definition); end # Do not override this method, use `on_define_module` instead. # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#258 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def internal_on_define_module(indexer, definition); end - - # Do not override this method, use `on_send` instead. - # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#284 - sig { params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def internal_on_send(indexer, send); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#264 + sig { params(definition: ::Spoom::Model::Module).void } + def internal_on_define_module(definition); end # Called when an accessor is defined. # @@ -2032,15 +1784,15 @@ class Spoom::Deadcode::Plugins::Base # # ~~~rb # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_accessor(indexer, definition) - # definition.ignored! if definition.name == "foo" + # def on_define_accessor(definition) + # @index.ignore(definition) if symbol_def.name == "foo" # end # end # ~~~ # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#144 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_accessor(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#152 + sig { params(definition: ::Spoom::Model::Attr).void } + def on_define_accessor(definition); end # Called when a class is defined. # @@ -2050,15 +1802,15 @@ class Spoom::Deadcode::Plugins::Base # # ~~~rb # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_class(indexer, definition) - # definition.ignored! if definition.name == "Foo" + # def on_define_class(definition) + # @index.ignore(definition) if definition.name == "Foo" # end # end # ~~~ # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#168 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_class(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#176 + sig { params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end # Called when a constant is defined. # @@ -2068,15 +1820,15 @@ class Spoom::Deadcode::Plugins::Base # # ~~~rb # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_constant(indexer, definition) - # definition.ignored! if definition.name == "FOO" + # def on_define_constant(definition) + # @index.ignore(definition) if definition.name == "FOO" # end # end # ~~~ # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#198 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_constant(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#206 + sig { params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end # Called when a method is defined. # @@ -2086,17 +1838,15 @@ class Spoom::Deadcode::Plugins::Base # # ~~~rb # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_method(indexer, definition) - # super # So the `ignore_method_names` DSL is still applied - # - # definition.ignored! if definition.name == "foo" + # def on_define_method(definition) + # @index.ignore(definition) if definition.name == "foo" # end # end # ~~~ # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#226 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_method(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#232 + sig { params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end # Called when a module is defined. # @@ -2106,76 +1856,80 @@ class Spoom::Deadcode::Plugins::Base # # ~~~rb # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_define_module(indexer, definition) - # definition.ignored! if definition.name == "Foo" + # def on_define_module(definition) + # @index.ignore(definition) if definition.name == "Foo" # end # end # ~~~ # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#252 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_module(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#258 + sig { params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end # Called when a send is being processed # # ~~~rb # class MyPlugin < Spoom::Deadcode::Plugins::Base - # def on_send(indexer, send) + # def on_send(send) # return unless send.name == "dsl_method" # return if send.args.empty? # # method_name = send.args.first.slice.delete_prefix(":") - # indexer.reference_method(method_name, send.node) + # @index.reference_method(method_name, send.node, send.loc) # end # end # ~~~ # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#278 - sig { params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def on_send(indexer, send); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#284 + sig { params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end private # Plugin utils # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#339 + # source://spoom/lib/spoom/deadcode/plugins/base.rb#352 sig { params(name: ::String).returns(::String) } def camelize(name); end - # DSL support - # - # source://spoom/lib/spoom/deadcode/plugins/base.rb#293 + # source://spoom/lib/spoom/deadcode/plugins/base.rb#301 sig { params(name: T.nilable(::String)).returns(T::Boolean) } def ignored_class_name?(name); end - # source://spoom/lib/spoom/deadcode/plugins/base.rb#307 + # source://spoom/lib/spoom/deadcode/plugins/base.rb#320 sig { params(name: ::String).returns(T::Boolean) } def ignored_constant_name?(name); end - # source://spoom/lib/spoom/deadcode/plugins/base.rb#312 + # source://spoom/lib/spoom/deadcode/plugins/base.rb#325 sig { params(name: ::String).returns(T::Boolean) } def ignored_method_name?(name); end - # source://spoom/lib/spoom/deadcode/plugins/base.rb#317 + # source://spoom/lib/spoom/deadcode/plugins/base.rb#330 sig { params(name: ::String).returns(T::Boolean) } def ignored_module_name?(name); end - # source://spoom/lib/spoom/deadcode/plugins/base.rb#322 + # source://spoom/lib/spoom/deadcode/plugins/base.rb#335 sig { params(name: ::String, names_variable: ::Symbol, patterns_variable: ::Symbol).returns(T::Boolean) } def ignored_name?(name, names_variable, patterns_variable); end - # source://spoom/lib/spoom/deadcode/plugins/base.rb#300 - sig { params(superclass_name: T.nilable(::String)).returns(T::Boolean) } - def ignored_subclass?(superclass_name); end + # source://spoom/lib/spoom/deadcode/plugins/base.rb#308 + sig { params(definition: ::Spoom::Model::Class).returns(T::Boolean) } + def ignored_subclass?(definition); end - # source://spoom/lib/spoom/deadcode/plugins/base.rb#327 + # source://spoom/lib/spoom/deadcode/plugins/base.rb#340 sig { params(const: ::Symbol).returns(T::Set[::String]) } def names(const); end - # source://spoom/lib/spoom/deadcode/plugins/base.rb#332 + # source://spoom/lib/spoom/deadcode/plugins/base.rb#345 sig { params(const: ::Symbol).returns(T::Array[::Regexp]) } def patterns(const); end + # DSL support + # + # source://spoom/lib/spoom/deadcode/plugins/base.rb#293 + sig { params(definition: ::Spoom::Model::Namespace, superclass_name: ::String).returns(T::Boolean) } + def subclass_of?(definition, superclass_name); end + class << self # Mark classes directly subclassing a class matching `names` as ignored. # @@ -2284,32 +2038,36 @@ end # source://spoom/lib/spoom/deadcode/plugins/graphql.rb#7 class Spoom::Deadcode::Plugins::GraphQL < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/graphql.rb#28 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def on_send(indexer, send); end + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end end # source://spoom/lib/spoom/deadcode/plugins/minitest.rb#7 class Spoom::Deadcode::Plugins::Minitest < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/minitest.rb#22 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_method(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end + + # source://spoom/lib/spoom/deadcode/plugins/minitest.rb#28 + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end end # source://spoom/lib/spoom/deadcode/plugins/namespaces.rb#7 class Spoom::Deadcode::Plugins::Namespaces < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/namespaces.rb#11 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_class(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end # source://spoom/lib/spoom/deadcode/plugins/namespaces.rb#16 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_module(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end private # source://spoom/lib/spoom/deadcode/plugins/namespaces.rb#23 - sig { params(indexer: ::Spoom::Deadcode::Indexer).returns(T::Boolean) } - def used_as_namespace?(indexer); end + sig { params(symbol_def: ::Spoom::Model::Namespace).returns(T::Boolean) } + def used_as_namespace?(symbol_def); end end # source://spoom/lib/spoom/deadcode/plugins/rspec.rb#7 @@ -2318,18 +2076,18 @@ class Spoom::Deadcode::Plugins::RSpec < ::Spoom::Deadcode::Plugins::Base; end # source://spoom/lib/spoom/deadcode/plugins/rails.rb#7 class Spoom::Deadcode::Plugins::Rails < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/rails.rb#13 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_class(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Class).void } + def on_define_class(definition); end # source://spoom/lib/spoom/deadcode/plugins/rails.rb#18 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_module(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Module).void } + def on_define_module(definition); end private # source://spoom/lib/spoom/deadcode/plugins/rails.rb#25 - sig { params(indexer: ::Spoom::Deadcode::Indexer).returns(T::Boolean) } - def file_is_helper?(indexer); end + sig { params(symbol_def: ::Spoom::Model::Namespace).returns(T::Boolean) } + def file_is_helper?(symbol_def); end end # source://spoom/lib/spoom/deadcode/plugins/rake.rb#7 @@ -2338,22 +2096,12 @@ class Spoom::Deadcode::Plugins::Rake < ::Spoom::Deadcode::Plugins::Base; end # source://spoom/lib/spoom/deadcode/plugins/rubocop.rb#7 class Spoom::Deadcode::Plugins::Rubocop < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/rubocop.rb#18 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_constant(indexer, definition); end - - # source://spoom/lib/spoom/deadcode/plugins/rubocop.rb#23 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_method(indexer, definition); end - - private + sig { override.params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end - # source://spoom/lib/spoom/deadcode/plugins/rubocop.rb#30 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).returns(T::Boolean) } - def rubocop_constant?(indexer, definition); end - - # source://spoom/lib/spoom/deadcode/plugins/rubocop.rb#35 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).returns(T::Boolean) } - def rubocop_method?(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/rubocop.rb#26 + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end end # source://spoom/lib/spoom/deadcode/plugins/rubocop.rb#10 @@ -2362,74 +2110,42 @@ Spoom::Deadcode::Plugins::Rubocop::RUBOCOP_CONSTANTS = T.let(T.unsafe(nil), Set) # source://spoom/lib/spoom/deadcode/plugins/ruby.rb#7 class Spoom::Deadcode::Plugins::Ruby < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/ruby.rb#24 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send).void } - def on_send(indexer, send); end + sig { override.params(send: ::Spoom::Deadcode::Send).void } + def on_send(send); end private - # source://spoom/lib/spoom/deadcode/plugins/ruby.rb#43 - sig { params(indexer: ::Spoom::Deadcode::Indexer, send: ::Spoom::Deadcode::Send, node: ::Prism::Node).void } - def reference_symbol_as_constant(indexer, send, node); end + # source://spoom/lib/spoom/deadcode/plugins/ruby.rb#46 + sig { params(send: ::Spoom::Deadcode::Send, node: ::Prism::Node).void } + def reference_symbol_as_constant(send, node); end end # source://spoom/lib/spoom/deadcode/plugins/sorbet.rb#7 class Spoom::Deadcode::Plugins::Sorbet < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/sorbet.rb#11 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_constant(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Constant).void } + def on_define_constant(definition); end # source://spoom/lib/spoom/deadcode/plugins/sorbet.rb#16 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_method(indexer, definition); end + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end private - # source://spoom/lib/spoom/deadcode/plugins/sorbet.rb#34 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).returns(T::Boolean) } - def sorbet_enum_constant?(indexer, definition); end + # source://spoom/lib/spoom/deadcode/plugins/sorbet.rb#28 + sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } + def sorbet_enum_constant?(definition); end # source://spoom/lib/spoom/deadcode/plugins/sorbet.rb#23 - sig { params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).returns(T::Boolean) } - def sorbet_type_member?(indexer, definition); end + sig { params(definition: ::Spoom::Model::Constant).returns(T::Boolean) } + def sorbet_type_member?(definition); end end # source://spoom/lib/spoom/deadcode/plugins/thor.rb#7 class Spoom::Deadcode::Plugins::Thor < ::Spoom::Deadcode::Plugins::Base # source://spoom/lib/spoom/deadcode/plugins/thor.rb#13 - sig { override.params(indexer: ::Spoom::Deadcode::Indexer, definition: ::Spoom::Deadcode::Definition).void } - def on_define_method(indexer, definition); end -end - -# A reference is a call to a method or a constant -# -# source://spoom/lib/spoom/deadcode/reference.rb#7 -class Spoom::Deadcode::Reference < ::T::Struct - const :kind, ::Spoom::Deadcode::Reference::Kind - const :name, ::String - const :location, ::Spoom::Deadcode::Location - - # Kind - # - # source://spoom/lib/spoom/deadcode/reference.rb#24 - sig { returns(T::Boolean) } - def constant?; end - - # source://spoom/lib/spoom/deadcode/reference.rb#29 - sig { returns(T::Boolean) } - def method?; end - - class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end - end -end - -# source://spoom/lib/spoom/deadcode/reference.rb#10 -class Spoom::Deadcode::Reference::Kind < ::T::Enum - enums do - Constant = new - Method = new - end + sig { override.params(definition: ::Spoom::Model::Method).void } + def on_define_method(definition); end end # source://spoom/lib/spoom/deadcode/remover.rb#6 @@ -2439,12 +2155,7 @@ class Spoom::Deadcode::Remover def initialize(context); end # source://spoom/lib/spoom/deadcode/remover.rb#17 - sig do - params( - kind: T.nilable(::Spoom::Deadcode::Definition::Kind), - location: ::Spoom::Deadcode::Location - ).returns(::String) - end + sig { params(kind: T.nilable(::Spoom::Deadcode::Definition::Kind), location: ::Spoom::Location).returns(::String) } def remove_location(kind, location); end end @@ -2497,6 +2208,8 @@ class Spoom::Deadcode::Remover::NodeContext sig { returns(T.nilable(::Prism::Node)) } def next_node; end + # @raise [Error] + # # source://spoom/lib/spoom/deadcode/remover.rb#433 sig { returns(T::Array[::Prism::Node]) } def next_nodes; end @@ -2505,10 +2218,14 @@ class Spoom::Deadcode::Remover::NodeContext sig { returns(::Prism::Node) } def node; end + # @raise [Error] + # # source://spoom/lib/spoom/deadcode/remover.rb#408 sig { returns(::Spoom::Deadcode::Remover::NodeContext) } def parent_context; end + # @raise [Error] + # # source://spoom/lib/spoom/deadcode/remover.rb#400 sig { returns(::Prism::Node) } def parent_node; end @@ -2517,6 +2234,8 @@ class Spoom::Deadcode::Remover::NodeContext sig { returns(T.nilable(::Prism::Node)) } def previous_node; end + # @raise [Error] + # # source://spoom/lib/spoom/deadcode/remover.rb#417 sig { returns(T::Array[::Prism::Node]) } def previous_nodes; end @@ -2535,10 +2254,10 @@ class Spoom::Deadcode::Remover::NodeContext end # source://spoom/lib/spoom/deadcode/remover.rb#549 -class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Deadcode::Visitor +class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Visitor # source://spoom/lib/spoom/deadcode/remover.rb#621 - sig { params(location: ::Spoom::Deadcode::Location).void } - def initialize(location); end + sig { params(location: ::Spoom::Location, kind: T.nilable(::Spoom::Deadcode::Definition::Kind)).void } + def initialize(location, kind); end # source://spoom/lib/spoom/deadcode/remover.rb#615 sig { returns(T.nilable(::Prism::Node)) } @@ -2548,7 +2267,7 @@ class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Deadcode::Visitor sig { returns(T::Array[::Prism::Node]) } def nodes_nesting; end - # source://spoom/lib/spoom/deadcode/remover.rb#629 + # source://spoom/lib/spoom/deadcode/remover.rb#630 sig { override.params(node: T.nilable(::Prism::Node)).void } def visit(node); end @@ -2557,7 +2276,7 @@ class Spoom::Deadcode::Remover::NodeFinder < ::Spoom::Deadcode::Visitor sig do params( source: ::String, - location: ::Spoom::Deadcode::Location, + location: ::Spoom::Location, kind: T.nilable(::Spoom::Deadcode::Definition::Kind) ).returns(::Spoom::Deadcode::Remover::NodeContext) end @@ -2576,7 +2295,7 @@ class Spoom::Deadcode::Remover::NodeRemover params( source: ::String, kind: T.nilable(::Spoom::Deadcode::Definition::Kind), - location: ::Spoom::Deadcode::Location + location: ::Spoom::Location ).void end def initialize(source, kind, location); end @@ -2645,8 +2364,9 @@ class Spoom::Deadcode::Send < ::T::Struct const :recv, T.nilable(::Prism::Node), default: T.unsafe(nil) const :args, T::Array[::Prism::Node], default: T.unsafe(nil) const :block, T.nilable(::Prism::Node), default: T.unsafe(nil) + const :location, ::Spoom::Location - # source://spoom/lib/spoom/deadcode/send.rb#21 + # source://spoom/lib/spoom/deadcode/send.rb#22 sig do type_parameters(:T) .params( @@ -2656,1779 +2376,2570 @@ class Spoom::Deadcode::Send < ::T::Struct end def each_arg(arg_type, &block); end - # source://spoom/lib/spoom/deadcode/send.rb#28 + # source://spoom/lib/spoom/deadcode/send.rb#29 sig { params(block: T.proc.params(key: ::Prism::Node, value: T.nilable(::Prism::Node)).void).void } def each_arg_assoc(&block); end class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end -# source://spoom/lib/spoom/deadcode/visitor.rb#6 -class Spoom::Deadcode::Visitor < ::Prism::Visitor - # source://spoom/lib/spoom/deadcode/visitor.rb#15 - sig { override.params(node: ::Prism::AliasGlobalVariableNode).void } - def visit_alias_global_variable_node(node); end +# source://spoom/lib/spoom.rb#12 +class Spoom::Error < ::StandardError; end - # source://spoom/lib/spoom/deadcode/visitor.rb#20 - sig { override.params(node: ::Prism::AliasMethodNode).void } - def visit_alias_method_node(node); end +# source://spoom/lib/spoom/context/exec.rb#5 +class Spoom::ExecResult < ::T::Struct + const :out, ::String + const :err, T.nilable(::String) + const :status, T::Boolean + const :exit_code, ::Integer + + # source://spoom/lib/spoom/context/exec.rb#14 + sig { returns(::String) } + def to_s; end + + class << self + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom/lib/spoom/file_collector.rb#5 +class Spoom::FileCollector + # Initialize a new file collector + # + # If `allow_extensions` is empty, all files are collected. + # If `allow_extensions` is an array of extensions, only files with one of these extensions are collected. + # + # If `allow_mime_types` is empty, all files are collected. + # If `allow_mime_types` is an array of mimetypes, files without an extension are collected if their mimetype is in + # the list. + # + # source://spoom/lib/spoom/file_collector.rb#26 + sig do + params( + allow_extensions: T::Array[::String], + allow_mime_types: T::Array[::String], + exclude_patterns: T::Array[::String] + ).void + end + def initialize(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + + # source://spoom/lib/spoom/file_collector.rb#9 + sig { returns(T::Array[::String]) } + def files; end + + # source://spoom/lib/spoom/file_collector.rb#39 + sig { params(path: ::String).void } + def visit_path(path); end + + # source://spoom/lib/spoom/file_collector.rb#34 + sig { params(paths: T::Array[::String]).void } + def visit_paths(paths); end + + private + + # source://spoom/lib/spoom/file_collector.rb#56 + sig { params(path: ::String).returns(::String) } + def clean_path(path); end + + # source://spoom/lib/spoom/file_collector.rb#73 + sig { params(path: ::String).returns(T::Boolean) } + def excluded_file?(path); end + + # source://spoom/lib/spoom/file_collector.rb#88 + sig { params(path: ::String).returns(T::Boolean) } + def excluded_path?(path); end + + # source://spoom/lib/spoom/file_collector.rb#97 + sig { params(path: ::String).returns(T.nilable(::String)) } + def mime_type_for(path); end + + # source://spoom/lib/spoom/file_collector.rb#68 + sig { params(path: ::String).void } + def visit_directory(path); end + + # source://spoom/lib/spoom/file_collector.rb#61 + sig { params(path: ::String).void } + def visit_file(path); end +end + +# Build a file hierarchy from a set of file paths. +# +# source://spoom/lib/spoom/file_tree.rb#6 +class Spoom::FileTree + # source://spoom/lib/spoom/file_tree.rb#10 + sig { params(paths: T::Enumerable[::String]).void } + def initialize(paths = T.unsafe(nil)); end + + # Add a `path` to the tree + # + # This will create all nodes until the root of `path`. + # + # source://spoom/lib/spoom/file_tree.rb#25 + sig { params(path: ::String).returns(::Spoom::FileTree::Node) } + def add_path(path); end + + # Add all `paths` to the tree + # + # source://spoom/lib/spoom/file_tree.rb#17 + sig { params(paths: T::Enumerable[::String]).void } + def add_paths(paths); end + + # All the nodes in this tree + # + # source://spoom/lib/spoom/file_tree.rb#45 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def nodes; end + + # Return a map of typing scores for each node in the tree + # + # source://spoom/lib/spoom/file_tree.rb#59 + sig { params(context: ::Spoom::Context).returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } + def nodes_strictness_scores(context); end + + # All the paths in this tree + # + # source://spoom/lib/spoom/file_tree.rb#53 + sig { returns(T::Array[::String]) } + def paths; end + + # Return a map of typing scores for each path in the tree + # + # source://spoom/lib/spoom/file_tree.rb#67 + sig { params(context: ::Spoom::Context).returns(T::Hash[::String, ::Float]) } + def paths_strictness_scores(context); end + + # source://spoom/lib/spoom/file_tree.rb#72 + sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean).void } + def print(out: T.unsafe(nil), colors: T.unsafe(nil)); end + + # All root nodes + # + # source://spoom/lib/spoom/file_tree.rb#39 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def roots; end +end + +# A visitor that collects all the nodes in a tree +# +# source://spoom/lib/spoom/file_tree.rb#124 +class Spoom::FileTree::CollectNodes < ::Spoom::FileTree::Visitor + # source://spoom/lib/spoom/file_tree.rb#131 + sig { void } + def initialize; end + + # source://spoom/lib/spoom/file_tree.rb#128 + sig { returns(T::Array[::Spoom::FileTree::Node]) } + def nodes; end + + # source://spoom/lib/spoom/file_tree.rb#137 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end +end + +# A visitor that collects the typing score of each node in a tree +# +# source://spoom/lib/spoom/file_tree.rb#167 +class Spoom::FileTree::CollectScores < ::Spoom::FileTree::CollectStrictnesses + # source://spoom/lib/spoom/file_tree.rb#174 + sig { params(context: ::Spoom::Context).void } + def initialize(context); end + + # source://spoom/lib/spoom/file_tree.rb#171 + sig { returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } + def scores; end + + # source://spoom/lib/spoom/file_tree.rb#181 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + private + + # source://spoom/lib/spoom/file_tree.rb#190 + sig { params(node: ::Spoom::FileTree::Node).returns(::Float) } + def node_score(node); end + + # source://spoom/lib/spoom/file_tree.rb#199 + sig { params(strictness: T.nilable(::String)).returns(::Float) } + def strictness_score(strictness); end +end + +# A visitor that collects the strictness of each node in a tree +# +# source://spoom/lib/spoom/file_tree.rb#144 +class Spoom::FileTree::CollectStrictnesses < ::Spoom::FileTree::Visitor + # source://spoom/lib/spoom/file_tree.rb#151 + sig { params(context: ::Spoom::Context).void } + def initialize(context); end + + # source://spoom/lib/spoom/file_tree.rb#148 + sig { returns(T::Hash[::Spoom::FileTree::Node, T.nilable(::String)]) } + def strictnesses; end + + # source://spoom/lib/spoom/file_tree.rb#158 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end +end + +# A node representing either a file or a directory inside a FileTree +# +# source://spoom/lib/spoom/file_tree.rb#78 +class Spoom::FileTree::Node < ::T::Struct + const :parent, T.nilable(::Spoom::FileTree::Node) + const :name, ::String + const :children, T::Hash[::String, ::Spoom::FileTree::Node], default: T.unsafe(nil) + + # Full path to this node from root + # + # source://spoom/lib/spoom/file_tree.rb#92 + sig { returns(::String) } + def path; end + + class << self + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end + +# An internal class used to print a FileTree +# +# See `FileTree#print` +# +# source://spoom/lib/spoom/file_tree.rb#212 +class Spoom::FileTree::Printer < ::Spoom::FileTree::Visitor + # source://spoom/lib/spoom/file_tree.rb#222 + sig do + params( + strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], + out: T.any(::IO, ::StringIO), + colors: T::Boolean + ).void + end + def initialize(strictnesses, out: T.unsafe(nil), colors: T.unsafe(nil)); end + + # source://spoom/lib/spoom/file_tree.rb#230 + sig { override.params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + private + + # source://spoom/lib/spoom/file_tree.rb#255 + sig { params(strictness: T.nilable(::String)).returns(::Spoom::Color) } + def strictness_color(strictness); end +end + +# An abstract visitor for FileTree +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom/lib/spoom/file_tree.rb#101 +class Spoom::FileTree::Visitor + abstract! + + # source://spoom/lib/spoom/file_tree.rb#113 + sig { params(node: ::Spoom::FileTree::Node).void } + def visit_node(node); end + + # source://spoom/lib/spoom/file_tree.rb#118 + sig { params(nodes: T::Array[::Spoom::FileTree::Node]).void } + def visit_nodes(nodes); end + + # source://spoom/lib/spoom/file_tree.rb#108 + sig { params(tree: ::Spoom::FileTree).void } + def visit_tree(tree); end +end + +# source://spoom/lib/spoom/context/git.rb#5 +module Spoom::Git; end + +# source://spoom/lib/spoom/context/git.rb#6 +class Spoom::Git::Commit < ::T::Struct + const :sha, ::String + const :time, ::Time + + # source://spoom/lib/spoom/context/git.rb#27 + sig { returns(::Integer) } + def timestamp; end + + class << self + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + + # Parse a line formatted as `%h %at` into a `Commit` + # + # source://spoom/lib/spoom/context/git.rb#14 + sig { params(string: ::String).returns(T.nilable(::Spoom::Git::Commit)) } + def parse_line(string); end + end +end + +# source://spoom/lib/spoom/sorbet/lsp/base.rb#5 +module Spoom::LSP; end + +# source://spoom/lib/spoom/sorbet/lsp.rb#13 +class Spoom::LSP::Client + # source://spoom/lib/spoom/sorbet/lsp.rb#17 + sig { params(sorbet_bin: ::String, sorbet_args: ::String, path: ::String).void } + def initialize(sorbet_bin, *sorbet_args, path: T.unsafe(nil)); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#229 + sig { void } + def close; end + + # source://spoom/lib/spoom/sorbet/lsp.rb#131 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } + def definitions(uri, line, column); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#212 + sig { params(uri: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } + def document_symbols(uri); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#89 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T.nilable(::Spoom::LSP::Hover)) } + def hover(uri, line, column); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#27 + sig { returns(::Integer) } + def next_id; end + + # LSP requests + # + # @raise [Error::AlreadyOpen] + # + # source://spoom/lib/spoom/sorbet/lsp.rb#72 + sig { params(workspace_path: ::String).void } + def open(workspace_path); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#54 + sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) } + def read; end + + # @raise [Error::BadHeaders] + # + # source://spoom/lib/spoom/sorbet/lsp.rb#43 + sig { returns(T.nilable(::String)) } + def read_raw; end + + # source://spoom/lib/spoom/sorbet/lsp.rb#173 + sig do + params( + uri: ::String, + line: ::Integer, + column: ::Integer, + include_decl: T::Boolean + ).returns(T::Array[::Spoom::LSP::Location]) + end + def references(uri, line, column, include_decl = T.unsafe(nil)); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#37 + sig { params(message: ::Spoom::LSP::Message).returns(T.nilable(T::Hash[T.untyped, T.untyped])) } + def send(message); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#32 + sig { params(json_string: ::String).void } + def send_raw(json_string); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#110 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::SignatureHelp]) } + def signatures(uri, line, column); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#197 + sig { params(query: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } + def symbols(query); end + + # source://spoom/lib/spoom/sorbet/lsp.rb#152 + sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } + def type_definitions(uri, line, column); end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#178 +class Spoom::LSP::Diagnostic < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :range, ::Spoom::LSP::Range + const :code, ::Integer + const :message, ::String + const :information, ::Object + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#202 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#207 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#191 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#212 +class Spoom::LSP::DocumentSymbol < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :name, ::String + const :detail, T.nilable(::String) + const :kind, ::Integer + const :location, T.nilable(::Spoom::LSP::Location) + const :range, T.nilable(::Spoom::LSP::Range) + const :children, T::Array[::Spoom::LSP::DocumentSymbol] + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#240 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#272 + sig { returns(::String) } + def kind_string; end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#267 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#227 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#276 +Spoom::LSP::DocumentSymbol::SYMBOL_KINDS = T.let(T.unsafe(nil), Hash) + +# source://spoom/lib/spoom/sorbet/lsp/errors.rb#6 +class Spoom::LSP::Error < ::Spoom::Error; end + +# source://spoom/lib/spoom/sorbet/lsp/errors.rb#7 +class Spoom::LSP::Error::AlreadyOpen < ::Spoom::LSP::Error; end + +# source://spoom/lib/spoom/sorbet/lsp/errors.rb#8 +class Spoom::LSP::Error::BadHeaders < ::Spoom::LSP::Error; end + +# source://spoom/lib/spoom/sorbet/lsp/errors.rb#10 +class Spoom::LSP::Error::Diagnostics < ::Spoom::LSP::Error + # source://spoom/lib/spoom/sorbet/lsp/errors.rb#32 + sig { params(uri: ::String, diagnostics: T::Array[::Spoom::LSP::Diagnostic]).void } + def initialize(uri, diagnostics); end + + # source://spoom/lib/spoom/sorbet/lsp/errors.rb#17 + sig { returns(T::Array[::Spoom::LSP::Diagnostic]) } + def diagnostics; end + + # source://spoom/lib/spoom/sorbet/lsp/errors.rb#14 + sig { returns(::String) } + def uri; end + + class << self + # source://spoom/lib/spoom/sorbet/lsp/errors.rb#23 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Error::Diagnostics) } + def from_json(json); end + end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#19 +class Spoom::LSP::Hover < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :contents, ::String + const :range, T.nilable(T::Range[T.untyped]) + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#39 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#45 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#30 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#112 +class Spoom::LSP::Location < ::T::Struct + include ::Spoom::LSP::PrintableSymbol - # source://spoom/lib/spoom/deadcode/visitor.rb#25 - sig { override.params(node: ::Prism::AlternationPatternNode).void } - def visit_alternation_pattern_node(node); end + const :uri, ::String + const :range, ::Spoom::LSP::Range - # source://spoom/lib/spoom/deadcode/visitor.rb#30 - sig { override.params(node: ::Prism::AndNode).void } - def visit_and_node(node); end + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#132 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end - # source://spoom/lib/spoom/deadcode/visitor.rb#35 - sig { override.params(node: ::Prism::ArgumentsNode).void } - def visit_arguments_node(node); end + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#138 + sig { returns(::String) } + def to_s; end - # source://spoom/lib/spoom/deadcode/visitor.rb#40 - sig { override.params(node: ::Prism::ArrayNode).void } - def visit_array_node(node); end + class << self + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#123 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } + def from_json(json); end - # source://spoom/lib/spoom/deadcode/visitor.rb#45 - sig { override.params(node: ::Prism::ArrayPatternNode).void } - def visit_array_pattern_node(node); end + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#50 - sig { override.params(node: ::Prism::AssocNode).void } - def visit_assoc_node(node); end +# A general message as defined by JSON-RPC. +# +# The language server protocol always uses `"2.0"` as the `jsonrpc` version. +# +# source://spoom/lib/spoom/sorbet/lsp/base.rb#12 +class Spoom::LSP::Message + # source://spoom/lib/spoom/sorbet/lsp/base.rb#16 + sig { void } + def initialize; end + + # source://spoom/lib/spoom/sorbet/lsp/base.rb#21 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def as_json; end + + # source://spoom/lib/spoom/sorbet/lsp/base.rb#29 + sig { params(args: T.untyped).returns(::String) } + def to_json(*args); end +end + +# A notification message. +# +# A processed notification message must not send a response back. They work like events. +# +# source://spoom/lib/spoom/sorbet/lsp/base.rb#58 +class Spoom::LSP::Notification < ::Spoom::LSP::Message + # source://spoom/lib/spoom/sorbet/lsp/base.rb#68 + sig { params(method: ::String, params: T::Hash[T.untyped, T.untyped]).void } + def initialize(method, params); end + + # source://spoom/lib/spoom/sorbet/lsp/base.rb#62 + sig { returns(::String) } + def method; end + + # source://spoom/lib/spoom/sorbet/lsp/base.rb#65 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def params; end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#50 +class Spoom::LSP::Position < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :line, ::Integer + const :char, ::Integer + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#70 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#75 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#61 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end + +# @abstract Subclasses must implement the `abstract` methods below. +# +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#9 +module Spoom::LSP::PrintableSymbol + interface! + + # @abstract + # + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#16 + sig { abstract.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#80 +class Spoom::LSP::Range < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :start, ::Spoom::LSP::Position + const :end, ::Spoom::LSP::Position + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#100 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#107 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#91 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end + +# A request message to describe a request between the client and the server. +# +# Every processed request must send a response back to the sender of the request. +# +# source://spoom/lib/spoom/sorbet/lsp/base.rb#37 +class Spoom::LSP::Request < ::Spoom::LSP::Message + # source://spoom/lib/spoom/sorbet/lsp/base.rb#47 + sig { params(id: ::Integer, method: ::String, params: T::Hash[T.untyped, T.untyped]).void } + def initialize(id, method, params); end + + # source://spoom/lib/spoom/sorbet/lsp/base.rb#41 + sig { returns(::Integer) } + def id; end + + # source://spoom/lib/spoom/sorbet/lsp/base.rb#44 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def params; end +end + +# source://spoom/lib/spoom/sorbet/lsp/errors.rb#40 +class Spoom::LSP::ResponseError < ::Spoom::LSP::Error + # source://spoom/lib/spoom/sorbet/lsp/errors.rb#63 + sig { params(code: ::Integer, message: ::String, data: T::Hash[T.untyped, T.untyped]).void } + def initialize(code, message, data); end + + # source://spoom/lib/spoom/sorbet/lsp/errors.rb#44 + sig { returns(::Integer) } + def code; end + + # source://spoom/lib/spoom/sorbet/lsp/errors.rb#47 + sig { returns(T::Hash[T.untyped, T.untyped]) } + def data; end + + class << self + # source://spoom/lib/spoom/sorbet/lsp/errors.rb#53 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::ResponseError) } + def from_json(json); end + end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#143 +class Spoom::LSP::SignatureHelp < ::T::Struct + include ::Spoom::LSP::PrintableSymbol + + const :label, T.nilable(::String) + const :doc, ::Object + const :params, T::Array[T.untyped] + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#165 + sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } + def accept_printer(printer); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#173 + sig { returns(::String) } + def to_s; end + + class << self + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#155 + sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } + def from_json(json); end + + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end + end +end + +# source://spoom/lib/spoom/sorbet/lsp/structures.rb#309 +class Spoom::LSP::SymbolPrinter < ::Spoom::Printer + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#326 + sig do + params( + out: T.any(::IO, ::StringIO), + colors: T::Boolean, + indent_level: ::Integer, + prefix: T.nilable(::String) + ).void + end + def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil), prefix: T.unsafe(nil)); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#348 + sig { params(uri: ::String).returns(::String) } + def clean_uri(uri); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#316 + sig { returns(T.nilable(::String)) } + def prefix; end + + # @return [String, nil] + # + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#316 + def prefix=(_arg0); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#356 + sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } + def print_list(objects); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#336 + sig { params(object: T.nilable(::Spoom::LSP::PrintableSymbol)).void } + def print_object(object); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#343 + sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } + def print_objects(objects); end + + # source://spoom/lib/spoom/sorbet/lsp/structures.rb#313 + sig { returns(T::Set[::Integer]) } + def seen; end +end + +# source://spoom/lib/spoom/location.rb#5 +class Spoom::Location + include ::Comparable + + # @raise [LocationError] + # + # source://spoom/lib/spoom/location.rb#73 + sig do + params( + file: ::String, + start_line: T.nilable(::Integer), + start_column: T.nilable(::Integer), + end_line: T.nilable(::Integer), + end_column: T.nilable(::Integer) + ).void + end + def initialize(file, start_line: T.unsafe(nil), start_column: T.unsafe(nil), end_line: T.unsafe(nil), end_column: T.unsafe(nil)); end + + # source://spoom/lib/spoom/location.rb#106 + sig { override.params(other: ::BasicObject).returns(T.nilable(::Integer)) } + def <=>(other); end + + # @return [Integer, nil] + # + # source://spoom/lib/spoom/location.rb#62 + def end_column; end + + # @return [Integer, nil] + # + # source://spoom/lib/spoom/location.rb#62 + def end_line; end + + # source://spoom/lib/spoom/location.rb#59 + sig { returns(::String) } + def file; end - # source://spoom/lib/spoom/deadcode/visitor.rb#55 - sig { override.params(node: ::Prism::AssocSplatNode).void } - def visit_assoc_splat_node(node); end + # source://spoom/lib/spoom/location.rb#93 + sig { params(other: ::Spoom::Location).returns(T::Boolean) } + def include?(other); end - # source://spoom/lib/spoom/deadcode/visitor.rb#60 - sig { override.params(node: ::Prism::BackReferenceReadNode).void } - def visit_back_reference_read_node(node); end + # @return [Integer, nil] + # + # source://spoom/lib/spoom/location.rb#62 + def start_column; end - # source://spoom/lib/spoom/deadcode/visitor.rb#65 - sig { override.params(node: ::Prism::BeginNode).void } - def visit_begin_node(node); end + # source://spoom/lib/spoom/location.rb#62 + sig { returns(T.nilable(::Integer)) } + def start_line; end - # source://spoom/lib/spoom/deadcode/visitor.rb#70 - sig { override.params(node: ::Prism::BlockArgumentNode).void } - def visit_block_argument_node(node); end + # source://spoom/lib/spoom/location.rb#129 + sig { returns(::String) } + def to_s; end - # source://spoom/lib/spoom/deadcode/visitor.rb#75 - sig { override.params(node: ::Prism::BlockLocalVariableNode).void } - def visit_block_local_variable_node(node); end + class << self + # source://spoom/lib/spoom/location.rb#47 + sig { params(file: ::String, location: ::Prism::Location).returns(::Spoom::Location) } + def from_prism(file, location); end - # source://spoom/lib/spoom/deadcode/visitor.rb#80 - sig { override.params(node: ::Prism::BlockNode).void } - def visit_block_node(node); end + # @raise [LocationError] + # + # source://spoom/lib/spoom/location.rb#16 + sig { params(location_string: ::String).returns(::Spoom::Location) } + def from_string(location_string); end + end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#85 - sig { override.params(node: ::Prism::BlockParameterNode).void } - def visit_block_parameter_node(node); end +# source://spoom/lib/spoom/location.rb#10 +class Spoom::Location::LocationError < ::Spoom::Error; end - # source://spoom/lib/spoom/deadcode/visitor.rb#90 - sig { override.params(node: ::Prism::BlockParametersNode).void } - def visit_block_parameters_node(node); end +# source://spoom/lib/spoom/model/model.rb#5 +class Spoom::Model + # source://spoom/lib/spoom/model/model.rb#238 + sig { void } + def initialize; end - # source://spoom/lib/spoom/deadcode/visitor.rb#95 - sig { override.params(node: ::Prism::BreakNode).void } - def visit_break_node(node); end + # Get a symbol by it's full name + # + # Raises an error if the symbol is not found + # + # @raise [Error] + # + # source://spoom/lib/spoom/model/model.rb#247 + sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } + def [](full_name); end - # source://spoom/lib/spoom/deadcode/visitor.rb#100 - sig { override.params(node: ::Prism::CallAndWriteNode).void } - def visit_call_and_write_node(node); end + # source://spoom/lib/spoom/model/model.rb#296 + sig { void } + def finalize!; end - # source://spoom/lib/spoom/deadcode/visitor.rb#105 - sig { override.params(node: ::Prism::CallNode).void } - def visit_call_node(node); end + # Register a new symbol by it's full name + # + # If the symbol already exists, it will be returned. + # + # source://spoom/lib/spoom/model/model.rb#258 + sig { params(full_name: ::String).returns(::Spoom::Model::Symbol) } + def register_symbol(full_name); end - # source://spoom/lib/spoom/deadcode/visitor.rb#110 - sig { override.params(node: ::Prism::CallOperatorWriteNode).void } - def visit_call_operator_write_node(node); end + # source://spoom/lib/spoom/model/model.rb#263 + sig { params(full_name: ::String, context: ::Spoom::Model::Symbol).returns(::Spoom::Model::Symbol) } + def resolve_symbol(full_name, context:); end - # source://spoom/lib/spoom/deadcode/visitor.rb#115 - sig { override.params(node: ::Prism::CallOrWriteNode).void } - def visit_call_or_write_node(node); end + # source://spoom/lib/spoom/model/model.rb#290 + sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } + def subtypes(symbol); end - # source://spoom/lib/spoom/deadcode/visitor.rb#120 - sig { override.params(node: ::Prism::CallTargetNode).void } - def visit_call_target_node(node); end + # source://spoom/lib/spoom/model/model.rb#284 + sig { params(symbol: ::Spoom::Model::Symbol).returns(T::Array[::Spoom::Model::Symbol]) } + def supertypes(symbol); end - # source://spoom/lib/spoom/deadcode/visitor.rb#125 - sig { override.params(node: ::Prism::CapturePatternNode).void } - def visit_capture_pattern_node(node); end + # All the symbols registered in this model + # + # source://spoom/lib/spoom/model/model.rb#232 + sig { returns(T::Hash[::String, ::Spoom::Model::Symbol]) } + def symbols; end - # source://spoom/lib/spoom/deadcode/visitor.rb#130 - sig { override.params(node: ::Prism::CaseMatchNode).void } - def visit_case_match_node(node); end + # source://spoom/lib/spoom/model/model.rb#235 + sig { returns(Spoom::Poset[::Spoom::Model::Symbol]) } + def symbols_hierarchy; end - # source://spoom/lib/spoom/deadcode/visitor.rb#135 - sig { override.params(node: ::Prism::CaseNode).void } - def visit_case_node(node); end + private - # source://spoom/lib/spoom/deadcode/visitor.rb#10 - sig { override.params(node: ::Prism::Node).void } - def visit_child_nodes(node); end + # source://spoom/lib/spoom/model/model.rb#303 + sig { void } + def compute_symbols_hierarchy!; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#140 - sig { override.params(node: ::Prism::ClassNode).void } - def visit_class_node(node); end +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom/lib/spoom/model/model.rb#179 +class Spoom::Model::Attr < ::Spoom::Model::Property + abstract! +end - # source://spoom/lib/spoom/deadcode/visitor.rb#145 - sig { override.params(node: ::Prism::ClassVariableAndWriteNode).void } - def visit_class_variable_and_write_node(node); end +# source://spoom/lib/spoom/model/model.rb#185 +class Spoom::Model::AttrAccessor < ::Spoom::Model::Attr; end - # source://spoom/lib/spoom/deadcode/visitor.rb#150 - sig { override.params(node: ::Prism::ClassVariableOperatorWriteNode).void } - def visit_class_variable_operator_write_node(node); end +# source://spoom/lib/spoom/model/model.rb#183 +class Spoom::Model::AttrReader < ::Spoom::Model::Attr; end - # source://spoom/lib/spoom/deadcode/visitor.rb#155 - sig { override.params(node: ::Prism::ClassVariableOrWriteNode).void } - def visit_class_variable_or_write_node(node); end +# source://spoom/lib/spoom/model/model.rb#184 +class Spoom::Model::AttrWriter < ::Spoom::Model::Attr; end - # source://spoom/lib/spoom/deadcode/visitor.rb#160 - sig { override.params(node: ::Prism::ClassVariableReadNode).void } - def visit_class_variable_read_node(node); end +# Populate a Model by visiting the nodes from a Ruby file +# +# source://spoom/lib/spoom/model/builder.rb#7 +class Spoom::Model::Builder < ::Spoom::Model::NamespaceVisitor + # source://spoom/lib/spoom/model/builder.rb#11 + sig { params(model: ::Spoom::Model, file: ::String).void } + def initialize(model, file); end - # source://spoom/lib/spoom/deadcode/visitor.rb#165 - sig { override.params(node: ::Prism::ClassVariableTargetNode).void } - def visit_class_variable_target_node(node); end + # Accessors + # + # source://spoom/lib/spoom/model/builder.rb#146 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#170 - sig { override.params(node: ::Prism::ClassVariableWriteNode).void } - def visit_class_variable_write_node(node); end + # Classes + # + # source://spoom/lib/spoom/model/builder.rb#24 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#175 - sig { override.params(node: ::Prism::ConstantAndWriteNode).void } - def visit_constant_and_write_node(node); end + # Constants + # + # source://spoom/lib/spoom/model/builder.rb#71 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#180 - sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } - def visit_constant_operator_write_node(node); end + # source://spoom/lib/spoom/model/builder.rb#92 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#185 - sig { override.params(node: ::Prism::ConstantOrWriteNode).void } - def visit_constant_or_write_node(node); end + # Methods + # + # source://spoom/lib/spoom/model/builder.rb#127 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#190 - sig { override.params(node: ::Prism::ConstantPathAndWriteNode).void } - def visit_constant_path_and_write_node(node); end + # Modules + # + # source://spoom/lib/spoom/model/builder.rb#55 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#195 - sig { override.params(node: ::Prism::ConstantPathNode).void } - def visit_constant_path_node(node); end + # source://spoom/lib/spoom/model/builder.rb#106 + sig { override.params(node: ::Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#200 - sig { override.params(node: ::Prism::ConstantPathOperatorWriteNode).void } - def visit_constant_path_operator_write_node(node); end + # source://spoom/lib/spoom/model/builder.rb#39 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#205 - sig { override.params(node: ::Prism::ConstantPathOrWriteNode).void } - def visit_constant_path_or_write_node(node); end + private - # source://spoom/lib/spoom/deadcode/visitor.rb#210 - sig { override.params(node: ::Prism::ConstantPathTargetNode).void } - def visit_constant_path_target_node(node); end + # source://spoom/lib/spoom/model/builder.rb#234 + sig { returns(T::Array[::Spoom::Model::Sig]) } + def collect_sigs; end - # source://spoom/lib/spoom/deadcode/visitor.rb#215 - sig { override.params(node: ::Prism::ConstantPathWriteNode).void } - def visit_constant_path_write_node(node); end + # source://spoom/lib/spoom/model/builder.rb#229 + sig { returns(::Spoom::Model::Visibility) } + def current_visibility; end - # source://spoom/lib/spoom/deadcode/visitor.rb#220 - sig { override.params(node: ::Prism::ConstantReadNode).void } - def visit_constant_read_node(node); end + # source://spoom/lib/spoom/model/builder.rb#241 + sig { params(node: ::Prism::Node).returns(::Spoom::Location) } + def node_location(node); end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#225 - sig { override.params(node: ::Prism::ConstantTargetNode).void } - def visit_constant_target_node(node); end +# source://spoom/lib/spoom/model/model.rb#117 +class Spoom::Model::Class < ::Spoom::Model::Namespace + # source://spoom/lib/spoom/model/model.rb#129 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + superclass_name: T.nilable(::String) + ).void + end + def initialize(symbol, owner:, location:, superclass_name: T.unsafe(nil)); end - # source://spoom/lib/spoom/deadcode/visitor.rb#230 - sig { override.params(node: ::Prism::ConstantWriteNode).void } - def visit_constant_write_node(node); end + # source://spoom/lib/spoom/model/model.rb#119 + sig { returns(T.nilable(::String)) } + def superclass_name; end - # source://spoom/lib/spoom/deadcode/visitor.rb#235 - sig { override.params(node: ::Prism::DefNode).void } - def visit_def_node(node); end + # @return [String, nil] + # + # source://spoom/lib/spoom/model/model.rb#119 + def superclass_name=(_arg0); end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#240 - sig { override.params(node: ::Prism::DefinedNode).void } - def visit_defined_node(node); end +# source://spoom/lib/spoom/model/model.rb#138 +class Spoom::Model::Constant < ::Spoom::Model::SymbolDef + # source://spoom/lib/spoom/model/model.rb#143 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + value: ::String + ).void + end + def initialize(symbol, owner:, location:, value:); end - # source://spoom/lib/spoom/deadcode/visitor.rb#245 - sig { override.params(node: ::Prism::ElseNode).void } - def visit_else_node(node); end + # source://spoom/lib/spoom/model/model.rb#140 + sig { returns(::String) } + def value; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#250 - sig { override.params(node: ::Prism::EmbeddedStatementsNode).void } - def visit_embedded_statements_node(node); end +# source://spoom/lib/spoom/model/model.rb#8 +class Spoom::Model::Error < ::Spoom::Error; end - # source://spoom/lib/spoom/deadcode/visitor.rb#255 - sig { override.params(node: ::Prism::EmbeddedVariableNode).void } - def visit_embedded_variable_node(node); end +# source://spoom/lib/spoom/model/model.rb#213 +class Spoom::Model::Extend < ::Spoom::Model::Mixin; end - # source://spoom/lib/spoom/deadcode/visitor.rb#260 - sig { override.params(node: ::Prism::EnsureNode).void } - def visit_ensure_node(node); end +# source://spoom/lib/spoom/model/model.rb#211 +class Spoom::Model::Include < ::Spoom::Model::Mixin; end - # source://spoom/lib/spoom/deadcode/visitor.rb#265 - sig { override.params(node: ::Prism::FalseNode).void } - def visit_false_node(node); end +# source://spoom/lib/spoom/model/model.rb#177 +class Spoom::Model::Method < ::Spoom::Model::Property; end - # source://spoom/lib/spoom/deadcode/visitor.rb#270 - sig { override.params(node: ::Prism::FindPatternNode).void } - def visit_find_pattern_node(node); end +# A mixin (include, prepend, extend) to a namespace +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom/lib/spoom/model/model.rb#196 +class Spoom::Model::Mixin + abstract! - # source://spoom/lib/spoom/deadcode/visitor.rb#275 - sig { override.params(node: ::Prism::FlipFlopNode).void } - def visit_flip_flop_node(node); end + # source://spoom/lib/spoom/model/model.rb#206 + sig { params(name: ::String).void } + def initialize(name); end - # source://spoom/lib/spoom/deadcode/visitor.rb#280 - sig { override.params(node: ::Prism::FloatNode).void } - def visit_float_node(node); end + # source://spoom/lib/spoom/model/model.rb#203 + sig { returns(::String) } + def name; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#285 - sig { override.params(node: ::Prism::ForNode).void } - def visit_for_node(node); end +# source://spoom/lib/spoom/model/model.rb#136 +class Spoom::Model::Module < ::Spoom::Model::Namespace; end - # source://spoom/lib/spoom/deadcode/visitor.rb#290 - sig { override.params(node: ::Prism::ForwardingArgumentsNode).void } - def visit_forwarding_arguments_node(node); end +# A class or module +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom/lib/spoom/model/model.rb#97 +class Spoom::Model::Namespace < ::Spoom::Model::SymbolDef + abstract! - # source://spoom/lib/spoom/deadcode/visitor.rb#295 - sig { override.params(node: ::Prism::ForwardingParameterNode).void } - def visit_forwarding_parameter_node(node); end + # source://spoom/lib/spoom/model/model.rb#107 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location + ).void + end + def initialize(symbol, owner:, location:); end - # source://spoom/lib/spoom/deadcode/visitor.rb#300 - sig { override.params(node: ::Prism::ForwardingSuperNode).void } - def visit_forwarding_super_node(node); end + # source://spoom/lib/spoom/model/model.rb#101 + sig { returns(T::Array[::Spoom::Model::SymbolDef]) } + def children; end - # source://spoom/lib/spoom/deadcode/visitor.rb#305 - sig { override.params(node: ::Prism::GlobalVariableAndWriteNode).void } - def visit_global_variable_and_write_node(node); end + # source://spoom/lib/spoom/model/model.rb#104 + sig { returns(T::Array[::Spoom::Model::Mixin]) } + def mixins; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#310 - sig { override.params(node: ::Prism::GlobalVariableOperatorWriteNode).void } - def visit_global_variable_operator_write_node(node); end +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom/lib/spoom/model/namespace_visitor.rb#6 +class Spoom::Model::NamespaceVisitor < ::Spoom::Visitor + abstract! - # source://spoom/lib/spoom/deadcode/visitor.rb#315 - sig { override.params(node: ::Prism::GlobalVariableOrWriteNode).void } - def visit_global_variable_or_write_node(node); end + # source://spoom/lib/spoom/model/namespace_visitor.rb#12 + sig { void } + def initialize; end - # source://spoom/lib/spoom/deadcode/visitor.rb#320 - sig { override.params(node: ::Prism::GlobalVariableReadNode).void } - def visit_global_variable_read_node(node); end + # source://spoom/lib/spoom/model/namespace_visitor.rb#19 + sig { override.params(node: T.nilable(::Prism::Node)).void } + def visit(node); end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#325 - sig { override.params(node: ::Prism::GlobalVariableTargetNode).void } - def visit_global_variable_target_node(node); end +# source://spoom/lib/spoom/model/model.rb#212 +class Spoom::Model::Prepend < ::Spoom::Model::Mixin; end - # source://spoom/lib/spoom/deadcode/visitor.rb#330 - sig { override.params(node: ::Prism::GlobalVariableWriteNode).void } - def visit_global_variable_write_node(node); end +# A method or an attribute accessor +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom/lib/spoom/model/model.rb#151 +class Spoom::Model::Property < ::Spoom::Model::SymbolDef + abstract! - # source://spoom/lib/spoom/deadcode/visitor.rb#335 - sig { override.params(node: ::Prism::HashNode).void } - def visit_hash_node(node); end + # source://spoom/lib/spoom/model/model.rb#169 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location, + visibility: ::Spoom::Model::Visibility, + sigs: T::Array[::Spoom::Model::Sig] + ).void + end + def initialize(symbol, owner:, location:, visibility:, sigs: T.unsafe(nil)); end - # source://spoom/lib/spoom/deadcode/visitor.rb#340 - sig { override.params(node: ::Prism::HashPatternNode).void } - def visit_hash_pattern_node(node); end + # source://spoom/lib/spoom/model/model.rb#158 + sig { returns(T::Array[::Spoom::Model::Sig]) } + def sigs; end - # source://spoom/lib/spoom/deadcode/visitor.rb#345 - sig { override.params(node: ::Prism::IfNode).void } - def visit_if_node(node); end + # source://spoom/lib/spoom/model/model.rb#155 + sig { returns(::Spoom::Model::Visibility) } + def visibility; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#350 - sig { override.params(node: ::Prism::ImaginaryNode).void } - def visit_imaginary_node(node); end +# A reference to something that looks like a constant or a method +# +# Constants could be classes, modules, or actual constants. +# Methods could be accessors, instance or class methods, aliases, etc. +# +# source://spoom/lib/spoom/model/reference.rb#10 +class Spoom::Model::Reference < ::T::Struct + const :kind, ::Spoom::Model::Reference::Kind + const :name, ::String + const :location, ::Spoom::Location - # source://spoom/lib/spoom/deadcode/visitor.rb#355 - sig { override.params(node: ::Prism::ImplicitNode).void } - def visit_implicit_node(node); end + # source://spoom/lib/spoom/model/reference.rb#39 + sig { returns(T::Boolean) } + def constant?; end - # source://spoom/lib/spoom/deadcode/visitor.rb#360 - sig { override.params(node: ::Prism::ImplicitRestNode).void } - def visit_implicit_rest_node(node); end + # source://spoom/lib/spoom/model/reference.rb#44 + sig { returns(T::Boolean) } + def method?; end - # source://spoom/lib/spoom/deadcode/visitor.rb#365 - sig { override.params(node: ::Prism::InNode).void } - def visit_in_node(node); end + class << self + # source://spoom/lib/spoom/model/reference.rb#24 + sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } + def constant(name, location); end - # source://spoom/lib/spoom/deadcode/visitor.rb#370 - sig { override.params(node: ::Prism::IndexAndWriteNode).void } - def visit_index_and_write_node(node); end + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 + def inherited(s); end - # source://spoom/lib/spoom/deadcode/visitor.rb#375 - sig { override.params(node: ::Prism::IndexOperatorWriteNode).void } - def visit_index_operator_write_node(node); end + # source://spoom/lib/spoom/model/reference.rb#29 + sig { params(name: ::String, location: ::Spoom::Location).returns(::Spoom::Model::Reference) } + def method(name, location); end + end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#380 - sig { override.params(node: ::Prism::IndexOrWriteNode).void } - def visit_index_or_write_node(node); end +# source://spoom/lib/spoom/model/reference.rb#13 +class Spoom::Model::Reference::Kind < ::T::Enum + enums do + Constant = new + Method = new + end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#385 - sig { override.params(node: ::Prism::IndexTargetNode).void } - def visit_index_target_node(node); end +# Visit a file to collect all the references to constants and methods +# +# source://spoom/lib/spoom/model/references_visitor.rb#7 +class Spoom::Model::ReferencesVisitor < ::Spoom::Visitor + # source://spoom/lib/spoom/model/references_visitor.rb#14 + sig { params(file: ::String).void } + def initialize(file); end + + # source://spoom/lib/spoom/model/references_visitor.rb#11 + sig { returns(T::Array[::Spoom::Model::Reference]) } + def references; end - # source://spoom/lib/spoom/deadcode/visitor.rb#390 - sig { override.params(node: ::Prism::InstanceVariableAndWriteNode).void } - def visit_instance_variable_and_write_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#22 + sig { override.params(node: ::Prism::AliasMethodNode).void } + def visit_alias_method_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#395 - sig { override.params(node: ::Prism::InstanceVariableOperatorWriteNode).void } - def visit_instance_variable_operator_write_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#27 + sig { override.params(node: ::Prism::AndNode).void } + def visit_and_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#400 - sig { override.params(node: ::Prism::InstanceVariableOrWriteNode).void } - def visit_instance_variable_or_write_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#33 + sig { override.params(node: ::Prism::BlockArgumentNode).void } + def visit_block_argument_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#405 - sig { override.params(node: ::Prism::InstanceVariableReadNode).void } - def visit_instance_variable_read_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#44 + sig { override.params(node: ::Prism::CallAndWriteNode).void } + def visit_call_and_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#410 - sig { override.params(node: ::Prism::InstanceVariableTargetNode).void } - def visit_instance_variable_target_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#68 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#415 - sig { override.params(node: ::Prism::InstanceVariableWriteNode).void } - def visit_instance_variable_write_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#52 + sig { override.params(node: ::Prism::CallOperatorWriteNode).void } + def visit_call_operator_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#420 - sig { override.params(node: ::Prism::IntegerNode).void } - def visit_integer_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#60 + sig { override.params(node: ::Prism::CallOrWriteNode).void } + def visit_call_or_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#425 - sig { override.params(node: ::Prism::InterpolatedMatchLastLineNode).void } - def visit_interpolated_match_last_line_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#85 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#430 - sig { override.params(node: ::Prism::InterpolatedRegularExpressionNode).void } - def visit_interpolated_regular_expression_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#91 + sig { override.params(node: ::Prism::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#435 - sig { override.params(node: ::Prism::InterpolatedStringNode).void } - def visit_interpolated_string_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#97 + sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#440 - sig { override.params(node: ::Prism::InterpolatedSymbolNode).void } - def visit_interpolated_symbol_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#103 + sig { override.params(node: ::Prism::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#445 - sig { override.params(node: ::Prism::InterpolatedXStringNode).void } - def visit_interpolated_x_string_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#109 + sig { override.params(node: ::Prism::ConstantPathNode).void } + def visit_constant_path_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#450 - sig { override.params(node: ::Prism::KeywordHashNode).void } - def visit_keyword_hash_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#115 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#455 - sig { override.params(node: ::Prism::KeywordRestParameterNode).void } - def visit_keyword_rest_parameter_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#121 + sig { override.params(node: ::Prism::ConstantReadNode).void } + def visit_constant_read_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#460 - sig { override.params(node: ::Prism::LambdaNode).void } - def visit_lambda_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#126 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#465 + # source://spoom/lib/spoom/model/references_visitor.rb#131 sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } def visit_local_variable_and_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#470 + # source://spoom/lib/spoom/model/references_visitor.rb#139 sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } def visit_local_variable_operator_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#475 + # source://spoom/lib/spoom/model/references_visitor.rb#147 sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } def visit_local_variable_or_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#480 - sig { override.params(node: ::Prism::LocalVariableReadNode).void } - def visit_local_variable_read_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#485 - sig { override.params(node: ::Prism::LocalVariableTargetNode).void } - def visit_local_variable_target_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#490 + # source://spoom/lib/spoom/model/references_visitor.rb#155 sig { override.params(node: ::Prism::LocalVariableWriteNode).void } def visit_local_variable_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#495 - sig { override.params(node: ::Prism::MatchLastLineNode).void } - def visit_match_last_line_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#500 - sig { override.params(node: ::Prism::MatchPredicateNode).void } - def visit_match_predicate_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#505 - sig { override.params(node: ::Prism::MatchRequiredNode).void } - def visit_match_required_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#510 - sig { override.params(node: ::Prism::MatchWriteNode).void } - def visit_match_write_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#515 - sig { override.params(node: ::Prism::MissingNode).void } - def visit_missing_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#520 + # source://spoom/lib/spoom/model/references_visitor.rb#161 sig { override.params(node: ::Prism::ModuleNode).void } def visit_module_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#525 - sig { override.params(node: ::Prism::MultiTargetNode).void } - def visit_multi_target_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#530 + # source://spoom/lib/spoom/model/references_visitor.rb#166 sig { override.params(node: ::Prism::MultiWriteNode).void } def visit_multi_write_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#535 - sig { override.params(node: ::Prism::NextNode).void } - def visit_next_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#540 - sig { override.params(node: ::Prism::NilNode).void } - def visit_nil_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#545 - sig { override.params(node: ::Prism::NoKeywordsParameterNode).void } - def visit_no_keywords_parameter_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#550 - sig { override.params(node: ::Prism::NumberedParametersNode).void } - def visit_numbered_parameters_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#555 - sig { override.params(node: ::Prism::NumberedReferenceReadNode).void } - def visit_numbered_reference_read_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#560 - sig { override.params(node: ::Prism::OptionalKeywordParameterNode).void } - def visit_optional_keyword_parameter_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#565 - sig { override.params(node: ::Prism::OptionalParameterNode).void } - def visit_optional_parameter_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#570 + # source://spoom/lib/spoom/model/references_visitor.rb#177 sig { override.params(node: ::Prism::OrNode).void } def visit_or_node(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#575 - sig { override.params(node: ::Prism::ParametersNode).void } - def visit_parameters_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#580 - sig { override.params(node: ::Prism::ParenthesesNode).void } - def visit_parentheses_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#585 - sig { override.params(node: ::Prism::PinnedExpressionNode).void } - def visit_pinned_expression_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#590 - sig { override.params(node: ::Prism::PinnedVariableNode).void } - def visit_pinned_variable_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#595 - sig { override.params(node: ::Prism::PostExecutionNode).void } - def visit_post_execution_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#600 - sig { override.params(node: ::Prism::PreExecutionNode).void } - def visit_pre_execution_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#605 - sig { override.params(node: ::Prism::ProgramNode).void } - def visit_program_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#610 - sig { override.params(node: ::Prism::RangeNode).void } - def visit_range_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#615 - sig { override.params(node: ::Prism::RationalNode).void } - def visit_rational_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#620 - sig { override.params(node: ::Prism::RedoNode).void } - def visit_redo_node(node); end - - # source://spoom/lib/spoom/deadcode/visitor.rb#625 - sig { override.params(node: ::Prism::RegularExpressionNode).void } - def visit_regular_expression_node(node); end + private - # source://spoom/lib/spoom/deadcode/visitor.rb#630 - sig { override.params(node: ::Prism::RequiredKeywordParameterNode).void } - def visit_required_keyword_parameter_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#195 + sig { params(node: ::Prism::Node).returns(::Spoom::Location) } + def node_location(node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#635 - sig { override.params(node: ::Prism::RequiredParameterNode).void } - def visit_required_parameter_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#185 + sig { params(name: ::String, node: ::Prism::Node).void } + def reference_constant(name, node); end - # source://spoom/lib/spoom/deadcode/visitor.rb#640 - sig { override.params(node: ::Prism::RescueModifierNode).void } - def visit_rescue_modifier_node(node); end + # source://spoom/lib/spoom/model/references_visitor.rb#190 + sig { params(name: ::String, node: ::Prism::Node).void } + def reference_method(name, node); end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#645 - sig { override.params(node: ::Prism::RescueNode).void } - def visit_rescue_node(node); end +# A Sorbet signature (sig block) +# +# source://spoom/lib/spoom/model/model.rb#216 +class Spoom::Model::Sig + # source://spoom/lib/spoom/model/model.rb#223 + sig { params(string: ::String).void } + def initialize(string); end - # source://spoom/lib/spoom/deadcode/visitor.rb#650 - sig { override.params(node: ::Prism::RestParameterNode).void } - def visit_rest_parameter_node(node); end + # source://spoom/lib/spoom/model/model.rb#220 + sig { returns(::String) } + def string; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#655 - sig { override.params(node: ::Prism::RetryNode).void } - def visit_retry_node(node); end +# source://spoom/lib/spoom/model/model.rb#115 +class Spoom::Model::SingletonClass < ::Spoom::Model::Namespace; end - # source://spoom/lib/spoom/deadcode/visitor.rb#660 - sig { override.params(node: ::Prism::ReturnNode).void } - def visit_return_node(node); end +# A Symbol is a uniquely named entity in the Ruby codebase +# +# A symbol can have multiple definitions, e.g. a class can be reopened. +# Sometimes a symbol can have multiple definitions of different types, +# e.g. `foo` method can be defined both as a method and as an attribute accessor. +# +# source://spoom/lib/spoom/model/model.rb#15 +class Spoom::Model::Symbol + # source://spoom/lib/spoom/model/model.rb#27 + sig { params(full_name: ::String).void } + def initialize(full_name); end - # source://spoom/lib/spoom/deadcode/visitor.rb#665 - sig { override.params(node: ::Prism::SelfNode).void } - def visit_self_node(node); end + # The definitions of this symbol (where it exists in the code) + # + # source://spoom/lib/spoom/model/model.rb#24 + sig { returns(T::Array[::Spoom::Model::SymbolDef]) } + def definitions; end - # source://spoom/lib/spoom/deadcode/visitor.rb#670 - sig { override.params(node: ::Prism::SingletonClassNode).void } - def visit_singleton_class_node(node); end + # The full, unique name of this symbol + # + # source://spoom/lib/spoom/model/model.rb#20 + sig { returns(::String) } + def full_name; end - # source://spoom/lib/spoom/deadcode/visitor.rb#675 - sig { override.params(node: ::Prism::SourceEncodingNode).void } - def visit_source_encoding_node(node); end + # The short name of this symbol + # + # source://spoom/lib/spoom/model/model.rb#34 + sig { returns(::String) } + def name; end - # source://spoom/lib/spoom/deadcode/visitor.rb#680 - sig { override.params(node: ::Prism::SourceFileNode).void } - def visit_source_file_node(node); end + # source://spoom/lib/spoom/model/model.rb#39 + sig { returns(::String) } + def to_s; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#685 - sig { override.params(node: ::Prism::SourceLineNode).void } - def visit_source_line_node(node); end +# A SymbolDef is a definition of a Symbol +# +# It can be a class, module, constant, method, etc. +# A SymbolDef has a location pointing to the actual code that defines the symbol. +# +# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. +# +# source://spoom/lib/spoom/model/model.rb#55 +class Spoom::Model::SymbolDef + abstract! - # source://spoom/lib/spoom/deadcode/visitor.rb#690 - sig { override.params(node: ::Prism::SplatNode).void } - def visit_splat_node(node); end + # source://spoom/lib/spoom/model/model.rb#74 + sig do + params( + symbol: ::Spoom::Model::Symbol, + owner: T.nilable(::Spoom::Model::Namespace), + location: ::Spoom::Location + ).void + end + def initialize(symbol, owner:, location:); end - # source://spoom/lib/spoom/deadcode/visitor.rb#695 - sig { override.params(node: ::Prism::StatementsNode).void } - def visit_statements_node(node); end + # The full name of the symbol this definition belongs to + # + # source://spoom/lib/spoom/model/model.rb#85 + sig { returns(::String) } + def full_name; end - # source://spoom/lib/spoom/deadcode/visitor.rb#700 - sig { override.params(node: ::Prism::StringNode).void } - def visit_string_node(node); end + # The actual code location of this definition + # + # source://spoom/lib/spoom/model/model.rb#71 + sig { returns(::Spoom::Location) } + def location; end - # source://spoom/lib/spoom/deadcode/visitor.rb#705 - sig { override.params(node: ::Prism::SuperNode).void } - def visit_super_node(node); end + # The short name of the symbol this definition belongs to + # + # source://spoom/lib/spoom/model/model.rb#91 + sig { returns(::String) } + def name; end - # source://spoom/lib/spoom/deadcode/visitor.rb#710 - sig { override.params(node: ::Prism::SymbolNode).void } - def visit_symbol_node(node); end + # The enclosing namespace this definition belongs to + # + # source://spoom/lib/spoom/model/model.rb#67 + sig { returns(T.nilable(::Spoom::Model::Namespace)) } + def owner; end - # source://spoom/lib/spoom/deadcode/visitor.rb#715 - sig { override.params(node: ::Prism::TrueNode).void } - def visit_true_node(node); end + # The symbol this definition belongs to + # + # source://spoom/lib/spoom/model/model.rb#63 + sig { returns(::Spoom::Model::Symbol) } + def symbol; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#720 - sig { override.params(node: ::Prism::UndefNode).void } - def visit_undef_node(node); end +# source://spoom/lib/spoom/model/model.rb#44 +class Spoom::Model::UnresolvedSymbol < ::Spoom::Model::Symbol + # source://spoom/lib/spoom/model/model.rb#46 + sig { override.returns(::String) } + def to_s; end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#725 - sig { override.params(node: ::Prism::UnlessNode).void } - def visit_unless_node(node); end +# source://spoom/lib/spoom/model/model.rb#187 +class Spoom::Model::Visibility < ::T::Enum + enums do + Private = new + Protected = new + Public = new + end +end - # source://spoom/lib/spoom/deadcode/visitor.rb#730 - sig { override.params(node: ::Prism::UntilNode).void } - def visit_until_node(node); end +# source://spoom/lib/spoom/parse.rb#7 +class Spoom::ParseError < ::Spoom::Error; end - # source://spoom/lib/spoom/deadcode/visitor.rb#735 - sig { override.params(node: ::Prism::WhenNode).void } - def visit_when_node(node); end +# A Poset is a set of elements with a partial order relation. +# +# The partial order relation is a binary relation that is reflexive, antisymmetric, and transitive. +# It can be used to represent a hierarchy of classes or modules, the dependencies between gems, etc. +# +# source://spoom/lib/spoom/poset.rb#9 +class Spoom::Poset + extend T::Generic - # source://spoom/lib/spoom/deadcode/visitor.rb#740 - sig { override.params(node: ::Prism::WhileNode).void } - def visit_while_node(node); end + E = type_member { { upper: Object } } - # source://spoom/lib/spoom/deadcode/visitor.rb#745 - sig { override.params(node: ::Prism::XStringNode).void } - def visit_x_string_node(node); end + # source://spoom/lib/spoom/poset.rb#18 + sig { void } + def initialize; end - # source://spoom/lib/spoom/deadcode/visitor.rb#750 - sig { override.params(node: ::Prism::YieldNode).void } - def visit_yield_node(node); end -end + # Get the POSet element for a given value + # + # Raises if the element is not found + # + # @raise [Error] + # + # source://spoom/lib/spoom/poset.rb#26 + sig { params(value: E).returns(Spoom::Poset::Element[E]) } + def [](value); end -# source://spoom/lib/spoom.rb#12 -class Spoom::Error < ::StandardError; end + # Add a direct edge from one element to another + # + # Transitive edges (transitive closure) are automatically computed. + # Adds the elements if they don't exist. + # If the direct edge already exists, nothing is done. + # + # source://spoom/lib/spoom/poset.rb#54 + sig { params(from: E, to: E).void } + def add_direct_edge(from, to); end -# source://spoom/lib/spoom/context/exec.rb#5 -class Spoom::ExecResult < ::T::Struct - const :out, ::String - const :err, T.nilable(::String) - const :status, T::Boolean - const :exit_code, ::Integer + # Add an element to the POSet + # + # source://spoom/lib/spoom/poset.rb#35 + sig { params(value: E).returns(Spoom::Poset::Element[E]) } + def add_element(value); end - # source://spoom/lib/spoom/context/exec.rb#14 - sig { returns(::String) } - def to_s; end + # Is there a direct edge from `from` to `to`? + # + # source://spoom/lib/spoom/poset.rb#101 + sig { params(from: E, to: E).returns(T::Boolean) } + def direct_edge?(from, to); end - class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end - end -end + # Is there an edge (direct or indirect) from `from` to `to`? + # + # source://spoom/lib/spoom/poset.rb#92 + sig { params(from: E, to: E).returns(T::Boolean) } + def edge?(from, to); end -# source://spoom/lib/spoom/file_collector.rb#5 -class Spoom::FileCollector - # Initialize a new file collector + # Is the given value a element in the POSet? # - # If `allow_extensions` is empty, all files are collected. - # If `allow_extensions` is an array of extensions, only files with one of these extensions are collected. + # source://spoom/lib/spoom/poset.rb#44 + sig { params(value: E).returns(T::Boolean) } + def element?(value); end + + # Show the POSet as a DOT graph using xdot (used for debugging) # - # If `allow_mime_types` is empty, all files are collected. - # If `allow_mime_types` is an array of mimetypes, files without an extension are collected if their mimetype is in - # the list. + # source://spoom/lib/spoom/poset.rb#107 + sig { params(direct: T::Boolean, transitive: T::Boolean).void } + def show_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end + + # Return the POSet as a DOT graph # - # source://spoom/lib/spoom/file_collector.rb#26 - sig do - params( - allow_extensions: T::Array[::String], - allow_mime_types: T::Array[::String], - exclude_patterns: T::Array[::String] - ).void - end - def initialize(allow_extensions: T.unsafe(nil), allow_mime_types: T.unsafe(nil), exclude_patterns: T.unsafe(nil)); end + # source://spoom/lib/spoom/poset.rb#116 + sig { params(direct: T::Boolean, transitive: T::Boolean).returns(::String) } + def to_dot(direct: T.unsafe(nil), transitive: T.unsafe(nil)); end +end - # source://spoom/lib/spoom/file_collector.rb#9 - sig { returns(T::Array[::String]) } - def files; end +# An element in a POSet +# +# source://spoom/lib/spoom/poset.rb#136 +class Spoom::Poset::Element + extend T::Generic + include ::Comparable - # source://spoom/lib/spoom/file_collector.rb#39 - sig { params(path: ::String).void } - def visit_path(path); end + E = type_member { { upper: Object } } - # source://spoom/lib/spoom/file_collector.rb#34 - sig { params(paths: T::Array[::String]).void } - def visit_paths(paths); end + # source://spoom/lib/spoom/poset.rb#152 + sig { params(value: E).void } + def initialize(value); end - private + # source://spoom/lib/spoom/poset.rb#161 + sig { params(other: T.untyped).returns(T.nilable(::Integer)) } + def <=>(other); end - # source://spoom/lib/spoom/file_collector.rb#56 - sig { params(path: ::String).returns(::String) } - def clean_path(path); end + # Direct and indirect ancestors of this element + # + # source://spoom/lib/spoom/poset.rb#180 + sig { returns(T::Array[E]) } + def ancestors; end - # source://spoom/lib/spoom/file_collector.rb#73 - sig { params(path: ::String).returns(T::Boolean) } - def excluded_file?(path); end + # Direct children of this element + # + # source://spoom/lib/spoom/poset.rb#186 + sig { returns(T::Array[E]) } + def children; end - # source://spoom/lib/spoom/file_collector.rb#88 - sig { params(path: ::String).returns(T::Boolean) } - def excluded_path?(path); end + # Direct and indirect descendants of this element + # + # source://spoom/lib/spoom/poset.rb#192 + sig { returns(T::Array[E]) } + def descendants; end - # source://spoom/lib/spoom/file_collector.rb#97 - sig { params(path: ::String).returns(T.nilable(::String)) } - def mime_type_for(path); end + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # @return [Set<Element[E]>] + # + # source://spoom/lib/spoom/poset.rb#149 + def dfroms; end - # source://spoom/lib/spoom/file_collector.rb#68 - sig { params(path: ::String).void } - def visit_directory(path); end + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # source://spoom/lib/spoom/poset.rb#149 + sig { returns(T::Set[Spoom::Poset::Element[E]]) } + def dtos; end - # source://spoom/lib/spoom/file_collector.rb#61 - sig { params(path: ::String).void } - def visit_file(path); end + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # @return [Set<Element[E]>] + # + # source://spoom/lib/spoom/poset.rb#149 + def froms; end + + # Direct parents of this element + # + # source://spoom/lib/spoom/poset.rb#174 + sig { returns(T::Array[E]) } + def parents; end + + # Edges (direct and indirect) from this element to other elements in the same POSet + # + # @return [Set<Element[E]>] + # + # source://spoom/lib/spoom/poset.rb#149 + def tos; end + + # The value held by this element + # + # source://spoom/lib/spoom/poset.rb#145 + sig { returns(E) } + def value; end end -# Build a file hierarchy from a set of file paths. -# -# source://spoom/lib/spoom/file_tree.rb#6 -class Spoom::FileTree - # source://spoom/lib/spoom/file_tree.rb#10 - sig { params(paths: T::Enumerable[::String]).void } - def initialize(paths = T.unsafe(nil)); end +# source://spoom/lib/spoom/poset.rb#13 +class Spoom::Poset::Error < ::Spoom::Error; end - # Add a `path` to the tree +# source://spoom/lib/spoom/printer.rb#7 +class Spoom::Printer + include ::Spoom::Colorize + + # source://spoom/lib/spoom/printer.rb#17 + sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } + def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end + + # Colorize `string` with color if `@colors` # - # This will create all nodes until the root of `path`. + # source://spoom/lib/spoom/printer.rb#78 + sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } + def colorize(string, *color); end + + # Decrease indent level # - # source://spoom/lib/spoom/file_tree.rb#25 - sig { params(path: ::String).returns(::Spoom::FileTree::Node) } - def add_path(path); end + # source://spoom/lib/spoom/printer.rb#31 + sig { void } + def dedent; end - # Add all `paths` to the tree + # Increase indent level # - # source://spoom/lib/spoom/file_tree.rb#17 - sig { params(paths: T::Enumerable[::String]).void } - def add_paths(paths); end + # source://spoom/lib/spoom/printer.rb#25 + sig { void } + def indent; end - # All the nodes in this tree + # source://spoom/lib/spoom/printer.rb#14 + sig { returns(T.any(::IO, ::StringIO)) } + def out; end + + # @return [IO, StringIO] # - # source://spoom/lib/spoom/file_tree.rb#45 - sig { returns(T::Array[::Spoom::FileTree::Node]) } - def nodes; end + # source://spoom/lib/spoom/printer.rb#14 + def out=(_arg0); end - # Return a map of typing scores for each node in the tree + # Print `string` into `out` # - # source://spoom/lib/spoom/file_tree.rb#59 - sig { params(context: ::Spoom::Context).returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } - def nodes_strictness_scores(context); end + # source://spoom/lib/spoom/printer.rb#37 + sig { params(string: T.nilable(::String)).void } + def print(string); end - # All the paths in this tree + # Print `string` colored with `color` into `out` # - # source://spoom/lib/spoom/file_tree.rb#53 - sig { returns(T::Array[::String]) } - def paths; end + # Does not use colors unless `@colors`. + # + # source://spoom/lib/spoom/printer.rb#47 + sig { params(string: T.nilable(::String), color: ::Spoom::Color).void } + def print_colored(string, *color); end - # Return a map of typing scores for each path in the tree + # Print `string` with indent and newline # - # source://spoom/lib/spoom/file_tree.rb#67 - sig { params(context: ::Spoom::Context).returns(T::Hash[::String, ::Float]) } - def paths_strictness_scores(context); end + # source://spoom/lib/spoom/printer.rb#62 + sig { params(string: T.nilable(::String)).void } + def printl(string); end - # source://spoom/lib/spoom/file_tree.rb#72 - sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean).void } - def print(out: T.unsafe(nil), colors: T.unsafe(nil)); end + # Print a new line into `out` + # + # source://spoom/lib/spoom/printer.rb#56 + sig { void } + def printn; end - # All root nodes + # Print an indent space into `out` # - # source://spoom/lib/spoom/file_tree.rb#39 - sig { returns(T::Array[::Spoom::FileTree::Node]) } - def roots; end + # source://spoom/lib/spoom/printer.rb#72 + sig { void } + def printt; end end -# A visitor that collects all the nodes in a tree +# source://spoom/lib/spoom.rb#10 +Spoom::SPOOM_PATH = T.let(T.unsafe(nil), String) + +# source://spoom/lib/spoom/sorbet/config.rb#5 +module Spoom::Sorbet; end + +# source://spoom/lib/spoom/sorbet.rb#39 +Spoom::Sorbet::BIN_PATH = T.let(T.unsafe(nil), String) + +# source://spoom/lib/spoom/sorbet.rb#36 +Spoom::Sorbet::CONFIG_PATH = T.let(T.unsafe(nil), String) + +# Parse Sorbet config files # -# source://spoom/lib/spoom/file_tree.rb#124 -class Spoom::FileTree::CollectNodes < ::Spoom::FileTree::Visitor - # source://spoom/lib/spoom/file_tree.rb#131 +# Parses a Sorbet config file: +# +# ```ruby +# config = Spoom::Sorbet::Config.parse_file("sorbet/config") +# puts config.paths # "." +# ``` +# +# Parses a Sorbet config string: +# +# ```ruby +# config = Spoom::Sorbet::Config.parse_string(<<~CONFIG) +# a +# --file=b +# --ignore=c +# CONFIG +# puts config.paths # "a", "b" +# puts config.ignore # "c" +# ``` +# +# source://spoom/lib/spoom/sorbet/config.rb#26 +class Spoom::Sorbet::Config + # source://spoom/lib/spoom/sorbet/config.rb#38 sig { void } def initialize; end - # source://spoom/lib/spoom/file_tree.rb#128 - sig { returns(T::Array[::Spoom::FileTree::Node]) } - def nodes; end + # @return [Array<String>] + # + # source://spoom/lib/spoom/sorbet/config.rb#32 + def allowed_extensions; end - # source://spoom/lib/spoom/file_tree.rb#137 - sig { override.params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end -end + # @return [Array<String>] + # + # source://spoom/lib/spoom/sorbet/config.rb#32 + def allowed_extensions=(_arg0); end -# A visitor that collects the typing score of each node in a tree -# -# source://spoom/lib/spoom/file_tree.rb#167 -class Spoom::FileTree::CollectScores < ::Spoom::FileTree::CollectStrictnesses - # source://spoom/lib/spoom/file_tree.rb#174 - sig { params(context: ::Spoom::Context).void } - def initialize(context); end + # source://spoom/lib/spoom/sorbet/config.rb#46 + sig { returns(::Spoom::Sorbet::Config) } + def copy; end + + # @return [Array<String>] + # + # source://spoom/lib/spoom/sorbet/config.rb#32 + def ignore; end + + # @return [Array<String>] + # + # source://spoom/lib/spoom/sorbet/config.rb#32 + def ignore=(_arg0); end + + # source://spoom/lib/spoom/sorbet/config.rb#35 + sig { returns(T::Boolean) } + def no_stdlib; end + + # @return [Boolean] + # + # source://spoom/lib/spoom/sorbet/config.rb#35 + def no_stdlib=(_arg0); end + + # Returns self as a string of options that can be passed to Sorbet + # + # Example: + # ~~~rb + # config = Sorbet::Config.new + # config.paths << "/foo" + # config.paths << "/bar" + # config.ignore << "/baz" + # config.allowed_extensions << ".rb" + # + # puts config.options_string # "/foo /bar --ignore /baz --allowed-extension .rb" + # ~~~ + # + # source://spoom/lib/spoom/sorbet/config.rb#68 + sig { returns(::String) } + def options_string; end - # source://spoom/lib/spoom/file_tree.rb#171 - sig { returns(T::Hash[::Spoom::FileTree::Node, ::Float]) } - def scores; end + # source://spoom/lib/spoom/sorbet/config.rb#32 + sig { returns(T::Array[::String]) } + def paths; end - # source://spoom/lib/spoom/file_tree.rb#181 - sig { override.params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end + # @return [Array<String>] + # + # source://spoom/lib/spoom/sorbet/config.rb#32 + def paths=(_arg0); end - private + class << self + # source://spoom/lib/spoom/sorbet/config.rb#81 + sig { params(sorbet_config_path: ::String).returns(::Spoom::Sorbet::Config) } + def parse_file(sorbet_config_path); end - # source://spoom/lib/spoom/file_tree.rb#190 - sig { params(node: ::Spoom::FileTree::Node).returns(::Float) } - def node_score(node); end + # source://spoom/lib/spoom/sorbet/config.rb#86 + sig { params(sorbet_config: ::String).returns(::Spoom::Sorbet::Config) } + def parse_string(sorbet_config); end - # source://spoom/lib/spoom/file_tree.rb#199 - sig { params(strictness: T.nilable(::String)).returns(::Float) } - def strictness_score(strictness); end + private + + # source://spoom/lib/spoom/sorbet/config.rb#150 + sig { params(line: ::String).returns(::String) } + def parse_option(line); end + end end -# A visitor that collects the strictness of each node in a tree -# -# source://spoom/lib/spoom/file_tree.rb#144 -class Spoom::FileTree::CollectStrictnesses < ::Spoom::FileTree::Visitor - # source://spoom/lib/spoom/file_tree.rb#151 - sig { params(context: ::Spoom::Context).void } - def initialize(context); end +# source://spoom/lib/spoom/sorbet/config.rb#29 +Spoom::Sorbet::Config::DEFAULT_ALLOWED_EXTENSIONS = T.let(T.unsafe(nil), Array) - # source://spoom/lib/spoom/file_tree.rb#148 - sig { returns(T::Hash[::Spoom::FileTree::Node, T.nilable(::String)]) } - def strictnesses; end +# source://spoom/lib/spoom/sorbet.rb#14 +class Spoom::Sorbet::Error < ::Spoom::Error + # source://spoom/lib/spoom/sorbet.rb#29 + sig { params(message: ::String, result: ::Spoom::ExecResult).void } + def initialize(message, result); end - # source://spoom/lib/spoom/file_tree.rb#158 - sig { override.params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end + # source://spoom/lib/spoom/sorbet.rb#21 + sig { returns(::Spoom::ExecResult) } + def result; end end -# A node representing either a file or a directory inside a FileTree -# -# source://spoom/lib/spoom/file_tree.rb#78 -class Spoom::FileTree::Node < ::T::Struct - const :parent, T.nilable(::Spoom::FileTree::Node) - const :name, ::String - const :children, T::Hash[::String, ::Spoom::FileTree::Node], default: T.unsafe(nil) +# source://spoom/lib/spoom/sorbet.rb#17 +class Spoom::Sorbet::Error::Killed < ::Spoom::Sorbet::Error; end - # Full path to this node from root - # - # source://spoom/lib/spoom/file_tree.rb#92 - sig { returns(::String) } - def path; end +# source://spoom/lib/spoom/sorbet.rb#18 +class Spoom::Sorbet::Error::Segfault < ::Spoom::Sorbet::Error; end +# source://spoom/lib/spoom/sorbet/errors.rb#6 +module Spoom::Sorbet::Errors class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end + # source://spoom/lib/spoom/sorbet/errors.rb#13 + sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def sort_errors_by_code(errors); end end end -# An internal class used to print a FileTree -# -# See `FileTree#print` -# -# source://spoom/lib/spoom/file_tree.rb#212 -class Spoom::FileTree::Printer < ::Spoom::FileTree::Visitor - # source://spoom/lib/spoom/file_tree.rb#222 +# source://spoom/lib/spoom/sorbet/errors.rb#7 +Spoom::Sorbet::Errors::DEFAULT_ERROR_URL_BASE = T.let(T.unsafe(nil), String) + +# source://spoom/lib/spoom/sorbet/errors.rb#127 +class Spoom::Sorbet::Errors::Error + include ::Comparable + + # source://spoom/lib/spoom/sorbet/errors.rb#153 sig do params( - strictnesses: T::Hash[::Spoom::FileTree::Node, T.nilable(::String)], - out: T.any(::IO, ::StringIO), - colors: T::Boolean + file: T.nilable(::String), + line: T.nilable(::Integer), + message: T.nilable(::String), + code: T.nilable(::Integer), + more: T::Array[::String] ).void end - def initialize(strictnesses, out: T.unsafe(nil), colors: T.unsafe(nil)); end + def initialize(file, line, message, code, more = T.unsafe(nil)); end - # source://spoom/lib/spoom/file_tree.rb#230 - sig { override.params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end + # By default errors are sorted by location + # + # source://spoom/lib/spoom/sorbet/errors.rb#164 + sig { params(other: T.untyped).returns(::Integer) } + def <=>(other); end - private + # @return [Integer, nil] + # + # source://spoom/lib/spoom/sorbet/errors.rb#135 + def code; end - # source://spoom/lib/spoom/file_tree.rb#255 - sig { params(strictness: T.nilable(::String)).returns(::Spoom::Color) } - def strictness_color(strictness); end -end + # source://spoom/lib/spoom/sorbet/errors.rb#132 + sig { returns(T.nilable(::String)) } + def file; end -# An abstract visitor for FileTree -# -# @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below. -# -# source://spoom/lib/spoom/file_tree.rb#101 -class Spoom::FileTree::Visitor - abstract! + # Other files associated with the error + # + # source://spoom/lib/spoom/sorbet/errors.rb#142 + sig { returns(T::Set[::String]) } + def files_from_error_sections; end - # source://spoom/lib/spoom/file_tree.rb#113 - sig { params(node: ::Spoom::FileTree::Node).void } - def visit_node(node); end + # source://spoom/lib/spoom/sorbet/errors.rb#135 + sig { returns(T.nilable(::Integer)) } + def line; end - # source://spoom/lib/spoom/file_tree.rb#118 - sig { params(nodes: T::Array[::Spoom::FileTree::Node]).void } - def visit_nodes(nodes); end + # @return [String, nil] + # + # source://spoom/lib/spoom/sorbet/errors.rb#132 + def message; end - # source://spoom/lib/spoom/file_tree.rb#108 - sig { params(tree: ::Spoom::FileTree).void } - def visit_tree(tree); end -end + # source://spoom/lib/spoom/sorbet/errors.rb#138 + sig { returns(T::Array[::String]) } + def more; end -# source://spoom/lib/spoom/context/git.rb#5 -module Spoom::Git; end + # source://spoom/lib/spoom/sorbet/errors.rb#171 + sig { returns(::String) } + def to_s; end +end -# source://spoom/lib/spoom/context/git.rb#6 -class Spoom::Git::Commit < ::T::Struct - const :sha, ::String - const :time, ::Time +# Parse errors from Sorbet output +# +# source://spoom/lib/spoom/sorbet/errors.rb#18 +class Spoom::Sorbet::Errors::Parser + # source://spoom/lib/spoom/sorbet/errors.rb#45 + sig { params(error_url_base: ::String).void } + def initialize(error_url_base: T.unsafe(nil)); end - # source://spoom/lib/spoom/context/git.rb#27 - sig { returns(::Integer) } - def timestamp; end + # source://spoom/lib/spoom/sorbet/errors.rb#52 + sig { params(output: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def parse(output); end - class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end + private - # Parse a line formatted as `%h %at` into a `Commit` - # - # source://spoom/lib/spoom/context/git.rb#14 - sig { params(string: ::String).returns(T.nilable(::Spoom::Git::Commit)) } - def parse_line(string); end - end -end + # @raise [ParseError] + # + # source://spoom/lib/spoom/sorbet/errors.rb#116 + sig { params(line: ::String).void } + def append_error(line); end -# source://spoom/lib/spoom/sorbet/lsp/base.rb#5 -module Spoom::LSP; end + # @raise [ParseError] + # + # source://spoom/lib/spoom/sorbet/errors.rb#108 + sig { void } + def close_error; end -# source://spoom/lib/spoom/sorbet/lsp.rb#13 -class Spoom::LSP::Client - # source://spoom/lib/spoom/sorbet/lsp.rb#17 - sig { params(sorbet_bin: ::String, sorbet_args: ::String, path: ::String).void } - def initialize(sorbet_bin, *sorbet_args, path: T.unsafe(nil)); end + # source://spoom/lib/spoom/sorbet/errors.rb#75 + sig { params(error_url_base: ::String).returns(::Regexp) } + def error_line_match_regexp(error_url_base); end - # source://spoom/lib/spoom/sorbet/lsp.rb#229 - sig { void } - def close; end + # source://spoom/lib/spoom/sorbet/errors.rb#92 + sig { params(line: ::String).returns(T.nilable(::Spoom::Sorbet::Errors::Error)) } + def match_error_line(line); end - # source://spoom/lib/spoom/sorbet/lsp.rb#131 - sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } - def definitions(uri, line, column); end + # @raise [ParseError] + # + # source://spoom/lib/spoom/sorbet/errors.rb#101 + sig { params(error: ::Spoom::Sorbet::Errors::Error).void } + def open_error(error); end - # source://spoom/lib/spoom/sorbet/lsp.rb#212 - sig { params(uri: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } - def document_symbols(uri); end + class << self + # source://spoom/lib/spoom/sorbet/errors.rb#38 + sig { params(output: ::String, error_url_base: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } + def parse_string(output, error_url_base: T.unsafe(nil)); end + end +end - # source://spoom/lib/spoom/sorbet/lsp.rb#89 - sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T.nilable(::Spoom::LSP::Hover)) } - def hover(uri, line, column); end +# source://spoom/lib/spoom/sorbet/errors.rb#23 +Spoom::Sorbet::Errors::Parser::HEADER = T.let(T.unsafe(nil), Array) - # source://spoom/lib/spoom/sorbet/lsp.rb#27 - sig { returns(::Integer) } - def next_id; end +# source://spoom/lib/spoom/sorbet/errors.rb#21 +class Spoom::Sorbet::Errors::Parser::ParseError < ::Spoom::Error; end - # LSP requests - # - # @raise [Error::AlreadyOpen] - # - # source://spoom/lib/spoom/sorbet/lsp.rb#72 - sig { params(workspace_path: ::String).void } - def open(workspace_path); end +# source://spoom/lib/spoom/sorbet.rb#37 +Spoom::Sorbet::GEM_PATH = T.let(T.unsafe(nil), String) - # source://spoom/lib/spoom/sorbet/lsp.rb#54 - sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) } - def read; end +# source://spoom/lib/spoom/sorbet.rb#38 +Spoom::Sorbet::GEM_VERSION = T.let(T.unsafe(nil), String) - # @raise [Error::BadHeaders] - # - # source://spoom/lib/spoom/sorbet/lsp.rb#43 - sig { returns(T.nilable(::String)) } - def read_raw; end +# source://spoom/lib/spoom/sorbet.rb#41 +Spoom::Sorbet::KILLED_CODE = T.let(T.unsafe(nil), Integer) - # source://spoom/lib/spoom/sorbet/lsp.rb#173 - sig do - params( - uri: ::String, - line: ::Integer, - column: ::Integer, - include_decl: T::Boolean - ).returns(T::Array[::Spoom::LSP::Location]) - end - def references(uri, line, column, include_decl = T.unsafe(nil)); end +# source://spoom/lib/spoom/sorbet/metrics.rb#8 +module Spoom::Sorbet::MetricsParser + class << self + # source://spoom/lib/spoom/sorbet/metrics.rb#15 + sig { params(path: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } + def parse_file(path, prefix = T.unsafe(nil)); end - # source://spoom/lib/spoom/sorbet/lsp.rb#37 - sig { params(message: ::Spoom::LSP::Message).returns(T.nilable(T::Hash[T.untyped, T.untyped])) } - def send(message); end + # source://spoom/lib/spoom/sorbet/metrics.rb#25 + sig { params(obj: T::Hash[::String, T.untyped], prefix: ::String).returns(T::Hash[::String, ::Integer]) } + def parse_hash(obj, prefix = T.unsafe(nil)); end - # source://spoom/lib/spoom/sorbet/lsp.rb#32 - sig { params(json_string: ::String).void } - def send_raw(json_string); end + # source://spoom/lib/spoom/sorbet/metrics.rb#20 + sig { params(string: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } + def parse_string(string, prefix = T.unsafe(nil)); end + end +end - # source://spoom/lib/spoom/sorbet/lsp.rb#110 - sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::SignatureHelp]) } - def signatures(uri, line, column); end +# source://spoom/lib/spoom/sorbet/metrics.rb#9 +Spoom::Sorbet::MetricsParser::DEFAULT_PREFIX = T.let(T.unsafe(nil), String) - # source://spoom/lib/spoom/sorbet/lsp.rb#197 - sig { params(query: ::String).returns(T::Array[::Spoom::LSP::DocumentSymbol]) } - def symbols(query); end +# source://spoom/lib/spoom/sorbet.rb#42 +Spoom::Sorbet::SEGFAULT_CODE = T.let(T.unsafe(nil), Integer) - # source://spoom/lib/spoom/sorbet/lsp.rb#152 - sig { params(uri: ::String, line: ::Integer, column: ::Integer).returns(T::Array[::Spoom::LSP::Location]) } - def type_definitions(uri, line, column); end -end +# source://spoom/lib/spoom/sorbet/sigils.rb#9 +module Spoom::Sorbet::Sigils + class << self + # changes the sigil in the file at the passed path to the specified new strictness + # + # source://spoom/lib/spoom/sorbet/sigils.rb#72 + sig { params(path: T.any(::Pathname, ::String), new_strictness: ::String).returns(T::Boolean) } + def change_sigil_in_file(path, new_strictness); end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#178 -class Spoom::LSP::Diagnostic < ::T::Struct - include ::Spoom::LSP::PrintableSymbol + # changes the sigil to have a new strictness in a list of files + # + # source://spoom/lib/spoom/sorbet/sigils.rb#83 + sig { params(path_list: T::Array[::String], new_strictness: ::String).returns(T::Array[::String]) } + def change_sigil_in_files(path_list, new_strictness); end - const :range, ::Spoom::LSP::Range - const :code, ::Integer - const :message, ::String - const :information, ::Object + # returns a string containing the strictness of a sigil in a file at the passed path + # * returns nil if no sigil + # + # source://spoom/lib/spoom/sorbet/sigils.rb#63 + sig { params(path: T.any(::Pathname, ::String)).returns(T.nilable(::String)) } + def file_strictness(path); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#202 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end + # returns the full sigil comment string for the passed strictness + # + # source://spoom/lib/spoom/sorbet/sigils.rb#38 + sig { params(strictness: ::String).returns(::String) } + def sigil_string(strictness); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#207 - sig { returns(::String) } - def to_s; end + # returns the strictness of a sigil in the passed file content string (nil if no sigil) + # + # source://spoom/lib/spoom/sorbet/sigils.rb#50 + sig { params(content: ::String).returns(T.nilable(::String)) } + def strictness_in_content(content); end - class << self - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#191 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Diagnostic) } - def from_json(json); end + # returns a string which is the passed content but with the sigil updated to a new strictness + # + # source://spoom/lib/spoom/sorbet/sigils.rb#56 + sig { params(content: ::String, new_strictness: ::String).returns(::String) } + def update_sigil(content, new_strictness); end - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end + # returns true if the passed string is a valid strictness (else false) + # + # source://spoom/lib/spoom/sorbet/sigils.rb#44 + sig { params(strictness: ::String).returns(T::Boolean) } + def valid_strictness?(strictness); end end end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#212 -class Spoom::LSP::DocumentSymbol < ::T::Struct - include ::Spoom::LSP::PrintableSymbol +# source://spoom/lib/spoom/sorbet/sigils.rb#31 +Spoom::Sorbet::Sigils::SIGIL_REGEXP = T.let(T.unsafe(nil), Regexp) - const :name, ::String - const :detail, T.nilable(::String) - const :kind, ::Integer - const :location, T.nilable(::Spoom::LSP::Location) - const :range, T.nilable(::Spoom::LSP::Range) - const :children, T::Array[::Spoom::LSP::DocumentSymbol] +# source://spoom/lib/spoom/sorbet/sigils.rb#13 +Spoom::Sorbet::Sigils::STRICTNESS_FALSE = T.let(T.unsafe(nil), String) - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#240 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end +# source://spoom/lib/spoom/sorbet/sigils.rb#12 +Spoom::Sorbet::Sigils::STRICTNESS_IGNORE = T.let(T.unsafe(nil), String) - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#272 - sig { returns(::String) } - def kind_string; end +# source://spoom/lib/spoom/sorbet/sigils.rb#17 +Spoom::Sorbet::Sigils::STRICTNESS_INTERNAL = T.let(T.unsafe(nil), String) - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#267 - sig { returns(::String) } - def to_s; end +# source://spoom/lib/spoom/sorbet/sigils.rb#15 +Spoom::Sorbet::Sigils::STRICTNESS_STRICT = T.let(T.unsafe(nil), String) - class << self - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#227 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::DocumentSymbol) } - def from_json(json); end +# source://spoom/lib/spoom/sorbet/sigils.rb#16 +Spoom::Sorbet::Sigils::STRICTNESS_STRONG = T.let(T.unsafe(nil), String) - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end - end +# source://spoom/lib/spoom/sorbet/sigils.rb#14 +Spoom::Sorbet::Sigils::STRICTNESS_TRUE = T.let(T.unsafe(nil), String) + +# source://spoom/lib/spoom/sorbet/sigils.rb#19 +Spoom::Sorbet::Sigils::VALID_STRICTNESS = T.let(T.unsafe(nil), Array) + +# source://spoom/lib/spoom/timeline.rb#5 +class Spoom::Timeline + # source://spoom/lib/spoom/timeline.rb#9 + sig { params(context: ::Spoom::Context, from: ::Time, to: ::Time).void } + def initialize(context, from, to); end + + # Return one commit for each date in `dates` + # + # source://spoom/lib/spoom/timeline.rb#36 + sig { params(dates: T::Array[::Time]).returns(T::Array[::Spoom::Git::Commit]) } + def commits_for_dates(dates); end + + # Return all months between `from` and `to` + # + # source://spoom/lib/spoom/timeline.rb#23 + sig { returns(T::Array[::Time]) } + def months; end + + # Return one commit for each month between `from` and `to` + # + # source://spoom/lib/spoom/timeline.rb#17 + sig { returns(T::Array[::Spoom::Git::Commit]) } + def ticks; end end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#276 -Spoom::LSP::DocumentSymbol::SYMBOL_KINDS = T.let(T.unsafe(nil), Hash) +# source://spoom/lib/spoom/version.rb#5 +Spoom::VERSION = T.let(T.unsafe(nil), String) -# source://spoom/lib/spoom/sorbet/lsp/errors.rb#6 -class Spoom::LSP::Error < ::StandardError; end +# source://spoom/lib/spoom/visitor.rb#7 +class Spoom::Visitor < ::Prism::Visitor + # source://spoom/lib/spoom/visitor.rb#16 + sig { override.params(node: ::Prism::AliasGlobalVariableNode).void } + def visit_alias_global_variable_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/errors.rb#7 -class Spoom::LSP::Error::AlreadyOpen < ::Spoom::LSP::Error; end + # source://spoom/lib/spoom/visitor.rb#21 + sig { override.params(node: ::Prism::AliasMethodNode).void } + def visit_alias_method_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/errors.rb#8 -class Spoom::LSP::Error::BadHeaders < ::Spoom::LSP::Error; end + # source://spoom/lib/spoom/visitor.rb#26 + sig { override.params(node: ::Prism::AlternationPatternNode).void } + def visit_alternation_pattern_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/errors.rb#10 -class Spoom::LSP::Error::Diagnostics < ::Spoom::LSP::Error - # source://spoom/lib/spoom/sorbet/lsp/errors.rb#32 - sig { params(uri: ::String, diagnostics: T::Array[::Spoom::LSP::Diagnostic]).void } - def initialize(uri, diagnostics); end + # source://spoom/lib/spoom/visitor.rb#31 + sig { override.params(node: ::Prism::AndNode).void } + def visit_and_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/errors.rb#17 - sig { returns(T::Array[::Spoom::LSP::Diagnostic]) } - def diagnostics; end + # source://spoom/lib/spoom/visitor.rb#36 + sig { override.params(node: ::Prism::ArgumentsNode).void } + def visit_arguments_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/errors.rb#14 - sig { returns(::String) } - def uri; end + # source://spoom/lib/spoom/visitor.rb#41 + sig { override.params(node: ::Prism::ArrayNode).void } + def visit_array_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/lsp/errors.rb#23 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Error::Diagnostics) } - def from_json(json); end - end -end + # source://spoom/lib/spoom/visitor.rb#46 + sig { override.params(node: ::Prism::ArrayPatternNode).void } + def visit_array_pattern_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#19 -class Spoom::LSP::Hover < ::T::Struct - include ::Spoom::LSP::PrintableSymbol + # source://spoom/lib/spoom/visitor.rb#51 + sig { override.params(node: ::Prism::AssocNode).void } + def visit_assoc_node(node); end - const :contents, ::String - const :range, T.nilable(T::Range[T.untyped]) + # source://spoom/lib/spoom/visitor.rb#56 + sig { override.params(node: ::Prism::AssocSplatNode).void } + def visit_assoc_splat_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#39 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end + # source://spoom/lib/spoom/visitor.rb#61 + sig { override.params(node: ::Prism::BackReferenceReadNode).void } + def visit_back_reference_read_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#45 - sig { returns(::String) } - def to_s; end + # source://spoom/lib/spoom/visitor.rb#66 + sig { override.params(node: ::Prism::BeginNode).void } + def visit_begin_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#30 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Hover) } - def from_json(json); end + # source://spoom/lib/spoom/visitor.rb#71 + sig { override.params(node: ::Prism::BlockArgumentNode).void } + def visit_block_argument_node(node); end - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end - end -end + # source://spoom/lib/spoom/visitor.rb#76 + sig { override.params(node: ::Prism::BlockLocalVariableNode).void } + def visit_block_local_variable_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#112 -class Spoom::LSP::Location < ::T::Struct - include ::Spoom::LSP::PrintableSymbol + # source://spoom/lib/spoom/visitor.rb#81 + sig { override.params(node: ::Prism::BlockNode).void } + def visit_block_node(node); end - const :uri, ::String - const :range, ::Spoom::LSP::Range + # source://spoom/lib/spoom/visitor.rb#86 + sig { override.params(node: ::Prism::BlockParameterNode).void } + def visit_block_parameter_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#132 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end + # source://spoom/lib/spoom/visitor.rb#91 + sig { override.params(node: ::Prism::BlockParametersNode).void } + def visit_block_parameters_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#138 - sig { returns(::String) } - def to_s; end + # source://spoom/lib/spoom/visitor.rb#96 + sig { override.params(node: ::Prism::BreakNode).void } + def visit_break_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#123 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Location) } - def from_json(json); end + # source://spoom/lib/spoom/visitor.rb#101 + sig { override.params(node: ::Prism::CallAndWriteNode).void } + def visit_call_and_write_node(node); end + + # source://spoom/lib/spoom/visitor.rb#106 + sig { override.params(node: ::Prism::CallNode).void } + def visit_call_node(node); end + + # source://spoom/lib/spoom/visitor.rb#111 + sig { override.params(node: ::Prism::CallOperatorWriteNode).void } + def visit_call_operator_write_node(node); end + + # source://spoom/lib/spoom/visitor.rb#116 + sig { override.params(node: ::Prism::CallOrWriteNode).void } + def visit_call_or_write_node(node); end - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end - end -end + # source://spoom/lib/spoom/visitor.rb#121 + sig { override.params(node: ::Prism::CallTargetNode).void } + def visit_call_target_node(node); end -# A general message as defined by JSON-RPC. -# -# The language server protocol always uses `"2.0"` as the `jsonrpc` version. -# -# source://spoom/lib/spoom/sorbet/lsp/base.rb#12 -class Spoom::LSP::Message - # source://spoom/lib/spoom/sorbet/lsp/base.rb#16 - sig { void } - def initialize; end + # source://spoom/lib/spoom/visitor.rb#126 + sig { override.params(node: ::Prism::CapturePatternNode).void } + def visit_capture_pattern_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/base.rb#21 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def as_json; end + # source://spoom/lib/spoom/visitor.rb#131 + sig { override.params(node: ::Prism::CaseMatchNode).void } + def visit_case_match_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/base.rb#29 - sig { params(args: T.untyped).returns(::String) } - def to_json(*args); end -end + # source://spoom/lib/spoom/visitor.rb#136 + sig { override.params(node: ::Prism::CaseNode).void } + def visit_case_node(node); end -# A notification message. -# -# A processed notification message must not send a response back. They work like events. -# -# source://spoom/lib/spoom/sorbet/lsp/base.rb#58 -class Spoom::LSP::Notification < ::Spoom::LSP::Message - # source://spoom/lib/spoom/sorbet/lsp/base.rb#68 - sig { params(method: ::String, params: T::Hash[T.untyped, T.untyped]).void } - def initialize(method, params); end + # source://spoom/lib/spoom/visitor.rb#11 + sig { override.params(node: ::Prism::Node).void } + def visit_child_nodes(node); end - # source://spoom/lib/spoom/sorbet/lsp/base.rb#62 - sig { returns(::String) } - def method; end + # source://spoom/lib/spoom/visitor.rb#141 + sig { override.params(node: ::Prism::ClassNode).void } + def visit_class_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/base.rb#65 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def params; end -end + # source://spoom/lib/spoom/visitor.rb#146 + sig { override.params(node: ::Prism::ClassVariableAndWriteNode).void } + def visit_class_variable_and_write_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#50 -class Spoom::LSP::Position < ::T::Struct - include ::Spoom::LSP::PrintableSymbol + # source://spoom/lib/spoom/visitor.rb#151 + sig { override.params(node: ::Prism::ClassVariableOperatorWriteNode).void } + def visit_class_variable_operator_write_node(node); end - const :line, ::Integer - const :char, ::Integer + # source://spoom/lib/spoom/visitor.rb#156 + sig { override.params(node: ::Prism::ClassVariableOrWriteNode).void } + def visit_class_variable_or_write_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#70 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end + # source://spoom/lib/spoom/visitor.rb#161 + sig { override.params(node: ::Prism::ClassVariableReadNode).void } + def visit_class_variable_read_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#75 - sig { returns(::String) } - def to_s; end + # source://spoom/lib/spoom/visitor.rb#166 + sig { override.params(node: ::Prism::ClassVariableTargetNode).void } + def visit_class_variable_target_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#61 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Position) } - def from_json(json); end + # source://spoom/lib/spoom/visitor.rb#171 + sig { override.params(node: ::Prism::ClassVariableWriteNode).void } + def visit_class_variable_write_node(node); end - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end - end -end + # source://spoom/lib/spoom/visitor.rb#176 + sig { override.params(node: ::Prism::ConstantAndWriteNode).void } + def visit_constant_and_write_node(node); end -# @abstract Subclasses must implement the `abstract` methods below. -# -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#9 -module Spoom::LSP::PrintableSymbol - interface! + # source://spoom/lib/spoom/visitor.rb#181 + sig { override.params(node: ::Prism::ConstantOperatorWriteNode).void } + def visit_constant_operator_write_node(node); end - # @abstract - # - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#16 - sig { abstract.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end -end + # source://spoom/lib/spoom/visitor.rb#186 + sig { override.params(node: ::Prism::ConstantOrWriteNode).void } + def visit_constant_or_write_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#80 -class Spoom::LSP::Range < ::T::Struct - include ::Spoom::LSP::PrintableSymbol + # source://spoom/lib/spoom/visitor.rb#191 + sig { override.params(node: ::Prism::ConstantPathAndWriteNode).void } + def visit_constant_path_and_write_node(node); end - const :start, ::Spoom::LSP::Position - const :end, ::Spoom::LSP::Position + # source://spoom/lib/spoom/visitor.rb#196 + sig { override.params(node: ::Prism::ConstantPathNode).void } + def visit_constant_path_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#100 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end + # source://spoom/lib/spoom/visitor.rb#201 + sig { override.params(node: ::Prism::ConstantPathOperatorWriteNode).void } + def visit_constant_path_operator_write_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#107 - sig { returns(::String) } - def to_s; end + # source://spoom/lib/spoom/visitor.rb#206 + sig { override.params(node: ::Prism::ConstantPathOrWriteNode).void } + def visit_constant_path_or_write_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#91 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::Range) } - def from_json(json); end + # source://spoom/lib/spoom/visitor.rb#211 + sig { override.params(node: ::Prism::ConstantPathTargetNode).void } + def visit_constant_path_target_node(node); end - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end - end -end + # source://spoom/lib/spoom/visitor.rb#216 + sig { override.params(node: ::Prism::ConstantPathWriteNode).void } + def visit_constant_path_write_node(node); end -# A request message to describe a request between the client and the server. -# -# Every processed request must send a response back to the sender of the request. -# -# source://spoom/lib/spoom/sorbet/lsp/base.rb#37 -class Spoom::LSP::Request < ::Spoom::LSP::Message - # source://spoom/lib/spoom/sorbet/lsp/base.rb#47 - sig { params(id: ::Integer, method: ::String, params: T::Hash[T.untyped, T.untyped]).void } - def initialize(id, method, params); end + # source://spoom/lib/spoom/visitor.rb#221 + sig { override.params(node: ::Prism::ConstantReadNode).void } + def visit_constant_read_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/base.rb#41 - sig { returns(::Integer) } - def id; end + # source://spoom/lib/spoom/visitor.rb#226 + sig { override.params(node: ::Prism::ConstantTargetNode).void } + def visit_constant_target_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/base.rb#44 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def params; end -end + # source://spoom/lib/spoom/visitor.rb#231 + sig { override.params(node: ::Prism::ConstantWriteNode).void } + def visit_constant_write_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/errors.rb#40 -class Spoom::LSP::ResponseError < ::Spoom::LSP::Error - # source://spoom/lib/spoom/sorbet/lsp/errors.rb#63 - sig { params(code: ::Integer, message: ::String, data: T::Hash[T.untyped, T.untyped]).void } - def initialize(code, message, data); end + # source://spoom/lib/spoom/visitor.rb#236 + sig { override.params(node: ::Prism::DefNode).void } + def visit_def_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/errors.rb#44 - sig { returns(::Integer) } - def code; end + # source://spoom/lib/spoom/visitor.rb#241 + sig { override.params(node: ::Prism::DefinedNode).void } + def visit_defined_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/errors.rb#47 - sig { returns(T::Hash[T.untyped, T.untyped]) } - def data; end + # source://spoom/lib/spoom/visitor.rb#246 + sig { override.params(node: ::Prism::ElseNode).void } + def visit_else_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/lsp/errors.rb#53 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::ResponseError) } - def from_json(json); end - end -end + # source://spoom/lib/spoom/visitor.rb#251 + sig { override.params(node: ::Prism::EmbeddedStatementsNode).void } + def visit_embedded_statements_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#143 -class Spoom::LSP::SignatureHelp < ::T::Struct - include ::Spoom::LSP::PrintableSymbol + # source://spoom/lib/spoom/visitor.rb#256 + sig { override.params(node: ::Prism::EmbeddedVariableNode).void } + def visit_embedded_variable_node(node); end - const :label, T.nilable(::String) - const :doc, ::Object - const :params, T::Array[T.untyped] + # source://spoom/lib/spoom/visitor.rb#261 + sig { override.params(node: ::Prism::EnsureNode).void } + def visit_ensure_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#165 - sig { override.params(printer: ::Spoom::LSP::SymbolPrinter).void } - def accept_printer(printer); end + # source://spoom/lib/spoom/visitor.rb#266 + sig { override.params(node: ::Prism::FalseNode).void } + def visit_false_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#173 - sig { returns(::String) } - def to_s; end + # source://spoom/lib/spoom/visitor.rb#271 + sig { override.params(node: ::Prism::FindPatternNode).void } + def visit_find_pattern_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#155 - sig { params(json: T::Hash[T.untyped, T.untyped]).returns(::Spoom::LSP::SignatureHelp) } - def from_json(json); end + # source://spoom/lib/spoom/visitor.rb#276 + sig { override.params(node: ::Prism::FlipFlopNode).void } + def visit_flip_flop_node(node); end - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 - def inherited(s); end - end -end + # source://spoom/lib/spoom/visitor.rb#281 + sig { override.params(node: ::Prism::FloatNode).void } + def visit_float_node(node); end -# source://spoom/lib/spoom/sorbet/lsp/structures.rb#309 -class Spoom::LSP::SymbolPrinter < ::Spoom::Printer - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#326 - sig do - params( - out: T.any(::IO, ::StringIO), - colors: T::Boolean, - indent_level: ::Integer, - prefix: T.nilable(::String) - ).void - end - def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil), prefix: T.unsafe(nil)); end + # source://spoom/lib/spoom/visitor.rb#286 + sig { override.params(node: ::Prism::ForNode).void } + def visit_for_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#348 - sig { params(uri: ::String).returns(::String) } - def clean_uri(uri); end + # source://spoom/lib/spoom/visitor.rb#291 + sig { override.params(node: ::Prism::ForwardingArgumentsNode).void } + def visit_forwarding_arguments_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#316 - sig { returns(T.nilable(::String)) } - def prefix; end + # source://spoom/lib/spoom/visitor.rb#296 + sig { override.params(node: ::Prism::ForwardingParameterNode).void } + def visit_forwarding_parameter_node(node); end - # @return [String, nil] - # - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#316 - def prefix=(_arg0); end + # source://spoom/lib/spoom/visitor.rb#301 + sig { override.params(node: ::Prism::ForwardingSuperNode).void } + def visit_forwarding_super_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#356 - sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } - def print_list(objects); end + # source://spoom/lib/spoom/visitor.rb#306 + sig { override.params(node: ::Prism::GlobalVariableAndWriteNode).void } + def visit_global_variable_and_write_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#336 - sig { params(object: T.nilable(::Spoom::LSP::PrintableSymbol)).void } - def print_object(object); end + # source://spoom/lib/spoom/visitor.rb#311 + sig { override.params(node: ::Prism::GlobalVariableOperatorWriteNode).void } + def visit_global_variable_operator_write_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#343 - sig { params(objects: T::Array[::Spoom::LSP::PrintableSymbol]).void } - def print_objects(objects); end + # source://spoom/lib/spoom/visitor.rb#316 + sig { override.params(node: ::Prism::GlobalVariableOrWriteNode).void } + def visit_global_variable_or_write_node(node); end - # source://spoom/lib/spoom/sorbet/lsp/structures.rb#313 - sig { returns(T::Set[::Integer]) } - def seen; end -end + # source://spoom/lib/spoom/visitor.rb#321 + sig { override.params(node: ::Prism::GlobalVariableReadNode).void } + def visit_global_variable_read_node(node); end + + # source://spoom/lib/spoom/visitor.rb#326 + sig { override.params(node: ::Prism::GlobalVariableTargetNode).void } + def visit_global_variable_target_node(node); end -# source://spoom/lib/spoom/printer.rb#7 -class Spoom::Printer - include ::Spoom::Colorize + # source://spoom/lib/spoom/visitor.rb#331 + sig { override.params(node: ::Prism::GlobalVariableWriteNode).void } + def visit_global_variable_write_node(node); end - # source://spoom/lib/spoom/printer.rb#17 - sig { params(out: T.any(::IO, ::StringIO), colors: T::Boolean, indent_level: ::Integer).void } - def initialize(out: T.unsafe(nil), colors: T.unsafe(nil), indent_level: T.unsafe(nil)); end + # source://spoom/lib/spoom/visitor.rb#336 + sig { override.params(node: ::Prism::HashNode).void } + def visit_hash_node(node); end - # Colorize `string` with color if `@colors` - # - # source://spoom/lib/spoom/printer.rb#78 - sig { params(string: ::String, color: ::Spoom::Color).returns(::String) } - def colorize(string, *color); end + # source://spoom/lib/spoom/visitor.rb#341 + sig { override.params(node: ::Prism::HashPatternNode).void } + def visit_hash_pattern_node(node); end - # Decrease indent level - # - # source://spoom/lib/spoom/printer.rb#31 - sig { void } - def dedent; end + # source://spoom/lib/spoom/visitor.rb#346 + sig { override.params(node: ::Prism::IfNode).void } + def visit_if_node(node); end - # Increase indent level - # - # source://spoom/lib/spoom/printer.rb#25 - sig { void } - def indent; end + # source://spoom/lib/spoom/visitor.rb#351 + sig { override.params(node: ::Prism::ImaginaryNode).void } + def visit_imaginary_node(node); end - # source://spoom/lib/spoom/printer.rb#14 - sig { returns(T.any(::IO, ::StringIO)) } - def out; end + # source://spoom/lib/spoom/visitor.rb#356 + sig { override.params(node: ::Prism::ImplicitNode).void } + def visit_implicit_node(node); end - # @return [IO, StringIO] - # - # source://spoom/lib/spoom/printer.rb#14 - def out=(_arg0); end + # source://spoom/lib/spoom/visitor.rb#361 + sig { override.params(node: ::Prism::ImplicitRestNode).void } + def visit_implicit_rest_node(node); end - # Print `string` into `out` - # - # source://spoom/lib/spoom/printer.rb#37 - sig { params(string: T.nilable(::String)).void } - def print(string); end + # source://spoom/lib/spoom/visitor.rb#366 + sig { override.params(node: ::Prism::InNode).void } + def visit_in_node(node); end - # Print `string` colored with `color` into `out` - # - # Does not use colors unless `@colors`. - # - # source://spoom/lib/spoom/printer.rb#47 - sig { params(string: T.nilable(::String), color: ::Spoom::Color).void } - def print_colored(string, *color); end + # source://spoom/lib/spoom/visitor.rb#371 + sig { override.params(node: ::Prism::IndexAndWriteNode).void } + def visit_index_and_write_node(node); end - # Print `string` with indent and newline - # - # source://spoom/lib/spoom/printer.rb#62 - sig { params(string: T.nilable(::String)).void } - def printl(string); end + # source://spoom/lib/spoom/visitor.rb#376 + sig { override.params(node: ::Prism::IndexOperatorWriteNode).void } + def visit_index_operator_write_node(node); end - # Print a new line into `out` - # - # source://spoom/lib/spoom/printer.rb#56 - sig { void } - def printn; end + # source://spoom/lib/spoom/visitor.rb#381 + sig { override.params(node: ::Prism::IndexOrWriteNode).void } + def visit_index_or_write_node(node); end - # Print an indent space into `out` - # - # source://spoom/lib/spoom/printer.rb#72 - sig { void } - def printt; end -end + # source://spoom/lib/spoom/visitor.rb#386 + sig { override.params(node: ::Prism::IndexTargetNode).void } + def visit_index_target_node(node); end -# source://spoom/lib/spoom.rb#10 -Spoom::SPOOM_PATH = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#391 + sig { override.params(node: ::Prism::InstanceVariableAndWriteNode).void } + def visit_instance_variable_and_write_node(node); end -# source://spoom/lib/spoom/sorbet/config.rb#5 -module Spoom::Sorbet; end + # source://spoom/lib/spoom/visitor.rb#396 + sig { override.params(node: ::Prism::InstanceVariableOperatorWriteNode).void } + def visit_instance_variable_operator_write_node(node); end -# source://spoom/lib/spoom/sorbet.rb#39 -Spoom::Sorbet::BIN_PATH = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#401 + sig { override.params(node: ::Prism::InstanceVariableOrWriteNode).void } + def visit_instance_variable_or_write_node(node); end -# source://spoom/lib/spoom/sorbet.rb#36 -Spoom::Sorbet::CONFIG_PATH = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#406 + sig { override.params(node: ::Prism::InstanceVariableReadNode).void } + def visit_instance_variable_read_node(node); end -# Parse Sorbet config files -# -# Parses a Sorbet config file: -# -# ```ruby -# config = Spoom::Sorbet::Config.parse_file("sorbet/config") -# puts config.paths # "." -# ``` -# -# Parses a Sorbet config string: -# -# ```ruby -# config = Spoom::Sorbet::Config.parse_string(<<~CONFIG) -# a -# --file=b -# --ignore=c -# CONFIG -# puts config.paths # "a", "b" -# puts config.ignore # "c" -# ``` -# -# source://spoom/lib/spoom/sorbet/config.rb#26 -class Spoom::Sorbet::Config - # source://spoom/lib/spoom/sorbet/config.rb#38 - sig { void } - def initialize; end + # source://spoom/lib/spoom/visitor.rb#411 + sig { override.params(node: ::Prism::InstanceVariableTargetNode).void } + def visit_instance_variable_target_node(node); end - # @return [Array<String>] - # - # source://spoom/lib/spoom/sorbet/config.rb#32 - def allowed_extensions; end + # source://spoom/lib/spoom/visitor.rb#416 + sig { override.params(node: ::Prism::InstanceVariableWriteNode).void } + def visit_instance_variable_write_node(node); end - # @return [Array<String>] - # - # source://spoom/lib/spoom/sorbet/config.rb#32 - def allowed_extensions=(_arg0); end + # source://spoom/lib/spoom/visitor.rb#421 + sig { override.params(node: ::Prism::IntegerNode).void } + def visit_integer_node(node); end - # source://spoom/lib/spoom/sorbet/config.rb#46 - sig { returns(::Spoom::Sorbet::Config) } - def copy; end + # source://spoom/lib/spoom/visitor.rb#426 + sig { override.params(node: ::Prism::InterpolatedMatchLastLineNode).void } + def visit_interpolated_match_last_line_node(node); end - # @return [Array<String>] - # - # source://spoom/lib/spoom/sorbet/config.rb#32 - def ignore; end + # source://spoom/lib/spoom/visitor.rb#431 + sig { override.params(node: ::Prism::InterpolatedRegularExpressionNode).void } + def visit_interpolated_regular_expression_node(node); end - # @return [Array<String>] - # - # source://spoom/lib/spoom/sorbet/config.rb#32 - def ignore=(_arg0); end + # source://spoom/lib/spoom/visitor.rb#436 + sig { override.params(node: ::Prism::InterpolatedStringNode).void } + def visit_interpolated_string_node(node); end - # source://spoom/lib/spoom/sorbet/config.rb#35 - sig { returns(T::Boolean) } - def no_stdlib; end + # source://spoom/lib/spoom/visitor.rb#441 + sig { override.params(node: ::Prism::InterpolatedSymbolNode).void } + def visit_interpolated_symbol_node(node); end - # @return [Boolean] - # - # source://spoom/lib/spoom/sorbet/config.rb#35 - def no_stdlib=(_arg0); end + # source://spoom/lib/spoom/visitor.rb#446 + sig { override.params(node: ::Prism::InterpolatedXStringNode).void } + def visit_interpolated_x_string_node(node); end - # Returns self as a string of options that can be passed to Sorbet - # - # Example: - # ~~~rb - # config = Sorbet::Config.new - # config.paths << "/foo" - # config.paths << "/bar" - # config.ignore << "/baz" - # config.allowed_extensions << ".rb" - # - # puts config.options_string # "/foo /bar --ignore /baz --allowed-extension .rb" - # ~~~ - # - # source://spoom/lib/spoom/sorbet/config.rb#68 - sig { returns(::String) } - def options_string; end + # source://spoom/lib/spoom/visitor.rb#451 + sig { override.params(node: ::Prism::KeywordHashNode).void } + def visit_keyword_hash_node(node); end - # source://spoom/lib/spoom/sorbet/config.rb#32 - sig { returns(T::Array[::String]) } - def paths; end + # source://spoom/lib/spoom/visitor.rb#456 + sig { override.params(node: ::Prism::KeywordRestParameterNode).void } + def visit_keyword_rest_parameter_node(node); end - # @return [Array<String>] - # - # source://spoom/lib/spoom/sorbet/config.rb#32 - def paths=(_arg0); end + # source://spoom/lib/spoom/visitor.rb#461 + sig { override.params(node: ::Prism::LambdaNode).void } + def visit_lambda_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/config.rb#81 - sig { params(sorbet_config_path: ::String).returns(::Spoom::Sorbet::Config) } - def parse_file(sorbet_config_path); end + # source://spoom/lib/spoom/visitor.rb#466 + sig { override.params(node: ::Prism::LocalVariableAndWriteNode).void } + def visit_local_variable_and_write_node(node); end - # source://spoom/lib/spoom/sorbet/config.rb#86 - sig { params(sorbet_config: ::String).returns(::Spoom::Sorbet::Config) } - def parse_string(sorbet_config); end + # source://spoom/lib/spoom/visitor.rb#471 + sig { override.params(node: ::Prism::LocalVariableOperatorWriteNode).void } + def visit_local_variable_operator_write_node(node); end - private + # source://spoom/lib/spoom/visitor.rb#476 + sig { override.params(node: ::Prism::LocalVariableOrWriteNode).void } + def visit_local_variable_or_write_node(node); end - # source://spoom/lib/spoom/sorbet/config.rb#150 - sig { params(line: ::String).returns(::String) } - def parse_option(line); end - end -end + # source://spoom/lib/spoom/visitor.rb#481 + sig { override.params(node: ::Prism::LocalVariableReadNode).void } + def visit_local_variable_read_node(node); end -# source://spoom/lib/spoom/sorbet/config.rb#29 -Spoom::Sorbet::Config::DEFAULT_ALLOWED_EXTENSIONS = T.let(T.unsafe(nil), Array) + # source://spoom/lib/spoom/visitor.rb#486 + sig { override.params(node: ::Prism::LocalVariableTargetNode).void } + def visit_local_variable_target_node(node); end -# source://spoom/lib/spoom/sorbet.rb#14 -class Spoom::Sorbet::Error < ::StandardError - # source://spoom/lib/spoom/sorbet.rb#29 - sig { params(message: ::String, result: ::Spoom::ExecResult).void } - def initialize(message, result); end + # source://spoom/lib/spoom/visitor.rb#491 + sig { override.params(node: ::Prism::LocalVariableWriteNode).void } + def visit_local_variable_write_node(node); end - # source://spoom/lib/spoom/sorbet.rb#21 - sig { returns(::Spoom::ExecResult) } - def result; end -end + # source://spoom/lib/spoom/visitor.rb#496 + sig { override.params(node: ::Prism::MatchLastLineNode).void } + def visit_match_last_line_node(node); end -# source://spoom/lib/spoom/sorbet.rb#17 -class Spoom::Sorbet::Error::Killed < ::Spoom::Sorbet::Error; end + # source://spoom/lib/spoom/visitor.rb#501 + sig { override.params(node: ::Prism::MatchPredicateNode).void } + def visit_match_predicate_node(node); end -# source://spoom/lib/spoom/sorbet.rb#18 -class Spoom::Sorbet::Error::Segfault < ::Spoom::Sorbet::Error; end + # source://spoom/lib/spoom/visitor.rb#506 + sig { override.params(node: ::Prism::MatchRequiredNode).void } + def visit_match_required_node(node); end -# source://spoom/lib/spoom/sorbet/errors.rb#6 -module Spoom::Sorbet::Errors - class << self - # source://spoom/lib/spoom/sorbet/errors.rb#13 - sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error]).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } - def sort_errors_by_code(errors); end - end -end + # source://spoom/lib/spoom/visitor.rb#511 + sig { override.params(node: ::Prism::MatchWriteNode).void } + def visit_match_write_node(node); end -# source://spoom/lib/spoom/sorbet/errors.rb#7 -Spoom::Sorbet::Errors::DEFAULT_ERROR_URL_BASE = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#516 + sig { override.params(node: ::Prism::MissingNode).void } + def visit_missing_node(node); end -# source://spoom/lib/spoom/sorbet/errors.rb#125 -class Spoom::Sorbet::Errors::Error - include ::Comparable + # source://spoom/lib/spoom/visitor.rb#521 + sig { override.params(node: ::Prism::ModuleNode).void } + def visit_module_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#151 - sig do - params( - file: T.nilable(::String), - line: T.nilable(::Integer), - message: T.nilable(::String), - code: T.nilable(::Integer), - more: T::Array[::String] - ).void - end - def initialize(file, line, message, code, more = T.unsafe(nil)); end + # source://spoom/lib/spoom/visitor.rb#526 + sig { override.params(node: ::Prism::MultiTargetNode).void } + def visit_multi_target_node(node); end - # By default errors are sorted by location - # - # source://spoom/lib/spoom/sorbet/errors.rb#162 - sig { params(other: T.untyped).returns(::Integer) } - def <=>(other); end + # source://spoom/lib/spoom/visitor.rb#531 + sig { override.params(node: ::Prism::MultiWriteNode).void } + def visit_multi_write_node(node); end - # @return [Integer, nil] - # - # source://spoom/lib/spoom/sorbet/errors.rb#133 - def code; end + # source://spoom/lib/spoom/visitor.rb#536 + sig { override.params(node: ::Prism::NextNode).void } + def visit_next_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#130 - sig { returns(T.nilable(::String)) } - def file; end + # source://spoom/lib/spoom/visitor.rb#541 + sig { override.params(node: ::Prism::NilNode).void } + def visit_nil_node(node); end - # Other files associated with the error - # - # source://spoom/lib/spoom/sorbet/errors.rb#140 - sig { returns(T::Set[::String]) } - def files_from_error_sections; end + # source://spoom/lib/spoom/visitor.rb#546 + sig { override.params(node: ::Prism::NoKeywordsParameterNode).void } + def visit_no_keywords_parameter_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#133 - sig { returns(T.nilable(::Integer)) } - def line; end + # source://spoom/lib/spoom/visitor.rb#551 + sig { override.params(node: ::Prism::NumberedParametersNode).void } + def visit_numbered_parameters_node(node); end - # @return [String, nil] - # - # source://spoom/lib/spoom/sorbet/errors.rb#130 - def message; end + # source://spoom/lib/spoom/visitor.rb#556 + sig { override.params(node: ::Prism::NumberedReferenceReadNode).void } + def visit_numbered_reference_read_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#136 - sig { returns(T::Array[::String]) } - def more; end + # source://spoom/lib/spoom/visitor.rb#561 + sig { override.params(node: ::Prism::OptionalKeywordParameterNode).void } + def visit_optional_keyword_parameter_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#169 - sig { returns(::String) } - def to_s; end -end + # source://spoom/lib/spoom/visitor.rb#566 + sig { override.params(node: ::Prism::OptionalParameterNode).void } + def visit_optional_parameter_node(node); end -# Parse errors from Sorbet output -# -# source://spoom/lib/spoom/sorbet/errors.rb#18 -class Spoom::Sorbet::Errors::Parser - # source://spoom/lib/spoom/sorbet/errors.rb#43 - sig { params(error_url_base: ::String).void } - def initialize(error_url_base: T.unsafe(nil)); end + # source://spoom/lib/spoom/visitor.rb#571 + sig { override.params(node: ::Prism::OrNode).void } + def visit_or_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#50 - sig { params(output: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } - def parse(output); end + # source://spoom/lib/spoom/visitor.rb#576 + sig { override.params(node: ::Prism::ParametersNode).void } + def visit_parameters_node(node); end - private + # source://spoom/lib/spoom/visitor.rb#581 + sig { override.params(node: ::Prism::ParenthesesNode).void } + def visit_parentheses_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#114 - sig { params(line: ::String).void } - def append_error(line); end + # source://spoom/lib/spoom/visitor.rb#586 + sig { override.params(node: ::Prism::PinnedExpressionNode).void } + def visit_pinned_expression_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#106 - sig { void } - def close_error; end + # source://spoom/lib/spoom/visitor.rb#591 + sig { override.params(node: ::Prism::PinnedVariableNode).void } + def visit_pinned_variable_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#73 - sig { params(error_url_base: ::String).returns(::Regexp) } - def error_line_match_regexp(error_url_base); end + # source://spoom/lib/spoom/visitor.rb#596 + sig { override.params(node: ::Prism::PostExecutionNode).void } + def visit_post_execution_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#90 - sig { params(line: ::String).returns(T.nilable(::Spoom::Sorbet::Errors::Error)) } - def match_error_line(line); end + # source://spoom/lib/spoom/visitor.rb#601 + sig { override.params(node: ::Prism::PreExecutionNode).void } + def visit_pre_execution_node(node); end - # source://spoom/lib/spoom/sorbet/errors.rb#99 - sig { params(error: ::Spoom::Sorbet::Errors::Error).void } - def open_error(error); end + # source://spoom/lib/spoom/visitor.rb#606 + sig { override.params(node: ::Prism::ProgramNode).void } + def visit_program_node(node); end - class << self - # source://spoom/lib/spoom/sorbet/errors.rb#36 - sig { params(output: ::String, error_url_base: ::String).returns(T::Array[::Spoom::Sorbet::Errors::Error]) } - def parse_string(output, error_url_base: T.unsafe(nil)); end - end -end + # source://spoom/lib/spoom/visitor.rb#611 + sig { override.params(node: ::Prism::RangeNode).void } + def visit_range_node(node); end -# source://spoom/lib/spoom/sorbet/errors.rb#21 -Spoom::Sorbet::Errors::Parser::HEADER = T.let(T.unsafe(nil), Array) + # source://spoom/lib/spoom/visitor.rb#616 + sig { override.params(node: ::Prism::RationalNode).void } + def visit_rational_node(node); end -# source://spoom/lib/spoom/sorbet.rb#37 -Spoom::Sorbet::GEM_PATH = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#621 + sig { override.params(node: ::Prism::RedoNode).void } + def visit_redo_node(node); end -# source://spoom/lib/spoom/sorbet.rb#38 -Spoom::Sorbet::GEM_VERSION = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#626 + sig { override.params(node: ::Prism::RegularExpressionNode).void } + def visit_regular_expression_node(node); end -# source://spoom/lib/spoom/sorbet.rb#41 -Spoom::Sorbet::KILLED_CODE = T.let(T.unsafe(nil), Integer) + # source://spoom/lib/spoom/visitor.rb#631 + sig { override.params(node: ::Prism::RequiredKeywordParameterNode).void } + def visit_required_keyword_parameter_node(node); end -# source://spoom/lib/spoom/sorbet/metrics.rb#8 -module Spoom::Sorbet::MetricsParser - class << self - # source://spoom/lib/spoom/sorbet/metrics.rb#15 - sig { params(path: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } - def parse_file(path, prefix = T.unsafe(nil)); end + # source://spoom/lib/spoom/visitor.rb#636 + sig { override.params(node: ::Prism::RequiredParameterNode).void } + def visit_required_parameter_node(node); end - # source://spoom/lib/spoom/sorbet/metrics.rb#25 - sig { params(obj: T::Hash[::String, T.untyped], prefix: ::String).returns(T::Hash[::String, ::Integer]) } - def parse_hash(obj, prefix = T.unsafe(nil)); end + # source://spoom/lib/spoom/visitor.rb#641 + sig { override.params(node: ::Prism::RescueModifierNode).void } + def visit_rescue_modifier_node(node); end - # source://spoom/lib/spoom/sorbet/metrics.rb#20 - sig { params(string: ::String, prefix: ::String).returns(T::Hash[::String, ::Integer]) } - def parse_string(string, prefix = T.unsafe(nil)); end - end -end + # source://spoom/lib/spoom/visitor.rb#646 + sig { override.params(node: ::Prism::RescueNode).void } + def visit_rescue_node(node); end -# source://spoom/lib/spoom/sorbet/metrics.rb#9 -Spoom::Sorbet::MetricsParser::DEFAULT_PREFIX = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#651 + sig { override.params(node: ::Prism::RestParameterNode).void } + def visit_rest_parameter_node(node); end -# source://spoom/lib/spoom/sorbet.rb#42 -Spoom::Sorbet::SEGFAULT_CODE = T.let(T.unsafe(nil), Integer) + # source://spoom/lib/spoom/visitor.rb#656 + sig { override.params(node: ::Prism::RetryNode).void } + def visit_retry_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#9 -module Spoom::Sorbet::Sigils - class << self - # changes the sigil in the file at the passed path to the specified new strictness - # - # source://spoom/lib/spoom/sorbet/sigils.rb#72 - sig { params(path: T.any(::Pathname, ::String), new_strictness: ::String).returns(T::Boolean) } - def change_sigil_in_file(path, new_strictness); end + # source://spoom/lib/spoom/visitor.rb#661 + sig { override.params(node: ::Prism::ReturnNode).void } + def visit_return_node(node); end - # changes the sigil to have a new strictness in a list of files - # - # source://spoom/lib/spoom/sorbet/sigils.rb#83 - sig { params(path_list: T::Array[::String], new_strictness: ::String).returns(T::Array[::String]) } - def change_sigil_in_files(path_list, new_strictness); end + # source://spoom/lib/spoom/visitor.rb#666 + sig { override.params(node: ::Prism::SelfNode).void } + def visit_self_node(node); end - # returns a string containing the strictness of a sigil in a file at the passed path - # * returns nil if no sigil - # - # source://spoom/lib/spoom/sorbet/sigils.rb#63 - sig { params(path: T.any(::Pathname, ::String)).returns(T.nilable(::String)) } - def file_strictness(path); end + # source://spoom/lib/spoom/visitor.rb#671 + sig { override.params(node: ::Prism::SingletonClassNode).void } + def visit_singleton_class_node(node); end - # returns the full sigil comment string for the passed strictness - # - # source://spoom/lib/spoom/sorbet/sigils.rb#38 - sig { params(strictness: ::String).returns(::String) } - def sigil_string(strictness); end + # source://spoom/lib/spoom/visitor.rb#676 + sig { override.params(node: ::Prism::SourceEncodingNode).void } + def visit_source_encoding_node(node); end - # returns the strictness of a sigil in the passed file content string (nil if no sigil) - # - # source://spoom/lib/spoom/sorbet/sigils.rb#50 - sig { params(content: ::String).returns(T.nilable(::String)) } - def strictness_in_content(content); end + # source://spoom/lib/spoom/visitor.rb#681 + sig { override.params(node: ::Prism::SourceFileNode).void } + def visit_source_file_node(node); end - # returns a string which is the passed content but with the sigil updated to a new strictness - # - # source://spoom/lib/spoom/sorbet/sigils.rb#56 - sig { params(content: ::String, new_strictness: ::String).returns(::String) } - def update_sigil(content, new_strictness); end + # source://spoom/lib/spoom/visitor.rb#686 + sig { override.params(node: ::Prism::SourceLineNode).void } + def visit_source_line_node(node); end - # returns true if the passed string is a valid strictness (else false) - # - # source://spoom/lib/spoom/sorbet/sigils.rb#44 - sig { params(strictness: ::String).returns(T::Boolean) } - def valid_strictness?(strictness); end - end -end + # source://spoom/lib/spoom/visitor.rb#691 + sig { override.params(node: ::Prism::SplatNode).void } + def visit_splat_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#31 -Spoom::Sorbet::Sigils::SIGIL_REGEXP = T.let(T.unsafe(nil), Regexp) + # source://spoom/lib/spoom/visitor.rb#696 + sig { override.params(node: ::Prism::StatementsNode).void } + def visit_statements_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#13 -Spoom::Sorbet::Sigils::STRICTNESS_FALSE = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#701 + sig { override.params(node: ::Prism::StringNode).void } + def visit_string_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#12 -Spoom::Sorbet::Sigils::STRICTNESS_IGNORE = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#706 + sig { override.params(node: ::Prism::SuperNode).void } + def visit_super_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#17 -Spoom::Sorbet::Sigils::STRICTNESS_INTERNAL = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#711 + sig { override.params(node: ::Prism::SymbolNode).void } + def visit_symbol_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#15 -Spoom::Sorbet::Sigils::STRICTNESS_STRICT = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#716 + sig { override.params(node: ::Prism::TrueNode).void } + def visit_true_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#16 -Spoom::Sorbet::Sigils::STRICTNESS_STRONG = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#721 + sig { override.params(node: ::Prism::UndefNode).void } + def visit_undef_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#14 -Spoom::Sorbet::Sigils::STRICTNESS_TRUE = T.let(T.unsafe(nil), String) + # source://spoom/lib/spoom/visitor.rb#726 + sig { override.params(node: ::Prism::UnlessNode).void } + def visit_unless_node(node); end -# source://spoom/lib/spoom/sorbet/sigils.rb#19 -Spoom::Sorbet::Sigils::VALID_STRICTNESS = T.let(T.unsafe(nil), Array) + # source://spoom/lib/spoom/visitor.rb#731 + sig { override.params(node: ::Prism::UntilNode).void } + def visit_until_node(node); end -# source://spoom/lib/spoom/timeline.rb#5 -class Spoom::Timeline - # source://spoom/lib/spoom/timeline.rb#9 - sig { params(context: ::Spoom::Context, from: ::Time, to: ::Time).void } - def initialize(context, from, to); end + # source://spoom/lib/spoom/visitor.rb#736 + sig { override.params(node: ::Prism::WhenNode).void } + def visit_when_node(node); end - # Return one commit for each date in `dates` - # - # source://spoom/lib/spoom/timeline.rb#36 - sig { params(dates: T::Array[::Time]).returns(T::Array[::Spoom::Git::Commit]) } - def commits_for_dates(dates); end + # source://spoom/lib/spoom/visitor.rb#741 + sig { override.params(node: ::Prism::WhileNode).void } + def visit_while_node(node); end - # Return all months between `from` and `to` - # - # source://spoom/lib/spoom/timeline.rb#23 - sig { returns(T::Array[::Time]) } - def months; end + # source://spoom/lib/spoom/visitor.rb#746 + sig { override.params(node: ::Prism::XStringNode).void } + def visit_x_string_node(node); end - # Return one commit for each month between `from` and `to` - # - # source://spoom/lib/spoom/timeline.rb#17 - sig { returns(T::Array[::Spoom::Git::Commit]) } - def ticks; end + # source://spoom/lib/spoom/visitor.rb#751 + sig { override.params(node: ::Prism::YieldNode).void } + def visit_yield_node(node); end end - -# source://spoom/lib/spoom/version.rb#5 -Spoom::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/tapioca@0.16.2.rbi b/sorbet/rbi/gems/tapioca@0.16.3.rbi similarity index 98% rename from sorbet/rbi/gems/tapioca@0.16.2.rbi rename to sorbet/rbi/gems/tapioca@0.16.3.rbi index e05d41a8..3c9af8f9 100644 --- a/sorbet/rbi/gems/tapioca@0.16.2.rbi +++ b/sorbet/rbi/gems/tapioca@0.16.3.rbi @@ -55,7 +55,7 @@ module RBI; end # source://tapioca/lib/tapioca/rbi_ext/model.rb#5 class RBI::Tree < ::RBI::NodeWithComments - # source://rbi/0.2.0lib/rbi/model.rb#121 + # source://rbi/0.2.1lib/rbi/model.rb#121 sig do params( loc: T.nilable(::RBI::Loc), @@ -65,15 +65,15 @@ class RBI::Tree < ::RBI::NodeWithComments end def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end - # source://rbi/0.2.0lib/rbi/model.rb#128 + # source://rbi/0.2.1lib/rbi/model.rb#128 sig { params(node: ::RBI::Node).void } def <<(node); end - # source://rbi/0.2.0lib/rbi/rewriters/add_sig_templates.rb#66 + # source://rbi/0.2.1lib/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.2.0lib/rbi/rewriters/annotate.rb#49 + # source://rbi/0.2.1lib/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 @@ -138,35 +138,35 @@ 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.2.0lib/rbi/rewriters/deannotate.rb#41 + # source://rbi/0.2.1lib/rbi/rewriters/deannotate.rb#41 sig { params(annotation: ::String).void } def deannotate!(annotation); end - # source://rbi/0.2.0lib/rbi/model.rb#134 + # source://rbi/0.2.1lib/rbi/model.rb#134 sig { returns(T::Boolean) } def empty?; end - # source://rbi/0.2.0lib/rbi/rewriters/filter_versions.rb#118 + # source://rbi/0.2.1lib/rbi/rewriters/filter_versions.rb#118 sig { params(version: ::Gem::Version).void } def filter_versions!(version); end - # source://rbi/0.2.0lib/rbi/rewriters/flatten_singleton_methods.rb#60 + # source://rbi/0.2.1lib/rbi/rewriters/flatten_singleton_methods.rb#60 sig { void } def flatten_singleton_methods!; end - # source://rbi/0.2.0lib/rbi/rewriters/flatten_visibilities.rb#60 + # source://rbi/0.2.1lib/rbi/rewriters/flatten_visibilities.rb#60 sig { void } def flatten_visibilities!; end - # source://rbi/0.2.0lib/rbi/rewriters/group_nodes.rb#81 + # source://rbi/0.2.1lib/rbi/rewriters/group_nodes.rb#81 sig { void } def group_nodes!; end - # source://rbi/0.2.0lib/rbi/index.rb#68 + # source://rbi/0.2.1lib/rbi/index.rb#68 sig { returns(::RBI::Index) } def index; end - # source://rbi/0.2.0lib/rbi/rewriters/merge_trees.rb#324 + # source://rbi/0.2.1lib/rbi/rewriters/merge_trees.rb#324 sig do params( other: ::RBI::Tree, @@ -177,27 +177,27 @@ 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.2.0lib/rbi/rewriters/nest_non_public_members.rb#46 + # source://rbi/0.2.1lib/rbi/rewriters/nest_non_public_members.rb#46 sig { void } def nest_non_public_members!; end - # source://rbi/0.2.0lib/rbi/rewriters/nest_singleton_methods.rb#36 + # source://rbi/0.2.1lib/rbi/rewriters/nest_singleton_methods.rb#36 sig { void } def nest_singleton_methods!; end - # source://rbi/0.2.0lib/rbi/rewriters/nest_top_level_members.rb#63 + # source://rbi/0.2.1lib/rbi/rewriters/nest_top_level_members.rb#63 sig { void } def nest_top_level_members!; end - # source://rbi/0.2.0lib/rbi/model.rb#112 + # source://rbi/0.2.1lib/rbi/model.rb#112 sig { returns(T::Array[::RBI::Node]) } def nodes; end - # source://rbi/0.2.0lib/rbi/rewriters/attr_to_methods.rb#53 + # source://rbi/0.2.1lib/rbi/rewriters/attr_to_methods.rb#53 sig { void } def replace_attributes_with_methods!; end - # source://rbi/0.2.0lib/rbi/rewriters/sort_nodes.rb#119 + # source://rbi/0.2.1lib/rbi/rewriters/sort_nodes.rb#119 sig { void } def sort_nodes!; end @@ -218,7 +218,7 @@ class RBI::TypedParam < ::T::Struct const :type, ::String class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -1141,7 +1141,7 @@ class Tapioca::ConfigHelper::ConfigError < ::T::Struct const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart] class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -1152,7 +1152,7 @@ class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct const :colors, T::Array[::Symbol] class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -1209,7 +1209,7 @@ class Tapioca::Dsl::Compiler ConstantType = type_member { { upper: Module } } - # source://tapioca/lib/tapioca/dsl/compiler.rb#74 + # source://tapioca/lib/tapioca/dsl/compiler.rb#107 sig do params( pipeline: ::Tapioca::Dsl::Pipeline, @@ -1222,11 +1222,11 @@ class Tapioca::Dsl::Compiler # NOTE: This should eventually accept an `Error` object or `Exception` rather than simply a `String`. # - # source://tapioca/lib/tapioca/dsl/compiler.rb#92 + # source://tapioca/lib/tapioca/dsl/compiler.rb#125 sig { params(error: ::String).void } def add_error(error); end - # source://tapioca/lib/tapioca/dsl/compiler.rb#83 + # source://tapioca/lib/tapioca/dsl/compiler.rb#116 sig { params(compiler_name: ::String).returns(T::Boolean) } def compiler_enabled?(compiler_name); end @@ -1236,7 +1236,7 @@ class Tapioca::Dsl::Compiler # @abstract # - # source://tapioca/lib/tapioca/dsl/compiler.rb#88 + # source://tapioca/lib/tapioca/dsl/compiler.rb#121 sig { abstract.void } def decorate; end @@ -1250,48 +1250,61 @@ class Tapioca::Dsl::Compiler private - # source://tapioca/lib/tapioca/dsl/compiler.rb#141 + # source://tapioca/lib/tapioca/dsl/compiler.rb#174 sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(T::Array[::RBI::TypedParam]) } def compile_method_parameters_to_rbi(method_def); end - # source://tapioca/lib/tapioca/dsl/compiler.rb#177 + # source://tapioca/lib/tapioca/dsl/compiler.rb#210 sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(::String) } def compile_method_return_type_to_rbi(method_def); end - # source://tapioca/lib/tapioca/dsl/compiler.rb#131 + # source://tapioca/lib/tapioca/dsl/compiler.rb#164 sig { params(scope: ::RBI::Scope, method_def: T.any(::Method, ::UnboundMethod), class_method: T::Boolean).void } def create_method_from_def(scope, method_def, class_method: T.unsafe(nil)); end # Get the types of each parameter from a method signature # - # source://tapioca/lib/tapioca/dsl/compiler.rb#105 + # source://tapioca/lib/tapioca/dsl/compiler.rb#138 sig { params(method_def: T.any(::Method, ::UnboundMethod), signature: T.untyped).returns(T::Array[::String]) } def parameters_types_from_signature(method_def, signature); end class << self # @abstract # - # source://tapioca/lib/tapioca/dsl/compiler.rb#37 + # source://tapioca/lib/tapioca/dsl/compiler.rb#39 sig { abstract.returns(T::Enumerable[::Module]) } def gather_constants; end - # source://tapioca/lib/tapioca/dsl/compiler.rb#32 + # source://tapioca/lib/tapioca/dsl/compiler.rb#34 sig { params(constant: ::Module).returns(T::Boolean) } def handles?(constant); end - # source://tapioca/lib/tapioca/dsl/compiler.rb#40 + # source://tapioca/lib/tapioca/dsl/compiler.rb#42 sig { returns(T::Set[::Module]) } def processable_constants; end + # source://tapioca/lib/tapioca/dsl/compiler.rb#50 + sig { params(constants: T::Array[::Module]).void } + def requested_constants=(constants); end + private - # source://tapioca/lib/tapioca/dsl/compiler.rb#50 + # source://tapioca/lib/tapioca/dsl/compiler.rb#75 sig { returns(T::Enumerable[T::Class[T.anything]]) } def all_classes; end - # source://tapioca/lib/tapioca/dsl/compiler.rb#58 + # source://tapioca/lib/tapioca/dsl/compiler.rb#87 sig { returns(T::Enumerable[::Module]) } def all_modules; end + + # source://tapioca/lib/tapioca/dsl/compiler.rb#61 + sig do + type_parameters(:U) + .params( + klass: T.all(T.type_parameter(:U), T::Class[T.anything]) + ).returns(T::Array[T.type_parameter(:U)]) + end + def descendants_of(klass); end end end @@ -1372,11 +1385,11 @@ class Tapioca::Dsl::Pipeline private - # source://tapioca/lib/tapioca/dsl/pipeline.rb#223 + # source://tapioca/lib/tapioca/dsl/pipeline.rb#224 sig { void } def abort_if_pending_migrations!; end - # source://tapioca/lib/tapioca/dsl/pipeline.rb#168 + # source://tapioca/lib/tapioca/dsl/pipeline.rb#169 sig { params(constants: T::Set[::Module]).returns(T::Set[::Module]) } def filter_anonymous_and_reloaded_constants(constants); end @@ -1399,11 +1412,11 @@ class Tapioca::Dsl::Pipeline end def gather_constants(requested_constants, requested_paths, skipped_constants); end - # source://tapioca/lib/tapioca/dsl/pipeline.rb#197 + # source://tapioca/lib/tapioca/dsl/pipeline.rb#198 sig { params(constant: ::Module).returns(T.nilable(::RBI::File)) } def rbi_for_constant(constant); end - # source://tapioca/lib/tapioca/dsl/pipeline.rb#216 + # source://tapioca/lib/tapioca/dsl/pipeline.rb#217 sig { params(error: ::String).returns(T.noreturn) } def report_error(error); end end @@ -2208,7 +2221,7 @@ class Tapioca::GemInfo < ::T::Struct sig { params(spec: ::Bundler::LazySpecification).returns(::Tapioca::GemInfo) } def from_spec(spec); end - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end diff --git a/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi b/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi similarity index 100% rename from sorbet/rbi/gems/unicode-display_width@2.5.0.rbi rename to sorbet/rbi/gems/unicode-display_width@2.6.0.rbi diff --git a/sorbet/rbi/gems/webmock@3.23.1.rbi b/sorbet/rbi/gems/webmock@3.23.1.rbi deleted file mode 100644 index 47f02ec3..00000000 --- a/sorbet/rbi/gems/webmock@3.23.1.rbi +++ /dev/null @@ -1,1776 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `webmock` gem. -# Please instead update this file by running `bin/tapioca gem webmock`. - - -class Minitest::Test < ::Minitest::Runnable - include ::Mocha::ParameterMatchers - include ::Mocha::Hooks - include ::Mocha::API - include ::WebMock::API -end - -# source://webmock/lib/webmock/http_lib_adapters/net_http_response.rb#18 -module Net::WebMockHTTPResponse - # source://webmock/lib/webmock/http_lib_adapters/net_http_response.rb#19 - def read_body(dest = T.unsafe(nil), &block); end -end - -# source://webmock/lib/webmock/http_lib_adapters/net_http.rb#210 -class StubSocket - # @return [StubSocket] a new instance of StubSocket - # - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#214 - def initialize(*args); end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#222 - def close; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#218 - def closed?; end - - # Returns the value of attribute continue_timeout. - # - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#212 - def continue_timeout; end - - # Sets the attribute continue_timeout - # - # @param value the value to set the attribute continue_timeout to. - # - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#212 - def continue_timeout=(_arg0); end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#230 - def io; end - - # Returns the value of attribute read_timeout. - # - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#212 - def read_timeout; end - - # Sets the attribute read_timeout - # - # @param value the value to set the attribute read_timeout to. - # - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#212 - def read_timeout=(_arg0); end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#227 - def readuntil(*args); end - - # Returns the value of attribute write_timeout. - # - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#212 - def write_timeout; end - - # Sets the attribute write_timeout - # - # @param value the value to set the attribute write_timeout to. - # - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#212 - def write_timeout=(_arg0); end -end - -# source://webmock/lib/webmock/http_lib_adapters/net_http.rb#234 -class StubSocket::StubIO - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#239 - def cipher; end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#236 - def peer_cert; end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#237 - def peeraddr; end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#235 - def setsockopt(*args); end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#238 - def ssl_version; end -end - -# source://webmock/lib/webmock/deprecation.rb#3 -module WebMock - include ::WebMock::API - extend ::WebMock::API - - def after_request(*args, &block); end - def allow_net_connect!(*args, &block); end - def disable_net_connect!(*args, &block); end - def net_connect_allowed?(*args, &block); end - def registered_request?(*args, &block); end - def reset_callbacks(*args, &block); end - def reset_webmock(*args, &block); end - - class << self - # source://webmock/lib/webmock/webmock.rb#143 - def after_request(options = T.unsafe(nil), &block); end - - # source://webmock/lib/webmock/webmock.rb#46 - def allow_net_connect!(options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/webmock.rb#30 - def disable!(options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/webmock.rb#51 - def disable_net_connect!(options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/webmock.rb#51 - def disallow_net_connect!(options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/webmock.rb#38 - def enable!(options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/webmock.rb#46 - def enable_net_connect!(options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/webmock.rb#155 - def globally_stub_request(order = T.unsafe(nil), &block); end - - # source://webmock/lib/webmock/webmock.rb#109 - def hide_body_diff!; end - - # source://webmock/lib/webmock/webmock.rb#117 - def hide_stubbing_instructions!; end - - # @private - # - # source://webmock/lib/webmock/webmock.rb#5 - def included(clazz); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/webmock.rb#63 - def net_connect_allowed?(uri = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/webmock.rb#85 - def net_connect_explicit_allowed?(allowed, uri = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/webmock.rb#75 - def net_http_connect_on_start?(uri); end - - # source://webmock/lib/webmock/webmock.rb#151 - def print_executed_requests; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/webmock.rb#147 - def registered_request?(request_signature); end - - # source://webmock/lib/webmock/api.rb#14 - def request(method, uri); end - - # source://webmock/lib/webmock/webmock.rb#129 - def reset!; end - - # source://webmock/lib/webmock/webmock.rb#139 - def reset_callbacks; end - - # source://webmock/lib/webmock/webmock.rb#134 - def reset_webmock; end - - # source://webmock/lib/webmock/webmock.rb#105 - def show_body_diff!; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/webmock.rb#113 - def show_body_diff?; end - - # source://webmock/lib/webmock/webmock.rb#121 - def show_stubbing_instructions!; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/webmock.rb#125 - def show_stubbing_instructions?; end - - # source://webmock/lib/webmock/webmock.rb#26 - def version; end - end -end - -# source://webmock/lib/webmock/api.rb#4 -module WebMock::API - extend ::WebMock::API - - # source://webmock/lib/webmock/api.rb#14 - def a_request(method, uri); end - - # source://webmock/lib/webmock/api.rb#31 - def assert_not_requested(*args, &block); end - - # source://webmock/lib/webmock/api.rb#22 - def assert_requested(*args, &block); end - - # source://webmock/lib/webmock/api.rb#59 - def hash_excluding(*args); end - - # Similar to RSpec::Mocks::ArgumentMatchers#hash_including() - # - # Matches a hash that includes the specified key(s) or key/value pairs. - # Ignores any additional keys. - # - # @example - # - # object.should_receive(:message).with(hash_including(:key => val)) - # object.should_receive(:message).with(hash_including(:key)) - # object.should_receive(:message).with(hash_including(:key, :key2 => val2)) - # - # source://webmock/lib/webmock/api.rb#51 - def hash_including(*args); end - - # source://webmock/lib/webmock/api.rb#31 - def refute_requested(*args, &block); end - - # source://webmock/lib/webmock/api.rb#67 - def remove_request_stub(stub); end - - # source://webmock/lib/webmock/api.rb#71 - def reset_executed_requests!; end - - # source://webmock/lib/webmock/api.rb#7 - def stub_http_request(method, uri); end - - # source://webmock/lib/webmock/api.rb#7 - def stub_request(method, uri); end - - private - - # this is a based on RSpec::Mocks::ArgumentMatchers#anythingize_lonely_keys - # - # source://webmock/lib/webmock/api.rb#104 - def anythingize_lonely_keys(*args); end - - # source://webmock/lib/webmock/api.rb#95 - def assert_request_not_requested(request, options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/api.rb#86 - def assert_request_requested(request, options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/api.rb#77 - def convert_uri_method_and_options_to_request_and_options(method, uri, options, &block); end - - class << self - # source://webmock/lib/webmock/api.rb#14 - def request(method, uri); end - end -end - -# source://webmock/lib/webmock/assertion_failure.rb#4 -class WebMock::AssertionFailure - class << self - # Returns the value of attribute error_class. - # - # source://webmock/lib/webmock/assertion_failure.rb#7 - def error_class; end - - # Sets the attribute error_class - # - # @param value the value to set the attribute error_class to. - # - # source://webmock/lib/webmock/assertion_failure.rb#7 - def error_class=(_arg0); end - - # @raise [@error_class] - # - # source://webmock/lib/webmock/assertion_failure.rb#8 - def failure(message); end - end -end - -# source://webmock/lib/webmock/request_pattern.rb#252 -class WebMock::BodyPattern - include ::WebMock::RSpecMatcherDetector - - # @return [BodyPattern] a new instance of BodyPattern - # - # source://webmock/lib/webmock/request_pattern.rb#270 - def initialize(pattern); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#280 - def matches?(body, content_type = T.unsafe(nil)); end - - # Returns the value of attribute pattern. - # - # source://webmock/lib/webmock/request_pattern.rb#268 - def pattern; end - - # source://webmock/lib/webmock/request_pattern.rb#297 - def to_s; end - - private - - # source://webmock/lib/webmock/request_pattern.rb#319 - def assert_non_multipart_body(content_type); end - - # source://webmock/lib/webmock/request_pattern.rb#303 - def body_as_hash(body, content_type); end - - # source://webmock/lib/webmock/request_pattern.rb#314 - def body_format(content_type); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#378 - def empty_string?(string); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#358 - def matching_body_array?(query_parameters, pattern, content_type); end - - # Compare two hashes for equality - # - # For two hashes to match they must have the same length and all - # values must match when compared using `#===`. - # - # The following hashes are examples of matches: - # - # {a: /\d+/} and {a: '123'} - # - # {a: '123'} and {a: '123'} - # - # {a: {b: /\d+/}} and {a: {b: '123'}} - # - # {a: {b: 'wow'}} and {a: {b: 'wow'}} - # - # @param query_parameters [Hash] typically the result of parsing - # JSON, XML or URL encoded parameters. - # @param pattern [Hash] which contains keys with a string, hash or - # regular expression value to use for comparison. - # @return [Boolean] true if the paramaters match the comparison - # hash, false if not. - # - # source://webmock/lib/webmock/request_pattern.rb#348 - def matching_body_hashes?(query_parameters, pattern, content_type); end - - # source://webmock/lib/webmock/request_pattern.rb#370 - def matching_values(actual, expected, content_type); end - - # source://webmock/lib/webmock/request_pattern.rb#382 - def normalize_hash(hash); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#386 - def url_encoded_body?(content_type); end -end - -# source://webmock/lib/webmock/request_pattern.rb#255 -WebMock::BodyPattern::BODY_FORMATS = T.let(T.unsafe(nil), Hash) - -# source://webmock/lib/webmock/callback_registry.rb#4 -class WebMock::CallbackRegistry - class << self - # source://webmock/lib/webmock/callback_registry.rb#7 - def add_callback(options, block); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/callback_registry.rb#32 - def any_callbacks?; end - - # source://webmock/lib/webmock/callback_registry.rb#11 - def callbacks; end - - # source://webmock/lib/webmock/callback_registry.rb#15 - def invoke_callbacks(options, request_signature, response); end - - # source://webmock/lib/webmock/callback_registry.rb#28 - def reset; end - end -end - -# source://webmock/lib/webmock/config.rb#4 -class WebMock::Config - include ::Singleton - extend ::Singleton::SingletonClassMethods - - # @return [Config] a new instance of Config - # - # source://webmock/lib/webmock/config.rb#7 - def initialize; end - - # Returns the value of attribute allow. - # - # source://webmock/lib/webmock/config.rb#14 - def allow; end - - # Sets the attribute allow - # - # @param value the value to set the attribute allow to. - # - # source://webmock/lib/webmock/config.rb#14 - def allow=(_arg0); end - - # Returns the value of attribute allow_localhost. - # - # source://webmock/lib/webmock/config.rb#13 - def allow_localhost; end - - # Sets the attribute allow_localhost - # - # @param value the value to set the attribute allow_localhost to. - # - # source://webmock/lib/webmock/config.rb#13 - def allow_localhost=(_arg0); end - - # Returns the value of attribute allow_net_connect. - # - # source://webmock/lib/webmock/config.rb#12 - def allow_net_connect; end - - # Sets the attribute allow_net_connect - # - # @param value the value to set the attribute allow_net_connect to. - # - # source://webmock/lib/webmock/config.rb#12 - def allow_net_connect=(_arg0); end - - # Returns the value of attribute net_http_connect_on_start. - # - # source://webmock/lib/webmock/config.rb#15 - def net_http_connect_on_start; end - - # Sets the attribute net_http_connect_on_start - # - # @param value the value to set the attribute net_http_connect_on_start to. - # - # source://webmock/lib/webmock/config.rb#15 - def net_http_connect_on_start=(_arg0); end - - # Returns the value of attribute query_values_notation. - # - # source://webmock/lib/webmock/config.rb#17 - def query_values_notation; end - - # Sets the attribute query_values_notation - # - # @param value the value to set the attribute query_values_notation to. - # - # source://webmock/lib/webmock/config.rb#17 - def query_values_notation=(_arg0); end - - # Returns the value of attribute show_body_diff. - # - # source://webmock/lib/webmock/config.rb#18 - def show_body_diff; end - - # Sets the attribute show_body_diff - # - # @param value the value to set the attribute show_body_diff to. - # - # source://webmock/lib/webmock/config.rb#18 - def show_body_diff=(_arg0); end - - # Returns the value of attribute show_stubbing_instructions. - # - # source://webmock/lib/webmock/config.rb#16 - def show_stubbing_instructions; end - - # Sets the attribute show_stubbing_instructions - # - # @param value the value to set the attribute show_stubbing_instructions to. - # - # source://webmock/lib/webmock/config.rb#16 - def show_stubbing_instructions=(_arg0); end - - class << self - private - - def allocate; end - def new(*_arg0); end - end -end - -# source://webmock/lib/webmock/deprecation.rb#4 -class WebMock::Deprecation - class << self - # source://webmock/lib/webmock/deprecation.rb#6 - def warning(message); end - end -end - -# source://webmock/lib/webmock/response.rb#149 -class WebMock::DynamicResponse < ::WebMock::Response - # @return [DynamicResponse] a new instance of DynamicResponse - # - # source://webmock/lib/webmock/response.rb#152 - def initialize(responder); end - - # source://webmock/lib/webmock/response.rb#156 - def evaluate(request_signature); end - - # Returns the value of attribute responder. - # - # source://webmock/lib/webmock/response.rb#150 - def responder; end - - # Sets the attribute responder - # - # @param value the value to set the attribute responder to. - # - # source://webmock/lib/webmock/response.rb#150 - def responder=(_arg0); end -end - -# source://webmock/lib/webmock/util/hash_validator.rb#4 -class WebMock::HashValidator - # @return [HashValidator] a new instance of HashValidator - # - # source://webmock/lib/webmock/util/hash_validator.rb#5 - def initialize(hash); end - - # This code is based on https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/hash/keys.rb - # - # source://webmock/lib/webmock/util/hash_validator.rb#10 - def validate_keys(*valid_keys); end -end - -# source://webmock/lib/webmock/request_pattern.rb#391 -class WebMock::HeadersPattern - # @return [HeadersPattern] a new instance of HeadersPattern - # - # source://webmock/lib/webmock/request_pattern.rb#392 - def initialize(pattern); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#396 - def matches?(headers); end - - # source://webmock/lib/webmock/request_pattern.rb#412 - def pp_to_s; end - - # source://webmock/lib/webmock/request_pattern.rb#408 - def to_s; end - - private - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#418 - def empty_headers?(headers); end -end - -# source://webmock/lib/webmock/http_lib_adapters/http_lib_adapter.rb#4 -class WebMock::HttpLibAdapter - class << self - # source://webmock/lib/webmock/http_lib_adapters/http_lib_adapter.rb#5 - def adapter_for(lib); end - end -end - -# source://webmock/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb#4 -class WebMock::HttpLibAdapterRegistry - include ::Singleton - extend ::Singleton::SingletonClassMethods - - # @return [HttpLibAdapterRegistry] a new instance of HttpLibAdapterRegistry - # - # source://webmock/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb#9 - def initialize; end - - # source://webmock/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb#17 - def each_adapter(&block); end - - # Returns the value of attribute http_lib_adapters. - # - # source://webmock/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb#7 - def http_lib_adapters; end - - # Sets the attribute http_lib_adapters - # - # @param value the value to set the attribute http_lib_adapters to. - # - # source://webmock/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb#7 - def http_lib_adapters=(_arg0); end - - # source://webmock/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb#13 - def register(lib, adapter); end - - class << self - private - - def allocate; end - def new(*_arg0); end - end -end - -# source://webmock/lib/webmock/http_lib_adapters/net_http.rb#10 -module WebMock::HttpLibAdapters; end - -# source://webmock/lib/webmock/http_lib_adapters/net_http.rb#11 -class WebMock::HttpLibAdapters::NetHttpAdapter < ::WebMock::HttpLibAdapter - class << self - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#23 - def disable!; end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#16 - def enable!; end - end -end - -# source://webmock/lib/webmock/http_lib_adapters/net_http.rb#14 -WebMock::HttpLibAdapters::NetHttpAdapter::OriginalNetHTTP = Class.new - -# source://webmock/lib/webmock/matchers/hash_argument_matcher.rb#4 -module WebMock::Matchers; end - -# this is a based on RSpec::Mocks::ArgumentMatchers::AnyArgMatcher -# -# source://webmock/lib/webmock/matchers/any_arg_matcher.rb#6 -class WebMock::Matchers::AnyArgMatcher - # @return [AnyArgMatcher] a new instance of AnyArgMatcher - # - # source://webmock/lib/webmock/matchers/any_arg_matcher.rb#7 - def initialize(ignore); end - - # source://webmock/lib/webmock/matchers/any_arg_matcher.rb#10 - def ==(other); end -end - -# Base class for Hash matchers -# https://github.com/rspec/rspec-mocks/blob/master/lib/rspec/mocks/argument_matchers.rb -# -# source://webmock/lib/webmock/matchers/hash_argument_matcher.rb#7 -class WebMock::Matchers::HashArgumentMatcher - # @return [HashArgumentMatcher] a new instance of HashArgumentMatcher - # - # source://webmock/lib/webmock/matchers/hash_argument_matcher.rb#8 - def initialize(expected); end - - # source://webmock/lib/webmock/matchers/hash_argument_matcher.rb#12 - def ==(_actual, &block); end - - class << self - # source://webmock/lib/webmock/matchers/hash_argument_matcher.rb#18 - def from_rspec_matcher(matcher); end - end -end - -# this is a based on RSpec::Mocks::ArgumentMatchers::HashExcludingMatcher -# https://github.com/rspec/rspec-mocks/blob/master/lib/rspec/mocks/argument_matchers.rb -# -# source://webmock/lib/webmock/matchers/hash_excluding_matcher.rb#7 -class WebMock::Matchers::HashExcludingMatcher < ::WebMock::Matchers::HashArgumentMatcher - # source://webmock/lib/webmock/matchers/hash_excluding_matcher.rb#8 - def ==(actual); end - - # source://webmock/lib/webmock/matchers/hash_excluding_matcher.rb#12 - def inspect; end -end - -# this is a based on RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher -# https://github.com/rspec/rspec-mocks/blob/master/lib/rspec/mocks/argument_matchers.rb -# -# source://webmock/lib/webmock/matchers/hash_including_matcher.rb#7 -class WebMock::Matchers::HashIncludingMatcher < ::WebMock::Matchers::HashArgumentMatcher - # source://webmock/lib/webmock/matchers/hash_including_matcher.rb#8 - def ==(actual); end - - # source://webmock/lib/webmock/matchers/hash_including_matcher.rb#14 - def inspect; end -end - -# source://webmock/lib/webmock/request_pattern.rb#95 -class WebMock::MethodPattern - # @return [MethodPattern] a new instance of MethodPattern - # - # source://webmock/lib/webmock/request_pattern.rb#96 - def initialize(pattern); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#100 - def matches?(method); end - - # source://webmock/lib/webmock/request_pattern.rb#104 - def to_s; end -end - -# source://webmock/lib/webmock/errors.rb#5 -class WebMock::NetConnectNotAllowedError < ::Exception - # @return [NetConnectNotAllowedError] a new instance of NetConnectNotAllowedError - # - # source://webmock/lib/webmock/errors.rb#6 - def initialize(request_signature); end -end - -# source://webmock/lib/webmock/http_lib_adapters/net_http.rb#244 -module WebMock::NetHTTPUtility - class << self - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#283 - def check_right_http_connection; end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#274 - def get_uri(net_http, path = T.unsafe(nil)); end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#287 - def puts_warning_for_right_http_if_needed; end - - # source://webmock/lib/webmock/http_lib_adapters/net_http.rb#246 - def request_signature_from_request(net_http, request, body = T.unsafe(nil)); end - end -end - -# source://webmock/lib/webmock/request_pattern.rb#5 -module WebMock::RSpecMatcherDetector - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#10 - def rSpecHashExcludingMatcher?(matcher); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#6 - def rSpecHashIncludingMatcher?(matcher); end -end - -# source://webmock/lib/webmock/rack_response.rb#4 -class WebMock::RackResponse < ::WebMock::Response - # @return [RackResponse] a new instance of RackResponse - # - # source://webmock/lib/webmock/rack_response.rb#5 - def initialize(app); end - - # source://webmock/lib/webmock/rack_response.rb#21 - def body_from_rack_response(response); end - - # source://webmock/lib/webmock/rack_response.rb#28 - def build_rack_env(request); end - - # source://webmock/lib/webmock/rack_response.rb#9 - def evaluate(request); end - - # source://webmock/lib/webmock/rack_response.rb#65 - def session; end - - # source://webmock/lib/webmock/rack_response.rb#69 - def session_options; end -end - -# source://webmock/lib/webmock/request_body_diff.rb#7 -class WebMock::RequestBodyDiff - # @return [RequestBodyDiff] a new instance of RequestBodyDiff - # - # source://webmock/lib/webmock/request_body_diff.rb#9 - def initialize(request_signature, request_stub); end - - # source://webmock/lib/webmock/request_body_diff.rb#14 - def body_diff; end - - private - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_body_diff.rb#57 - def parseable_json?(body_pattern); end - - # Returns the value of attribute request_signature. - # - # source://webmock/lib/webmock/request_body_diff.rb#20 - def request_signature; end - - # source://webmock/lib/webmock/request_body_diff.rb#33 - def request_signature_body_hash; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_body_diff.rb#25 - def request_signature_diffable?; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_body_diff.rb#49 - def request_signature_parseable_json?; end - - # Returns the value of attribute request_stub. - # - # source://webmock/lib/webmock/request_body_diff.rb#20 - def request_stub; end - - # source://webmock/lib/webmock/request_body_diff.rb#43 - def request_stub_body; end - - # source://webmock/lib/webmock/request_body_diff.rb#37 - def request_stub_body_hash; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_body_diff.rb#29 - def request_stub_diffable?; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_body_diff.rb#53 - def request_stub_parseable_json?; end -end - -# source://webmock/lib/webmock/request_execution_verifier.rb#4 -class WebMock::RequestExecutionVerifier - # @return [RequestExecutionVerifier] a new instance of RequestExecutionVerifier - # - # source://webmock/lib/webmock/request_execution_verifier.rb#8 - def initialize(request_pattern = T.unsafe(nil), expected_times_executed = T.unsafe(nil), at_least_times_executed = T.unsafe(nil), at_most_times_executed = T.unsafe(nil)); end - - # Returns the value of attribute at_least_times_executed. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def at_least_times_executed; end - - # Sets the attribute at_least_times_executed - # - # @param value the value to set the attribute at_least_times_executed to. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def at_least_times_executed=(_arg0); end - - # Returns the value of attribute at_most_times_executed. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def at_most_times_executed; end - - # Sets the attribute at_most_times_executed - # - # @param value the value to set the attribute at_most_times_executed to. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def at_most_times_executed=(_arg0); end - - # source://webmock/lib/webmock/request_execution_verifier.rb#38 - def description; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_execution_verifier.rb#28 - def does_not_match?; end - - # Returns the value of attribute expected_times_executed. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def expected_times_executed; end - - # Sets the attribute expected_times_executed - # - # @param value the value to set the attribute expected_times_executed to. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def expected_times_executed=(_arg0); end - - # source://webmock/lib/webmock/request_execution_verifier.rb#42 - def failure_message; end - - # source://webmock/lib/webmock/request_execution_verifier.rb#46 - def failure_message_when_negated; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_execution_verifier.rb#15 - def matches?; end - - # Returns the value of attribute request_pattern. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def request_pattern; end - - # Sets the attribute request_pattern - # - # @param value the value to set the attribute request_pattern to. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def request_pattern=(_arg0); end - - # Returns the value of attribute times_executed. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def times_executed; end - - # Sets the attribute times_executed - # - # @param value the value to set the attribute times_executed to. - # - # source://webmock/lib/webmock/request_execution_verifier.rb#6 - def times_executed=(_arg0); end - - private - - # source://webmock/lib/webmock/request_execution_verifier.rb#56 - def failure_message_phrase(is_negated = T.unsafe(nil)); end - - # source://webmock/lib/webmock/request_execution_verifier.rb#62 - def quantity_phrase(is_negated = T.unsafe(nil)); end - - # source://webmock/lib/webmock/request_execution_verifier.rb#74 - def times(times); end - - class << self - # source://webmock/lib/webmock/request_execution_verifier.rb#50 - def executed_requests_message; end - end -end - -# source://webmock/lib/webmock/request_pattern.rb#15 -class WebMock::RequestPattern - # @return [RequestPattern] a new instance of RequestPattern - # - # source://webmock/lib/webmock/request_pattern.rb#19 - def initialize(method, uri, options = T.unsafe(nil)); end - - # Returns the value of attribute body_pattern. - # - # source://webmock/lib/webmock/request_pattern.rb#17 - def body_pattern; end - - # Returns the value of attribute headers_pattern. - # - # source://webmock/lib/webmock/request_pattern.rb#17 - def headers_pattern; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#35 - def matches?(request_signature); end - - # Returns the value of attribute method_pattern. - # - # source://webmock/lib/webmock/request_pattern.rb#17 - def method_pattern; end - - # source://webmock/lib/webmock/request_pattern.rb#45 - def to_s; end - - # Returns the value of attribute uri_pattern. - # - # source://webmock/lib/webmock/request_pattern.rb#17 - def uri_pattern; end - - # @raise [ArgumentError] - # - # source://webmock/lib/webmock/request_pattern.rb#28 - def with(options = T.unsafe(nil), &block); end - - private - - # source://webmock/lib/webmock/request_pattern.rb#57 - def assign_options(options); end - - # source://webmock/lib/webmock/request_pattern.rb#80 - def create_uri_pattern(uri); end - - # source://webmock/lib/webmock/request_pattern.rb#66 - def set_basic_auth_as_headers!(options); end - - # source://webmock/lib/webmock/request_pattern.rb#74 - def validate_basic_auth!(basic_auth); end -end - -# source://webmock/lib/webmock/request_registry.rb#5 -class WebMock::RequestRegistry - include ::Singleton - extend ::Singleton::SingletonClassMethods - - # @return [RequestRegistry] a new instance of RequestRegistry - # - # source://webmock/lib/webmock/request_registry.rb#10 - def initialize; end - - # Returns the value of attribute requested_signatures. - # - # source://webmock/lib/webmock/request_registry.rb#8 - def requested_signatures; end - - # Sets the attribute requested_signatures - # - # @param value the value to set the attribute requested_signatures to. - # - # source://webmock/lib/webmock/request_registry.rb#8 - def requested_signatures=(_arg0); end - - # source://webmock/lib/webmock/request_registry.rb#14 - def reset!; end - - # source://webmock/lib/webmock/request_registry.rb#18 - def times_executed(request_pattern); end - - # source://webmock/lib/webmock/request_registry.rb#24 - def to_s; end - - class << self - private - - def allocate; end - def new(*_arg0); end - end -end - -# source://webmock/lib/webmock/request_signature.rb#5 -class WebMock::RequestSignature - # @return [RequestSignature] a new instance of RequestSignature - # - # source://webmock/lib/webmock/request_signature.rb#10 - def initialize(method, uri, options = T.unsafe(nil)); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_signature.rb#34 - def ==(other); end - - # Returns the value of attribute body. - # - # source://webmock/lib/webmock/request_signature.rb#7 - def body; end - - # Sets the attribute body - # - # @param value the value to set the attribute body to. - # - # source://webmock/lib/webmock/request_signature.rb#7 - def body=(_arg0); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_signature.rb#34 - def eql?(other); end - - # source://webmock/lib/webmock/request_signature.rb#30 - def hash; end - - # Returns the value of attribute headers. - # - # source://webmock/lib/webmock/request_signature.rb#8 - def headers; end - - # source://webmock/lib/webmock/request_signature.rb#26 - def headers=(headers); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_signature.rb#43 - def json_headers?; end - - # Returns the value of attribute method. - # - # source://webmock/lib/webmock/request_signature.rb#7 - def method; end - - # Sets the attribute method - # - # @param value the value to set the attribute method to. - # - # source://webmock/lib/webmock/request_signature.rb#7 - def method=(_arg0); end - - # source://webmock/lib/webmock/request_signature.rb#16 - def to_s; end - - # Returns the value of attribute uri. - # - # source://webmock/lib/webmock/request_signature.rb#7 - def uri; end - - # Sets the attribute uri - # - # @param value the value to set the attribute uri to. - # - # source://webmock/lib/webmock/request_signature.rb#7 - def uri=(_arg0); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_signature.rb#39 - def url_encoded?; end - - private - - # source://webmock/lib/webmock/request_signature.rb#49 - def assign_options(options); end -end - -# source://webmock/lib/webmock/request_signature_snippet.rb#6 -class WebMock::RequestSignatureSnippet - # @return [RequestSignatureSnippet] a new instance of RequestSignatureSnippet - # - # source://webmock/lib/webmock/request_signature_snippet.rb#10 - def initialize(request_signature); end - - # Returns the value of attribute request_signature. - # - # source://webmock/lib/webmock/request_signature_snippet.rb#8 - def request_signature; end - - # Returns the value of attribute request_stub. - # - # source://webmock/lib/webmock/request_signature_snippet.rb#8 - def request_stub; end - - # source://webmock/lib/webmock/request_signature_snippet.rb#22 - def request_stubs; end - - # source://webmock/lib/webmock/request_signature_snippet.rb#15 - def stubbing_instructions; end - - private - - # source://webmock/lib/webmock/request_signature_snippet.rb#35 - def add_body_diff(stub, text); end - - # source://webmock/lib/webmock/request_signature_snippet.rb#54 - def pretty_print_to_string(string_to_print); end - - # source://webmock/lib/webmock/request_signature_snippet.rb#45 - def request_params; end - - # source://webmock/lib/webmock/request_signature_snippet.rb#40 - def signature_stub_body_diff(stub); end -end - -# source://webmock/lib/webmock/request_stub.rb#4 -class WebMock::RequestStub - # @return [RequestStub] a new instance of RequestStub - # - # source://webmock/lib/webmock/request_stub.rb#8 - def initialize(method, uri); end - - # source://webmock/lib/webmock/request_stub.rb#65 - def and_raise(*exceptions); end - - # source://webmock/lib/webmock/request_stub.rb#19 - def and_return(*response_hashes, &block); end - - # @raise [ArgumentError] - # - # source://webmock/lib/webmock/request_stub.rb#29 - def and_return_json(*response_hashes); end - - # source://webmock/lib/webmock/request_stub.rb#73 - def and_timeout; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_stub.rb#90 - def has_responses?; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_stub.rb#108 - def matches?(request_signature); end - - # Returns the value of attribute request_pattern. - # - # source://webmock/lib/webmock/request_stub.rb#6 - def request_pattern; end - - # Sets the attribute request_pattern - # - # @param value the value to set the attribute request_pattern to. - # - # source://webmock/lib/webmock/request_stub.rb#6 - def request_pattern=(_arg0); end - - # source://webmock/lib/webmock/request_stub.rb#79 - def response; end - - # source://webmock/lib/webmock/request_stub.rb#94 - def then; end - - # source://webmock/lib/webmock/request_stub.rb#98 - def times(number); end - - # source://webmock/lib/webmock/request_stub.rb#61 - def to_rack(app, options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/request_stub.rb#65 - def to_raise(*exceptions); end - - # source://webmock/lib/webmock/request_stub.rb#19 - def to_return(*response_hashes, &block); end - - # @raise [ArgumentError] - # - # source://webmock/lib/webmock/request_stub.rb#29 - def to_return_json(*response_hashes); end - - # source://webmock/lib/webmock/request_stub.rb#112 - def to_s; end - - # source://webmock/lib/webmock/request_stub.rb#73 - def to_timeout; end - - # source://webmock/lib/webmock/request_stub.rb#14 - def with(params = T.unsafe(nil), &block); end - - class << self - # source://webmock/lib/webmock/request_stub.rb#116 - def from_request_signature(signature); end - end -end - -# source://webmock/lib/webmock/response.rb#17 -class WebMock::Response - # @return [Response] a new instance of Response - # - # source://webmock/lib/webmock/response.rb#18 - def initialize(options = T.unsafe(nil)); end - - # source://webmock/lib/webmock/response.rb#97 - def ==(other); end - - # source://webmock/lib/webmock/response.rb#40 - def body; end - - # source://webmock/lib/webmock/response.rb#44 - def body=(body); end - - # source://webmock/lib/webmock/response.rb#88 - def evaluate(request_signature); end - - # source://webmock/lib/webmock/response.rb#58 - def exception; end - - # source://webmock/lib/webmock/response.rb#62 - def exception=(exception); end - - # source://webmock/lib/webmock/response.rb#29 - def headers; end - - # source://webmock/lib/webmock/response.rb#33 - def headers=(headers); end - - # source://webmock/lib/webmock/response.rb#78 - def options=(options); end - - # @raise [@exception] - # - # source://webmock/lib/webmock/response.rb#70 - def raise_error_if_any; end - - # source://webmock/lib/webmock/response.rb#74 - def should_timeout; end - - # source://webmock/lib/webmock/response.rb#50 - def status; end - - # source://webmock/lib/webmock/response.rb#54 - def status=(status); end - - private - - # source://webmock/lib/webmock/response.rb#115 - def assert_valid_body!; end - - # source://webmock/lib/webmock/response.rb#128 - def read_raw_response(io); end - - # source://webmock/lib/webmock/response.rb#107 - def stringify_body!; end -end - -# source://webmock/lib/webmock/response.rb#145 -class WebMock::Response::InvalidBody < ::StandardError; end - -# source://webmock/lib/webmock/response.rb#7 -class WebMock::ResponseFactory - class << self - # source://webmock/lib/webmock/response.rb#8 - def response_for(options); end - end -end - -# source://webmock/lib/webmock/responses_sequence.rb#5 -class WebMock::ResponsesSequence - # @return [ResponsesSequence] a new instance of ResponsesSequence - # - # source://webmock/lib/webmock/responses_sequence.rb#9 - def initialize(responses); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/responses_sequence.rb#15 - def end?; end - - # source://webmock/lib/webmock/responses_sequence.rb#19 - def next_response; end - - # Returns the value of attribute times_to_repeat. - # - # source://webmock/lib/webmock/responses_sequence.rb#7 - def times_to_repeat; end - - # Sets the attribute times_to_repeat - # - # @param value the value to set the attribute times_to_repeat to. - # - # source://webmock/lib/webmock/responses_sequence.rb#7 - def times_to_repeat=(_arg0); end - - private - - # source://webmock/lib/webmock/responses_sequence.rb#31 - def increase_position; end -end - -# source://webmock/lib/webmock/stub_registry.rb#5 -class WebMock::StubRegistry - include ::Singleton - extend ::Singleton::SingletonClassMethods - - # @return [StubRegistry] a new instance of StubRegistry - # - # source://webmock/lib/webmock/stub_registry.rb#10 - def initialize; end - - # source://webmock/lib/webmock/stub_registry.rb#14 - def global_stubs; end - - # source://webmock/lib/webmock/stub_registry.rb#22 - def register_global_stub(order = T.unsafe(nil), &block); end - - # source://webmock/lib/webmock/stub_registry.rb#50 - def register_request_stub(stub); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/stub_registry.rb#61 - def registered_request?(request_signature); end - - # source://webmock/lib/webmock/stub_registry.rb#55 - def remove_request_stub(stub); end - - # Returns the value of attribute request_stubs. - # - # source://webmock/lib/webmock/stub_registry.rb#8 - def request_stubs; end - - # Sets the attribute request_stubs - # - # @param value the value to set the attribute request_stubs to. - # - # source://webmock/lib/webmock/stub_registry.rb#8 - def request_stubs=(_arg0); end - - # source://webmock/lib/webmock/stub_registry.rb#18 - def reset!; end - - # source://webmock/lib/webmock/stub_registry.rb#65 - def response_for_request(request_signature); end - - private - - # source://webmock/lib/webmock/stub_registry.rb#79 - def evaluate_response_for_request(response, request_signature); end - - # source://webmock/lib/webmock/stub_registry.rb#72 - def request_stub_for(request_signature); end - - class << self - private - - def allocate; end - def new(*_arg0); end - end -end - -# source://webmock/lib/webmock/stub_request_snippet.rb#4 -class WebMock::StubRequestSnippet - # @return [StubRequestSnippet] a new instance of StubRequestSnippet - # - # source://webmock/lib/webmock/stub_request_snippet.rb#5 - def initialize(request_stub); end - - # source://webmock/lib/webmock/stub_request_snippet.rb#9 - def body_pattern; end - - # source://webmock/lib/webmock/stub_request_snippet.rb#13 - def to_s(with_response = T.unsafe(nil)); end -end - -# source://webmock/lib/webmock/request_pattern.rb#177 -class WebMock::URIAddressablePattern < ::WebMock::URIPattern - # source://webmock/lib/webmock/request_pattern.rb#178 - def add_query_params(query_params); end - - private - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#203 - def matches_with_variations?(uri); end - - # source://webmock/lib/webmock/request_pattern.rb#199 - def pattern_inspect; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#189 - def pattern_matches?(uri); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#215 - def template_matches_uri?(template, uri); end -end - -# source://webmock/lib/webmock/request_pattern.rb#161 -class WebMock::URICallablePattern < ::WebMock::URIPattern - private - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#164 - def pattern_matches?(uri); end -end - -# source://webmock/lib/webmock/request_pattern.rb#110 -class WebMock::URIPattern - include ::WebMock::RSpecMatcherDetector - - # @return [URIPattern] a new instance of URIPattern - # - # source://webmock/lib/webmock/request_pattern.rb#113 - def initialize(pattern); end - - # source://webmock/lib/webmock/request_pattern.rb#125 - def add_query_params(query_params); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#140 - def matches?(uri); end - - # source://webmock/lib/webmock/request_pattern.rb#144 - def to_s; end - - private - - # source://webmock/lib/webmock/request_pattern.rb#152 - def pattern_inspect; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#156 - def query_params_matches?(uri); end -end - -# source://webmock/lib/webmock/request_pattern.rb#169 -class WebMock::URIRegexpPattern < ::WebMock::URIPattern - private - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#172 - def pattern_matches?(uri); end -end - -# source://webmock/lib/webmock/request_pattern.rb#222 -class WebMock::URIStringPattern < ::WebMock::URIPattern - # source://webmock/lib/webmock/request_pattern.rb#223 - def add_query_params(query_params); end - - private - - # source://webmock/lib/webmock/request_pattern.rb#246 - def pattern_inspect; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/request_pattern.rb#234 - def pattern_matches?(uri); end -end - -# source://webmock/lib/webmock/util/query_mapper.rb#3 -module WebMock::Util; end - -# source://webmock/lib/webmock/util/hash_counter.rb#7 -class WebMock::Util::HashCounter - # @return [HashCounter] a new instance of HashCounter - # - # source://webmock/lib/webmock/util/hash_counter.rb#10 - def initialize; end - - # source://webmock/lib/webmock/util/hash_counter.rb#38 - def each(&block); end - - # source://webmock/lib/webmock/util/hash_counter.rb#24 - def get(key); end - - # Returns the value of attribute hash. - # - # source://webmock/lib/webmock/util/hash_counter.rb#8 - def hash; end - - # Sets the attribute hash - # - # @param value the value to set the attribute hash to. - # - # source://webmock/lib/webmock/util/hash_counter.rb#8 - def hash=(_arg0); end - - # source://webmock/lib/webmock/util/hash_counter.rb#17 - def put(key, num = T.unsafe(nil)); end - - # source://webmock/lib/webmock/util/hash_counter.rb#30 - def select(&block); end -end - -# source://webmock/lib/webmock/util/hash_keys_stringifier.rb#5 -class WebMock::Util::HashKeysStringifier - class << self - # source://webmock/lib/webmock/util/hash_keys_stringifier.rb#7 - def stringify_keys!(arg, options = T.unsafe(nil)); end - end -end - -# source://webmock/lib/webmock/util/headers.rb#7 -class WebMock::Util::Headers - class << self - # source://webmock/lib/webmock/util/headers.rb#59 - def basic_auth_header(*credentials); end - - # source://webmock/lib/webmock/util/headers.rb#55 - def decode_userinfo_from_header(header); end - - # source://webmock/lib/webmock/util/headers.rb#13 - def normalize_headers(headers); end - - # source://webmock/lib/webmock/util/headers.rb#64 - def normalize_name(name); end - - # source://webmock/lib/webmock/util/headers.rb#40 - def pp_headers_string(headers); end - - # source://webmock/lib/webmock/util/headers.rb#26 - def sorted_headers_string(headers); end - end -end - -# source://webmock/lib/webmock/util/headers.rb#11 -WebMock::Util::Headers::JOIN = T.let(T.unsafe(nil), String) - -# source://webmock/lib/webmock/util/headers.rb#10 -WebMock::Util::Headers::NONSTANDARD_HEADER_DELIMITER = T.let(T.unsafe(nil), String) - -# source://webmock/lib/webmock/util/headers.rb#9 -WebMock::Util::Headers::STANDARD_HEADER_DELIMITER = T.let(T.unsafe(nil), String) - -# source://webmock/lib/webmock/util/json.rb#12 -class WebMock::Util::JSON - class << self - # Ensure that ":" and "," are always followed by a space - # - # source://webmock/lib/webmock/util/json.rb#28 - def convert_json_to_yaml(json); end - - # source://webmock/lib/webmock/util/json.rb#15 - def parse(json); end - - # source://webmock/lib/webmock/util/json.rb#23 - def unescape(str); end - end -end - -# source://webmock/lib/webmock/util/json.rb#13 -class WebMock::Util::JSON::ParseError < ::StandardError; end - -# source://webmock/lib/webmock/util/query_mapper.rb#4 -class WebMock::Util::QueryMapper - class << self - # source://webmock/lib/webmock/util/query_mapper.rb#81 - def collect_query_hash(query_array, empty_accumulator, options); end - - # source://webmock/lib/webmock/util/query_mapper.rb#74 - def collect_query_parts(query); end - - # source://webmock/lib/webmock/util/query_mapper.rb#221 - def dehash(hash); end - - # source://webmock/lib/webmock/util/query_mapper.rb#106 - def fill_accumulator_for_dot(accumulator, key, value); end - - # source://webmock/lib/webmock/util/query_mapper.rb#95 - def fill_accumulator_for_flat(accumulator, key, value); end - - # source://webmock/lib/webmock/util/query_mapper.rb#102 - def fill_accumulator_for_flat_array(accumulator, key, value); end - - # source://webmock/lib/webmock/util/query_mapper.rb#125 - def fill_accumulator_for_subscript(accumulator, key, value); end - - # source://webmock/lib/webmock/util/query_mapper.rb#63 - def normalize_query_hash(query_hash, empty_accumulator, options); end - - # Converts the query component to a Hash value. - # - # @example - # WebMock::Util::QueryMapper.query_to_values("?one=1&two=2&three=3") - # #=> {"one" => "1", "two" => "2", "three" => "3"} - # WebMock::Util::QueryMapper("?one[two][three]=four").query_values - # #=> {"one" => {"two" => {"three" => "four"}}} - # WebMock::Util::QueryMapper.query_to_values("?one.two.three=four", - # :notation => :dot - # ) - # #=> {"one" => {"two" => {"three" => "four"}}} - # WebMock::Util::QueryMapper.query_to_values("?one[two][three]=four", - # :notation => :flat - # ) - # #=> {"one[two][three]" => "four"} - # WebMock::Util::QueryMapper.query_to_values("?one.two.three=four", - # :notation => :flat - # ) - # #=> {"one.two.three" => "four"} - # WebMock::Util::QueryMapper( - # "?one[two][three][]=four&one[two][three][]=five" - # ) - # #=> {"one" => {"two" => {"three" => ["four", "five"]}}} - # WebMock::Util::QueryMapper.query_to_values( - # "?one=two&one=three").query_values(:notation => :flat_array) - # #=> [['one', 'two'], ['one', 'three']] - # @option [Symbol] - # @param [Symbol] [Hash] a customizable set of options - # @return [Hash, Array] The query string parsed as a Hash or Array object. - # - # source://webmock/lib/webmock/util/query_mapper.rb#42 - def query_to_values(query, options = T.unsafe(nil)); end - - # new_query_values have form [['key1', 'value1'], ['key2', 'value2']] - # - # source://webmock/lib/webmock/util/query_mapper.rb#247 - def to_query(parent, value, options = T.unsafe(nil)); end - - # Sets the query component for this URI from a Hash object. - # This method produces a query string using the :subscript notation. - # An empty Hash will result in a nil query. - # - # @param new_query_values [Hash, #to_hash, Array] The new query values. - # - # source://webmock/lib/webmock/util/query_mapper.rb#179 - def values_to_query(new_query_values, options = T.unsafe(nil)); end - end -end - -# source://webmock/lib/webmock/util/uri.rb#7 -class WebMock::Util::URI - class << self - # source://webmock/lib/webmock/util/uri.rb#67 - def encode_unsafe_chars_in_userinfo(userinfo); end - - # source://webmock/lib/webmock/util/uri.rb#28 - def heuristic_parse(uri); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/util/uri.rb#71 - def is_uri_localhost?(uri); end - - # source://webmock/lib/webmock/util/uri.rb#32 - def normalize_uri(uri); end - - # source://webmock/lib/webmock/util/uri.rb#78 - def sort_query_values(query_values); end - - # source://webmock/lib/webmock/util/uri.rb#59 - def strip_default_port_from_uri_string(uri_string); end - - # source://webmock/lib/webmock/util/uri.rb#89 - def uris_encoded_and_unencoded(uris); end - - # source://webmock/lib/webmock/util/uri.rb#83 - def uris_with_inferred_port_and_without(uris); end - - # source://webmock/lib/webmock/util/uri.rb#98 - def uris_with_scheme_and_without(uris); end - - # source://webmock/lib/webmock/util/uri.rb#104 - def uris_with_trailing_slash_and_without(uris); end - - # source://webmock/lib/webmock/util/uri.rb#38 - def variations_of_uri_as_strings(uri_object, only_with_scheme: T.unsafe(nil)); end - end -end - -# source://webmock/lib/webmock/util/uri.rb#12 -WebMock::Util::URI::ADDRESSABLE_URIS = T.let(T.unsafe(nil), Hash) - -# source://webmock/lib/webmock/util/uri.rb#8 -module WebMock::Util::URI::CharacterClasses; end - -# source://webmock/lib/webmock/util/uri.rb#9 -WebMock::Util::URI::CharacterClasses::USERINFO = T.let(T.unsafe(nil), String) - -# source://webmock/lib/webmock/util/uri.rb#16 -WebMock::Util::URI::NORMALIZED_URIS = T.let(T.unsafe(nil), Hash) - -# source://webmock/lib/webmock/util/values_stringifier.rb#3 -class WebMock::Util::ValuesStringifier - class << self - # source://webmock/lib/webmock/util/values_stringifier.rb#4 - def stringify_values(value); end - end -end - -# source://webmock/lib/webmock/version.rb#4 -WebMock::VERSION = T.let(T.unsafe(nil), String) - -# source://webmock/lib/webmock/util/version_checker.rb#28 -class WebMock::VersionChecker - # @return [VersionChecker] a new instance of VersionChecker - # - # source://webmock/lib/webmock/util/version_checker.rb#29 - def initialize(library_name, library_version, min_patch_level, max_minor_version = T.unsafe(nil), unsupported_versions = T.unsafe(nil)); end - - # source://webmock/lib/webmock/util/version_checker.rb#45 - def check_version!; end - - private - - # source://webmock/lib/webmock/util/version_checker.rb#109 - def colorize(text, color_code); end - - # source://webmock/lib/webmock/util/version_checker.rb#86 - def compare_version; end - - # source://webmock/lib/webmock/util/version_checker.rb#105 - def parse_version(version); end - - # @return [Boolean] - # - # source://webmock/lib/webmock/util/version_checker.rb#57 - def too_high?; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/util/version_checker.rb#53 - def too_low?; end - - # @return [Boolean] - # - # source://webmock/lib/webmock/util/version_checker.rb#61 - def unsupported_version?; end - - # source://webmock/lib/webmock/util/version_checker.rb#98 - def version_requirement; end - - # source://webmock/lib/webmock/util/version_checker.rb#70 - def warn_about_too_high; end - - # source://webmock/lib/webmock/util/version_checker.rb#65 - def warn_about_too_low; end - - # source://webmock/lib/webmock/util/version_checker.rb#76 - def warn_about_unsupported_version; end - - # source://webmock/lib/webmock/util/version_checker.rb#82 - def warn_in_red(text); end -end diff --git a/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi b/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi similarity index 91% rename from sorbet/rbi/gems/yard-sorbet@0.8.1.rbi rename to sorbet/rbi/gems/yard-sorbet@0.9.0.rbi index 8cd114c5..f83932b8 100644 --- a/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +++ b/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi @@ -36,7 +36,7 @@ end # source://yard-sorbet/lib/yard-sorbet/handlers.rb#7 module YARDSorbet::Handlers; end -# Apllies an `@abstract` tag to `abstract!`/`interface!` modules (if not alerady present). +# Applies an `@abstract` tag to `abstract!`/`interface!` modules (if not alerady present). # # source://yard-sorbet/lib/yard-sorbet/handlers/abstract_dsl_handler.rb#7 class YARDSorbet::Handlers::AbstractDSLHandler < ::YARD::Handlers::Ruby::Base @@ -95,7 +95,7 @@ end # # source://yard-sorbet/lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#9 class YARDSorbet::Handlers::MixesInClassMethodsHandler < ::YARD::Handlers::Ruby::Base - # source://yard-sorbet/lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#23 + # source://yard-sorbet/lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb#21 sig { void } def process; end @@ -121,7 +121,7 @@ class YARDSorbet::Handlers::SigHandler < ::YARD::Handlers::Ruby::Base # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#73 sig { params(method_objects: T::Array[::YARD::CodeObjects::MethodObject]).void } - def document_attr_methods(method_objects); end + def document_attrs(method_objects); end # An attr* sig can be merged into a previous attr* docstring if it is the only parameter passed to the attr* # declaration. This is to avoid needing to rewrite the source code to separate merged and unmerged attr* @@ -131,7 +131,7 @@ class YARDSorbet::Handlers::SigHandler < ::YARD::Handlers::Ruby::Base sig { params(attr_node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Boolean) } def merged_into_attr?(attr_node); end - # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#78 + # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#76 sig do params( attach_to: T.any(::YARD::CodeObjects::MethodObject, ::YARD::Parser::Ruby::MethodCallNode, ::YARD::Parser::Ruby::MethodDefinitionNode), @@ -141,15 +141,15 @@ class YARDSorbet::Handlers::SigHandler < ::YARD::Handlers::Ruby::Base end def parse_node(attach_to, docstring, include_params: T.unsafe(nil)); end - # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#99 + # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#97 sig { params(node: ::YARD::Parser::Ruby::AstNode, docstring: ::YARD::Docstring).void } def parse_params(node, docstring); end - # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#109 + # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#107 sig { params(node: ::YARD::Parser::Ruby::AstNode, docstring: ::YARD::Docstring).void } def parse_return(node, docstring); end - # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#87 + # source://yard-sorbet/lib/yard-sorbet/handlers/sig_handler.rb#85 sig { params(docstring: ::YARD::Docstring, include_params: T::Boolean).void } def parse_sig(docstring, include_params: T.unsafe(nil)); end @@ -223,27 +223,27 @@ class YARDSorbet::Handlers::StructPropHandler < ::YARD::Handlers::Ruby::Base sig { returns(T::Boolean) } def immutable?; end - # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#44 + # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#42 sig { params(kwd: ::String).returns(T.nilable(::String)) } def kw_arg(kwd); end - # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#49 + # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#45 sig { params(name: ::String).returns(::YARDSorbet::TStructProp) } def make_prop(name); end - # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#60 + # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#56 sig { returns(T::Array[::YARD::Parser::Ruby::AstNode]) } def params; end # Register the field explicitly as an attribute. # - # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#66 + # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#60 sig { params(object: ::YARD::CodeObjects::MethodObject, name: ::String).void } def register_attrs(object, name); end # Store the prop for use in the constructor definition # - # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#74 + # source://yard-sorbet/lib/yard-sorbet/handlers/struct_prop_handler.rb#68 sig { params(prop: ::YARDSorbet::TStructProp).void } def update_state(prop); end end @@ -267,13 +267,19 @@ module YARDSorbet::NodeUtils end def bfs_traverse(node, &_blk); end - # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#32 + # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#31 sig { params(node: ::YARD::Parser::Ruby::AstNode).void } def delete_node(node); end + # Enqueue the eligible children of a node in the BFS queue + # + # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#35 + sig { params(queue: ::Thread::Queue, node: ::YARD::Parser::Ruby::AstNode).void } + def enqueue_children(queue, node); end + # Gets the node that a sorbet `sig` can be attached do, bypassing visisbility modifiers and the like # - # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#38 + # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#48 sig do params( node: ::YARD::Parser::Ruby::AstNode @@ -285,17 +291,17 @@ module YARDSorbet::NodeUtils # # @raise [IndexError] if the node does not have an adjacent sibling (ascending) # - # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#45 + # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#53 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(::YARD::Parser::Ruby::AstNode) } def sibling_node(node); end - # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#52 + # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#60 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Boolean) } def sigable_node?(node); end # @see https://github.com/lsegal/yard/blob/main/lib/yard/handlers/ruby/attribute_handler.rb YARD::Handlers::Ruby::AttributeHandler.validated_attribute_names # - # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#63 + # source://yard-sorbet/lib/yard-sorbet/node_utils.rb#71 sig { params(attr_node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Array[::String]) } def validated_attribute_names(attr_node); end end @@ -329,43 +335,43 @@ module YARDSorbet::SigToYARD private - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#61 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#58 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(::String) } def build_generic_type(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#70 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#67 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) } def convert_aref(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#82 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#79 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) } def convert_array(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#90 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#87 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) } def convert_collection(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#97 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#94 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) } def convert_hash(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#105 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#102 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) } def convert_list(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#31 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#28 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) } def convert_node(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#43 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#40 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns(T::Array[::String]) } def convert_node_type(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#110 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#107 sig { params(node: ::YARD::Parser::Ruby::MethodCallNode).returns(T::Array[::String]) } def convert_t_method(node); end - # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#121 + # source://yard-sorbet/lib/yard-sorbet/sig_to_yard.rb#118 sig { params(node: ::YARD::Parser::Ruby::AstNode).returns([::String]) } def convert_unknown(node); end end @@ -382,7 +388,7 @@ class YARDSorbet::TStructProp < ::T::Struct const :types, T::Array[::String] class << self - # source://sorbet-runtime/0.5.11577lib/types/struct.rb#13 + # source://sorbet-runtime/0.5.11635lib/types/struct.rb#13 def inherited(s); end end end @@ -404,7 +410,7 @@ module YARDSorbet::TagUtils # Create or update a `YARD` tag with type information # - # source://yard-sorbet/lib/yard-sorbet/tag_utils.rb#30 + # source://yard-sorbet/lib/yard-sorbet/tag_utils.rb#28 sig do params( docstring: ::YARD::Docstring, diff --git a/sorbet/rbi/gems/yard@0.9.36.rbi b/sorbet/rbi/gems/yard@0.9.37.rbi similarity index 97% rename from sorbet/rbi/gems/yard@0.9.36.rbi rename to sorbet/rbi/gems/yard@0.9.37.rbi index 3ea28f6b..b800a7b1 100644 --- a/sorbet/rbi/gems/yard@0.9.36.rbi +++ b/sorbet/rbi/gems/yard@0.9.37.rbi @@ -3344,11 +3344,11 @@ YARD::CodeObjects::METHODNAMEMATCH = T.let(T.unsafe(nil), Regexp) # # Extra data added to docstring # property :bar # -# source://yard/lib/yard/code_objects/macro_object.rb#30 +# source://yard/lib/yard/code_objects/macro_object.rb#29 class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # @return [Boolean] whether this macro is attached to a method # - # source://yard/lib/yard/code_objects/macro_object.rb#149 + # source://yard/lib/yard/code_objects/macro_object.rb#148 def attached?; end # Expands the macro using @@ -3363,39 +3363,39 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # call, if there is a block. # @see expand # - # source://yard/lib/yard/code_objects/macro_object.rb#167 + # source://yard/lib/yard/code_objects/macro_object.rb#166 def expand(call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end # @return [String] the macro data stored on the object # - # source://yard/lib/yard/code_objects/macro_object.rb#142 + # source://yard/lib/yard/code_objects/macro_object.rb#141 def macro_data; end # @return [String] the macro data stored on the object # - # source://yard/lib/yard/code_objects/macro_object.rb#142 + # source://yard/lib/yard/code_objects/macro_object.rb#141 def macro_data=(_arg0); end # @return [CodeObjects::Base] the method object that this macro is # attached to. # - # source://yard/lib/yard/code_objects/macro_object.rb#146 + # source://yard/lib/yard/code_objects/macro_object.rb#145 def method_object; end # @return [CodeObjects::Base] the method object that this macro is # attached to. # - # source://yard/lib/yard/code_objects/macro_object.rb#146 + # source://yard/lib/yard/code_objects/macro_object.rb#145 def method_object=(_arg0); end # Overrides {Base#path} so the macro path is ".macro.MACRONAME" # - # source://yard/lib/yard/code_objects/macro_object.rb#152 + # source://yard/lib/yard/code_objects/macro_object.rb#151 def path; end # Overrides the separator to be '.' # - # source://yard/lib/yard/code_objects/macro_object.rb#155 + # source://yard/lib/yard/code_objects/macro_object.rb#154 def sep; end class << self @@ -3413,7 +3413,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # @return [String] the expanded macro data # @see find_or_create # - # source://yard/lib/yard/code_objects/macro_object.rb#120 + # source://yard/lib/yard/code_objects/macro_object.rb#119 def apply(docstring, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil), _method_object = T.unsafe(nil)); end # Applies a macro to a docstring, interpolating the macro's data on the @@ -3429,7 +3429,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # interpolating the block data as a variable. # @return [String] the expanded macro data # - # source://yard/lib/yard/code_objects/macro_object.rb#136 + # source://yard/lib/yard/code_objects/macro_object.rb#135 def apply_macro(macro, docstring, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end # Creates a new macro and fills in the relevant properties. @@ -3440,7 +3440,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # macro to. If supplied, {#attached?} will be true # @return [MacroObject] the newly created object # - # source://yard/lib/yard/code_objects/macro_object.rb#40 + # source://yard/lib/yard/code_objects/macro_object.rb#39 def create(macro_name, data, method_object = T.unsafe(nil)); end # Parses a given docstring and determines if the macro is "new" or @@ -3460,7 +3460,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # @return [nil] if the +data+ has no macro tag or if the macro is # not new and no macro by the macro name is found. # - # source://yard/lib/yard/code_objects/macro_object.rb#71 + # source://yard/lib/yard/code_objects/macro_object.rb#70 def create_docstring(macro_name, data, method_object = T.unsafe(nil)); end # Expands +macro_data+ using the interpolation parameters. @@ -3473,7 +3473,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # # @param macro_data [String] the macro data to expand (taken from {#macro_data}) # - # source://yard/lib/yard/code_objects/macro_object.rb#93 + # source://yard/lib/yard/code_objects/macro_object.rb#92 def expand(macro_data, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end # Finds a macro using +macro_name+ @@ -3482,7 +3482,7 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # @return [MacroObject] if a macro is found # @return [nil] if there is no registered macro by that name # - # source://yard/lib/yard/code_objects/macro_object.rb#51 + # source://yard/lib/yard/code_objects/macro_object.rb#50 def find(macro_name); end # Parses a given docstring and determines if the macro is "new" or @@ -3502,12 +3502,12 @@ class YARD::CodeObjects::MacroObject < ::YARD::CodeObjects::Base # @return [nil] if the +data+ has no macro tag or if the macro is # not new and no macro by the macro name is found. # - # source://yard/lib/yard/code_objects/macro_object.rb#71 + # source://yard/lib/yard/code_objects/macro_object.rb#70 def find_or_create(macro_name, data, method_object = T.unsafe(nil)); end end end -# source://yard/lib/yard/code_objects/macro_object.rb#31 +# source://yard/lib/yard/code_objects/macro_object.rb#30 YARD::CodeObjects::MacroObject::MACRO_MATCH = T.let(T.unsafe(nil), Regexp) # Represents a Ruby method in source @@ -4842,7 +4842,7 @@ YARD::Docstring::META_MATCH = T.let(T.unsafe(nil), Regexp) # @see #parse_content # @since 0.8.0 # -# source://yard/lib/yard/docstring_parser.rb#30 +# source://yard/lib/yard/docstring_parser.rb#29 class YARD::DocstringParser # Creates a new parser to parse docstring data # @@ -4851,7 +4851,7 @@ class YARD::DocstringParser # @return [DocstringParser] a new instance of DocstringParser # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#81 + # source://yard/lib/yard/docstring_parser.rb#80 def initialize(library = T.unsafe(nil)); end # Creates a new directive using the registered {#library} @@ -4859,14 +4859,14 @@ class YARD::DocstringParser # @return [Tags::Directive] the directive object that is created # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#232 + # source://yard/lib/yard/docstring_parser.rb#231 def create_directive(tag_name, tag_buf); end # Creates a {Tags::RefTag} # # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#226 + # source://yard/lib/yard/docstring_parser.rb#225 def create_ref_tag(tag_name, name, object_name); end # Creates a tag from the {Tags::DefaultFactory tag factory}. @@ -4878,7 +4878,7 @@ class YARD::DocstringParser # @return [Tags::Tag, Tags::RefTag] a tag # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#209 + # source://yard/lib/yard/docstring_parser.rb#208 def create_tag(tag_name, tag_buf = T.unsafe(nil)); end # @return [Array<Tags::Directive>] a list of directives identified @@ -4886,7 +4886,7 @@ class YARD::DocstringParser # Docstring object. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#45 + # source://yard/lib/yard/docstring_parser.rb#44 def directives; end # @return [Array<Tags::Directive>] a list of directives identified @@ -4894,7 +4894,7 @@ class YARD::DocstringParser # Docstring object. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#45 + # source://yard/lib/yard/docstring_parser.rb#44 def directives=(_arg0); end # @return [Handlers::Base, nil] the handler parsing this @@ -4902,7 +4902,7 @@ class YARD::DocstringParser # initialized through # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#66 + # source://yard/lib/yard/docstring_parser.rb#65 def handler; end # @return [Handlers::Base, nil] the handler parsing this @@ -4910,21 +4910,21 @@ class YARD::DocstringParser # initialized through # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#66 + # source://yard/lib/yard/docstring_parser.rb#65 def handler=(_arg0); end # @return [Tags::Library] the tag library being used to # identify registered tags in the docstring. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#70 + # source://yard/lib/yard/docstring_parser.rb#69 def library; end # @return [Tags::Library] the tag library being used to # identify registered tags in the docstring. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#70 + # source://yard/lib/yard/docstring_parser.rb#69 def library=(_arg0); end # @return [CodeObjects::Base, nil] the object associated with @@ -4932,7 +4932,7 @@ class YARD::DocstringParser # not attached to any object. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#56 + # source://yard/lib/yard/docstring_parser.rb#55 def object; end # @return [CodeObjects::Base, nil] the object associated with @@ -4940,7 +4940,7 @@ class YARD::DocstringParser # not attached to any object. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#56 + # source://yard/lib/yard/docstring_parser.rb#55 def object=(_arg0); end # Parses all content and returns itself. @@ -4957,7 +4957,7 @@ class YARD::DocstringParser # @see #to_docstring # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#113 + # source://yard/lib/yard/docstring_parser.rb#112 def parse(content, object = T.unsafe(nil), handler = T.unsafe(nil)); end # Parses a given block of text. @@ -4967,7 +4967,7 @@ class YARD::DocstringParser # @param content [String] the content to parse # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#129 + # source://yard/lib/yard/docstring_parser.rb#128 def parse_content(content); end # Call post processing callbacks on parser. @@ -4977,19 +4977,19 @@ class YARD::DocstringParser # @return [void] # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#196 + # source://yard/lib/yard/docstring_parser.rb#195 def post_process; end # @return [String] the complete input string to the parser. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#36 + # source://yard/lib/yard/docstring_parser.rb#35 def raw_text; end # @return [String] the complete input string to the parser. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#36 + # source://yard/lib/yard/docstring_parser.rb#35 def raw_text=(_arg0); end # @return [CodeObjects::Base, nil] the object referenced by @@ -4997,7 +4997,7 @@ class YARD::DocstringParser # refer to any object. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#61 + # source://yard/lib/yard/docstring_parser.rb#60 def reference; end # @return [CodeObjects::Base, nil] the object referenced by @@ -5005,7 +5005,7 @@ class YARD::DocstringParser # refer to any object. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#61 + # source://yard/lib/yard/docstring_parser.rb#60 def reference=(_arg0); end # @return [OpenStruct] any arbitrary state to be passed between @@ -5014,7 +5014,7 @@ class YARD::DocstringParser # used in a docstring). # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#51 + # source://yard/lib/yard/docstring_parser.rb#50 def state; end # @return [OpenStruct] any arbitrary state to be passed between @@ -5023,7 +5023,7 @@ class YARD::DocstringParser # used in a docstring). # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#51 + # source://yard/lib/yard/docstring_parser.rb#50 def state=(_arg0); end # Backward compatibility to detect old tags that should be specified @@ -5032,42 +5032,42 @@ class YARD::DocstringParser # @return [Boolean] # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#252 + # source://yard/lib/yard/docstring_parser.rb#251 def tag_is_directive?(tag_name); end # @return [Array<Tags::Tag>] the list of meta-data tags identified # by the parser # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#40 + # source://yard/lib/yard/docstring_parser.rb#39 def tags; end # @return [Array<Tags::Tag>] the list of meta-data tags identified # by the parser # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#40 + # source://yard/lib/yard/docstring_parser.rb#39 def tags=(_arg0); end # @return [String] the parsed text portion of the docstring, # with tags removed. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#33 + # source://yard/lib/yard/docstring_parser.rb#32 def text; end # @return [String] the parsed text portion of the docstring, # with tags removed. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#33 + # source://yard/lib/yard/docstring_parser.rb#32 def text=(_arg0); end # @return [Docstring] translates parsed text into # a Docstring object. # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#95 + # source://yard/lib/yard/docstring_parser.rb#94 def to_docstring; end private @@ -5076,7 +5076,7 @@ class YARD::DocstringParser # # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#324 + # source://yard/lib/yard/docstring_parser.rb#323 def call_after_parse_callbacks; end # Calls the {Tags::Directive#after_parse} callback on all the @@ -5084,17 +5084,17 @@ class YARD::DocstringParser # # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#319 + # source://yard/lib/yard/docstring_parser.rb#318 def call_directives_after_parse; end # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#305 + # source://yard/lib/yard/docstring_parser.rb#304 def detect_reference(content); end # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#301 + # source://yard/lib/yard/docstring_parser.rb#300 def namespace; end class << self @@ -5109,13 +5109,13 @@ class YARD::DocstringParser # with all directives and tags created. # @yieldreturn [void] # - # source://yard/lib/yard/docstring_parser.rb#266 + # source://yard/lib/yard/docstring_parser.rb#265 def after_parse(&block); end # @return [Array<Proc>] the {after_parse} callback proc objects # @since 0.8.0 # - # source://yard/lib/yard/docstring_parser.rb#271 + # source://yard/lib/yard/docstring_parser.rb#270 def after_parse_callbacks; end end end @@ -5124,7 +5124,7 @@ end # # @since 0.8.0 # -# source://yard/lib/yard/docstring_parser.rb#73 +# source://yard/lib/yard/docstring_parser.rb#72 YARD::DocstringParser::META_MATCH = T.let(T.unsafe(nil), Regexp) # source://yard/lib/yard/gem_index.rb#6 @@ -6033,14 +6033,14 @@ end # # @see Handlers::Base # -# source://yard/lib/yard/handlers/processor.rb#20 +# source://yard/lib/yard/handlers/processor.rb#19 class YARD::Handlers::Processor # Creates a new Processor for a +file+. # # @param parser [Parser::SourceParser] the parser used to initialize the processor # @return [Processor] a new instance of Processor # - # source://yard/lib/yard/handlers/processor.rb#92 + # source://yard/lib/yard/handlers/processor.rb#91 def initialize(parser); end # Share state across different handlers inside of a file. @@ -6053,7 +6053,7 @@ class YARD::Handlers::Processor # @return [OpenStruct] an open structure that can store arbitrary data # @see #globals # - # source://yard/lib/yard/handlers/processor.rb#88 + # source://yard/lib/yard/handlers/processor.rb#87 def extra_state; end # Share state across different handlers inside of a file. @@ -6066,17 +6066,17 @@ class YARD::Handlers::Processor # @return [OpenStruct] an open structure that can store arbitrary data # @see #globals # - # source://yard/lib/yard/handlers/processor.rb#88 + # source://yard/lib/yard/handlers/processor.rb#87 def extra_state=(_arg0); end # @return [String] the filename # - # source://yard/lib/yard/handlers/processor.rb#41 + # source://yard/lib/yard/handlers/processor.rb#40 def file; end # @return [String] the filename # - # source://yard/lib/yard/handlers/processor.rb#41 + # source://yard/lib/yard/handlers/processor.rb#40 def file=(_arg0); end # Searches for all handlers in {Base.subclasses} that match the +statement+ @@ -6084,7 +6084,7 @@ class YARD::Handlers::Processor # @param statement the statement object to match. # @return [Array<Base>] a list of handlers to process the statement with. # - # source://yard/lib/yard/handlers/processor.rb#151 + # source://yard/lib/yard/handlers/processor.rb#150 def find_handlers(statement); end # Handlers can share state for the entire post processing stage through @@ -6104,7 +6104,7 @@ class YARD::Handlers::Processor # @return [OpenStruct] global shared state for post-processing stage # @see #extra_state # - # source://yard/lib/yard/handlers/processor.rb#77 + # source://yard/lib/yard/handlers/processor.rb#76 def globals; end # Handlers can share state for the entire post processing stage through @@ -6124,17 +6124,17 @@ class YARD::Handlers::Processor # @return [OpenStruct] global shared state for post-processing stage # @see #extra_state # - # source://yard/lib/yard/handlers/processor.rb#77 + # source://yard/lib/yard/handlers/processor.rb#76 def globals=(_arg0); end # @return [CodeObjects::NamespaceObject] the current namespace # - # source://yard/lib/yard/handlers/processor.rb#44 + # source://yard/lib/yard/handlers/processor.rb#43 def namespace; end # @return [CodeObjects::NamespaceObject] the current namespace # - # source://yard/lib/yard/handlers/processor.rb#44 + # source://yard/lib/yard/handlers/processor.rb#43 def namespace=(_arg0); end # @return [CodeObjects::Base, nil] unlike the namespace, the owner @@ -6142,7 +6142,7 @@ class YARD::Handlers::Processor # For instance, when parsing a method body, the {CodeObjects::MethodObject} # is set as the owner, in case any extra method information is processed. # - # source://yard/lib/yard/handlers/processor.rb#56 + # source://yard/lib/yard/handlers/processor.rb#55 def owner; end # @return [CodeObjects::Base, nil] unlike the namespace, the owner @@ -6150,7 +6150,7 @@ class YARD::Handlers::Processor # For instance, when parsing a method body, the {CodeObjects::MethodObject} # is set as the owner, in case any extra method information is processed. # - # source://yard/lib/yard/handlers/processor.rb#56 + # source://yard/lib/yard/handlers/processor.rb#55 def owner=(_arg0); end # Continue parsing the remainder of the files in the +globals.ordered_parser+ @@ -6160,17 +6160,17 @@ class YARD::Handlers::Processor # @return [void] # @see Parser::OrderedParser # - # source://yard/lib/yard/handlers/processor.rb#140 + # source://yard/lib/yard/handlers/processor.rb#139 def parse_remaining_files; end # @return [Symbol] the parser type (:ruby, :ruby18, :c) # - # source://yard/lib/yard/handlers/processor.rb#59 + # source://yard/lib/yard/handlers/processor.rb#58 def parser_type; end # @return [Symbol] the parser type (:ruby, :ruby18, :c) # - # source://yard/lib/yard/handlers/processor.rb#59 + # source://yard/lib/yard/handlers/processor.rb#58 def parser_type=(_arg0); end # Processes a list of statements by finding handlers to process each @@ -6179,27 +6179,27 @@ class YARD::Handlers::Processor # @param statements [Array] a list of statements # @return [void] # - # source://yard/lib/yard/handlers/processor.rb#110 + # source://yard/lib/yard/handlers/processor.rb#109 def process(statements); end # @return [Symbol] the current scope (class, instance) # - # source://yard/lib/yard/handlers/processor.rb#50 + # source://yard/lib/yard/handlers/processor.rb#49 def scope; end # @return [Symbol] the current scope (class, instance) # - # source://yard/lib/yard/handlers/processor.rb#50 + # source://yard/lib/yard/handlers/processor.rb#49 def scope=(_arg0); end # @return [Symbol] the current visibility (public, private, protected) # - # source://yard/lib/yard/handlers/processor.rb#47 + # source://yard/lib/yard/handlers/processor.rb#46 def visibility; end # @return [Symbol] the current visibility (public, private, protected) # - # source://yard/lib/yard/handlers/processor.rb#47 + # source://yard/lib/yard/handlers/processor.rb#46 def visibility=(_arg0); end private @@ -6208,7 +6208,7 @@ class YARD::Handlers::Processor # # @return [Base] the base class # - # source://yard/lib/yard/handlers/processor.rb#172 + # source://yard/lib/yard/handlers/processor.rb#171 def handler_base_class; end # The module holding the handlers to be loaded @@ -6216,12 +6216,12 @@ class YARD::Handlers::Processor # @return [Module] the module containing the handlers depending on # {#parser_type}. # - # source://yard/lib/yard/handlers/processor.rb#180 + # source://yard/lib/yard/handlers/processor.rb#179 def handler_base_namespace; end # @return [Boolean] # - # source://yard/lib/yard/handlers/processor.rb#161 + # source://yard/lib/yard/handlers/processor.rb#160 def handles?(handler, statement); end # Loads handlers from {#handler_base_namespace}. This ensures that @@ -6230,7 +6230,7 @@ class YARD::Handlers::Processor # # @return [void] # - # source://yard/lib/yard/handlers/processor.rb#188 + # source://yard/lib/yard/handlers/processor.rb#187 def load_handlers; end class << self @@ -6238,14 +6238,14 @@ class YARD::Handlers::Processor # @return [Hash] a list of registered parser type extensions # @since 0.6.0 # - # source://yard/lib/yard/handlers/processor.rb#33 + # source://yard/lib/yard/handlers/processor.rb#32 def namespace_for_handler; end # Registers a new namespace for handlers of the given type. # # @since 0.6.0 # - # source://yard/lib/yard/handlers/processor.rb#24 + # source://yard/lib/yard/handlers/processor.rb#23 def register_handler_namespace(type, ns); end end end @@ -7078,6 +7078,11 @@ end # source://yard/lib/yard/handlers/ruby/visibility_handler.rb#3 class YARD::Handlers::Ruby::VisibilityHandler < ::YARD::Handlers::Ruby::Base include ::YARD::Handlers::Ruby::DecoratorHandlerMethods + + # @return [Boolean] + # + # source://yard/lib/yard/handlers/ruby/visibility_handler.rb#31 + def is_attribute_method?(node); end end # Handles 'yield' calls @@ -7540,13 +7545,16 @@ end # Handles console logging for info, warnings and errors. # Uses the stdlib Logger class in Ruby for all the backend logic. # -# source://yard/lib/yard/logging.rb#9 -class YARD::Logger < ::Logger +# source://yard/lib/yard/logging.rb#8 +class YARD::Logger + include ::YARD::Logger::Severity + # Creates a new logger # + # @private # @return [Logger] a new instance of Logger # - # source://yard/lib/yard/logging.rb#43 + # source://yard/lib/yard/logging.rb#82 def initialize(pipe, *args); end # Displays an unformatted line to the logger output stream. @@ -7555,7 +7563,7 @@ class YARD::Logger < ::Logger # @return [void] # @since 0.8.2 # - # source://yard/lib/yard/logging.rb#143 + # source://yard/lib/yard/logging.rb#205 def <<(msg = T.unsafe(nil)); end # Prints the backtrace +exc+ to the logger as error data. @@ -7564,7 +7572,7 @@ class YARD::Logger < ::Logger # @param level_meth [Symbol] the level to log backtrace at # @return [void] # - # source://yard/lib/yard/logging.rb#154 + # source://yard/lib/yard/logging.rb#216 def backtrace(exc, level_meth = T.unsafe(nil)); end # Captures the duration of a block of code for benchmark analysis. Also @@ -7577,7 +7585,7 @@ class YARD::Logger < ::Logger # @todo Implement capture storage for reporting of benchmarks # @yield a block of arbitrary code to benchmark # - # source://yard/lib/yard/logging.rb#80 + # source://yard/lib/yard/logging.rb#234 def capture(msg, nontty_log = T.unsafe(nil)); end # Clears the progress indicator in the TTY display. @@ -7585,14 +7593,18 @@ class YARD::Logger < ::Logger # @return [void] # @since 0.8.2 # - # source://yard/lib/yard/logging.rb#121 + # source://yard/lib/yard/logging.rb#186 def clear_progress; end - # Changes the debug level to DEBUG if $DEBUG is set - # and writes a debugging message. + # Changes the debug level to DEBUG if $DEBUG is set and writes a debugging message. + # Logs a message with the debug severity level. # - # source://yard/lib/yard/logging.rb#59 - def debug(*args); end + # @param message [String] the message to log + # @return [void] + # @see #log + # + # source://yard/lib/yard/logging.rb#103 + def debug(message); end # Sets the logger level for the duration of the block # @@ -7604,17 +7616,65 @@ class YARD::Logger < ::Logger # values can be found in Ruby's Logger class. # @yield the block with the logger temporarily set to +new_level+ # - # source://yard/lib/yard/logging.rb#179 + # source://yard/lib/yard/logging.rb#142 def enter_level(new_level = T.unsafe(nil)); end + # Logs a message with the error severity level. + # + # @param message [String] the message to log + # @return [void] + # @see #log + # + # source://yard/lib/yard/logging.rb#103 + def error(message); end + + # Logs a message with the fatal severity level. + # + # @param message [String] the message to log + # @return [void] + # @see #log + # + # source://yard/lib/yard/logging.rb#103 + def fatal(message); end + + # Logs a message with the info severity level. + # + # @param message [String] the message to log + # @return [void] + # @see #log + # + # source://yard/lib/yard/logging.rb#103 + def info(message); end + # @return [IO] the IO object being logged to # @since 0.8.2 # - # source://yard/lib/yard/logging.rb#17 + # source://yard/lib/yard/logging.rb#49 def io; end - # source://yard/lib/yard/logging.rb#18 - def io=(pipe); end + # @return [IO] the IO object being logged to + # @since 0.8.2 + # + # source://yard/lib/yard/logging.rb#49 + def io=(_arg0); end + + # @return [DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN] the logging level + # + # source://yard/lib/yard/logging.rb#57 + def level; end + + # @return [DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN] the logging level + # + # source://yard/lib/yard/logging.rb#57 + def level=(_arg0); end + + # Logs a message with a given severity + # + # @param severity [DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN] the severity level + # @param message [String] the message to log + # + # source://yard/lib/yard/logging.rb#122 + def log(severity, message); end # Displays an unformatted line to the logger output stream. # @@ -7622,7 +7682,7 @@ class YARD::Logger < ::Logger # @return [void] # @since 0.8.2 # - # source://yard/lib/yard/logging.rb#143 + # source://yard/lib/yard/logging.rb#205 def print(msg = T.unsafe(nil)); end # Displays a progress indicator for a given message. This progress report @@ -7635,7 +7695,7 @@ class YARD::Logger < ::Logger # @return [void] # @since 0.8.2 # - # source://yard/lib/yard/logging.rb#96 + # source://yard/lib/yard/logging.rb#161 def progress(msg, nontty_log = T.unsafe(nil)); end # Displays an unformatted line to the logger output stream, adding @@ -7645,86 +7705,91 @@ class YARD::Logger < ::Logger # @return [void] # @since 0.8.2 # - # source://yard/lib/yard/logging.rb#132 + # source://yard/lib/yard/logging.rb#197 def puts(msg = T.unsafe(nil)); end # @return [Boolean] whether backtraces should be shown (by default # this is on). # - # source://yard/lib/yard/logging.rb#22 + # source://yard/lib/yard/logging.rb#53 def show_backtraces; end # Sets the attribute show_backtraces # # @param value the value to set the attribute show_backtraces to. # - # source://yard/lib/yard/logging.rb#23 + # source://yard/lib/yard/logging.rb#54 def show_backtraces=(_arg0); end # @return [Boolean] whether progress indicators should be shown when # logging CLIs (by default this is off). # - # source://yard/lib/yard/logging.rb#27 + # source://yard/lib/yard/logging.rb#64 def show_progress; end # Sets the attribute show_progress # # @param value the value to set the attribute show_progress to. # - # source://yard/lib/yard/logging.rb#34 + # source://yard/lib/yard/logging.rb#70 def show_progress=(_arg0); end + # Logs a message with the unknown severity level. + # + # @param message [String] the message to log + # @return [void] + # @see #log + # + # source://yard/lib/yard/logging.rb#103 + def unknown(message); end + # Remembers when a warning occurs and writes a warning message. + # Logs a message with the warn severity level. # - # source://yard/lib/yard/logging.rb#65 - def warn(*args); end + # @param message [String] the message to log + # @return [void] + # @see #log + # + # source://yard/lib/yard/logging.rb#103 + def warn(message); end # Warns that the Ruby environment does not support continuations. Applies # to JRuby, Rubinius and MacRuby. This warning will only display once # per Ruby process. # # @deprecated Continuations are no longer needed by YARD 0.8.0+. + # @private # @return [void] # - # source://yard/lib/yard/logging.rb#167 + # source://yard/lib/yard/logging.rb#250 def warn_no_continuations; end - # Returns the value of attribute warned. + # @return [Boolean] whether a warn message has been emitted. Used for status tracking. # - # source://yard/lib/yard/logging.rb#69 + # source://yard/lib/yard/logging.rb#60 def warned; end - # Sets the attribute warned + # @return [Boolean] whether a warn message has been emitted. Used for status tracking. # - # @param value the value to set the attribute warned to. - # - # source://yard/lib/yard/logging.rb#69 + # source://yard/lib/yard/logging.rb#60 def warned=(_arg0); end private - # Override this internal Logger method to clear line - # - # source://yard/lib/yard/logging.rb#190 - def add(*args); end - - # source://yard/lib/yard/logging.rb#195 + # source://yard/lib/yard/logging.rb#255 def clear_line; end - # Log format (from Logger implementation). Used by Logger internally - # - # source://yard/lib/yard/logging.rb#201 - def format_log(sev, _time, _prog, msg); end - - # source://logger/1.6.1lib/logger.rb#689 - def print_no_newline(msg); end - class << self + # @private + # + # source://yard/lib/yard/logging.rb#101 + def create_log_method(name); end + # The logger instance # # @return [Logger] the logger instance # - # source://yard/lib/yard/logging.rb#38 + # source://yard/lib/yard/logging.rb#76 def instance(pipe = T.unsafe(nil)); end end end @@ -7734,9 +7799,97 @@ end # # @since 0.8.2 # -# source://yard/lib/yard/logging.rb#13 +# source://yard/lib/yard/logging.rb#45 YARD::Logger::PROGRESS_INDICATORS = T.let(T.unsafe(nil), Array) +# Log severity levels +# +# source://yard/lib/yard/logging.rb#10 +module YARD::Logger::Severity; end + +# Debugging log level +# +# source://yard/lib/yard/logging.rb#12 +YARD::Logger::Severity::DEBUG = T.let(T.unsafe(nil), Integer) + +# Error log level +# +# source://yard/lib/yard/logging.rb#21 +YARD::Logger::Severity::ERROR = T.let(T.unsafe(nil), Integer) + +# Fatal log level +# +# source://yard/lib/yard/logging.rb#24 +YARD::Logger::Severity::FATAL = T.let(T.unsafe(nil), Integer) + +# Information log level +# +# source://yard/lib/yard/logging.rb#15 +YARD::Logger::Severity::INFO = T.let(T.unsafe(nil), Integer) + +# @private +# +# source://yard/lib/yard/logging.rb#30 +YARD::Logger::Severity::SEVERITIES = T.let(T.unsafe(nil), Hash) + +# Unknown log level +# +# source://yard/lib/yard/logging.rb#27 +YARD::Logger::Severity::UNKNOWN = T.let(T.unsafe(nil), Integer) + +# Warning log level +# +# source://yard/lib/yard/logging.rb#18 +YARD::Logger::Severity::WARN = T.let(T.unsafe(nil), Integer) + +# An OpenStruct compatible struct class that allows for basic access of attributes +# via +struct.attr_name+ and +struct.attr_name = value+. +# +# source://yard/lib/yard/open_struct.rb#4 +class YARD::OpenStruct + # @return [OpenStruct] a new instance of OpenStruct + # + # source://yard/lib/yard/open_struct.rb#5 + def initialize(hash = T.unsafe(nil)); end + + # source://yard/lib/yard/open_struct.rb#25 + def ==(other); end + + # source://yard/lib/yard/open_struct.rb#41 + def [](key); end + + # source://yard/lib/yard/open_struct.rb#37 + def []=(key, value); end + + # source://yard/lib/yard/open_struct.rb#33 + def dig(*keys); end + + # source://yard/lib/yard/open_struct.rb#45 + def each_pair(&block); end + + # source://yard/lib/yard/open_struct.rb#29 + def hash; end + + # source://yard/lib/yard/open_struct.rb#49 + def marshal_dump; end + + # source://yard/lib/yard/open_struct.rb#53 + def marshal_load(data); end + + # @private + # + # source://yard/lib/yard/open_struct.rb#10 + def method_missing(name, *args); end + + # source://yard/lib/yard/open_struct.rb#21 + def to_h; end + + private + + # source://yard/lib/yard/open_struct.rb#59 + def __cache_lookup__(name); end +end + # Generalized options class for passing around large amounts of options between objects. # # The options class exists for better visibility and documentability of options being @@ -8288,7 +8441,7 @@ end # # @see Processor#parse_remaining_files # -# source://yard/lib/yard/parser/source_parser.rb#21 +# source://yard/lib/yard/parser/source_parser.rb#20 class YARD::Parser::OrderedParser # Creates a new OrderedParser with the global state and a list # of files to parse. @@ -8300,30 +8453,30 @@ class YARD::Parser::OrderedParser # @param files [Array<String>] the list of files to parse # @return [OrderedParser] a new instance of OrderedParser # - # source://yard/lib/yard/parser/source_parser.rb#33 + # source://yard/lib/yard/parser/source_parser.rb#32 def initialize(global_state, files); end # @return [Array<String>] the list of remaining files to parse # - # source://yard/lib/yard/parser/source_parser.rb#23 + # source://yard/lib/yard/parser/source_parser.rb#22 def files; end # @return [Array<String>] the list of remaining files to parse # - # source://yard/lib/yard/parser/source_parser.rb#23 + # source://yard/lib/yard/parser/source_parser.rb#22 def files=(_arg0); end # Parses the remainder of the {#files} list. # # @see Processor#parse_remaining_files # - # source://yard/lib/yard/parser/source_parser.rb#42 + # source://yard/lib/yard/parser/source_parser.rb#41 def parse; end end # Raised when the parser sees a Ruby syntax error # -# source://yard/lib/yard/parser/source_parser.rb#13 +# source://yard/lib/yard/parser/source_parser.rb#12 class YARD::Parser::ParserSyntaxError < ::YARD::Parser::UndocumentableError; end # Ruby parsing components. @@ -8768,6 +8921,9 @@ class YARD::Parser::Ruby::Legacy::RubyLex # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#430 def continue; end + # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1116 + def dedent(str); end + # Returns the value of attribute exception_on_syntax_error. # # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#463 @@ -8792,7 +8948,7 @@ class YARD::Parser::Ruby::Legacy::RubyLex # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#488 def gets; end - # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1257 + # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1272 def identify_comment; end # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#945 @@ -8804,13 +8960,13 @@ class YARD::Parser::Ruby::Legacy::RubyLex # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#980 def identify_identifier; end - # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1130 + # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1145 def identify_number(start); end - # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1111 + # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1126 def identify_quotation(initial_char); end - # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1192 + # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1207 def identify_string(ltype, quoted = T.unsafe(nil), opener = T.unsafe(nil), initial_char = T.unsafe(nil)); end # Returns the value of attribute indent. @@ -8857,10 +9013,10 @@ class YARD::Parser::Ruby::Legacy::RubyLex # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#462 def read_auto_clean_up=(_arg0); end - # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1280 + # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1295 def read_escape; end - # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1242 + # source://yard/lib/yard/parser/ruby/legacy/ruby_lex.rb#1257 def skip_inner_expression; end # Returns the value of attribute skip_space. @@ -11049,7 +11205,7 @@ end # @see Handlers::Base # @see CodeObjects::Base # -# source://yard/lib/yard/parser/source_parser.rb#64 +# source://yard/lib/yard/parser/source_parser.rb#63 class YARD::Parser::SourceParser # @overload initialize # @return [SourceParser] a new instance of SourceParser @@ -11305,7 +11461,7 @@ class YARD::Parser::SourceParser # {YARD::Logger} # @return [void] # - # source://yard/lib/yard/parser/source_parser.rb#100 + # source://yard/lib/yard/parser/source_parser.rb#99 def parse(paths = T.unsafe(nil), excluded = T.unsafe(nil), level = T.unsafe(nil)); end # Parses a string +content+ @@ -11319,10 +11475,10 @@ class YARD::Parser::SourceParser # @return [Symbol] the default parser type (defaults to :ruby) # - # source://yard/lib/yard/parser/source_parser.rb#86 + # source://yard/lib/yard/parser/source_parser.rb#85 def parser_type; end - # source://yard/lib/yard/parser/source_parser.rb#88 + # source://yard/lib/yard/parser/source_parser.rb#87 def parser_type=(value); end # @private @@ -11403,30 +11559,30 @@ end # # @since 0.9.0 # -# source://yard/lib/yard/parser/source_parser.rb#71 +# source://yard/lib/yard/parser/source_parser.rb#70 YARD::Parser::SourceParser::DEFAULT_PATH_GLOB = T.let(T.unsafe(nil), Array) # Byte order marks for various encodings # # @since 0.7.0 # -# source://yard/lib/yard/parser/source_parser.rb#75 +# source://yard/lib/yard/parser/source_parser.rb#74 YARD::Parser::SourceParser::ENCODING_BYTE_ORDER_MARKS = T.let(T.unsafe(nil), Hash) -# source://yard/lib/yard/parser/source_parser.rb#66 +# source://yard/lib/yard/parser/source_parser.rb#65 YARD::Parser::SourceParser::ENCODING_LINE = T.let(T.unsafe(nil), Regexp) -# source://yard/lib/yard/parser/source_parser.rb#67 +# source://yard/lib/yard/parser/source_parser.rb#66 YARD::Parser::SourceParser::FROZEN_STRING_LINE = T.let(T.unsafe(nil), Regexp) -# source://yard/lib/yard/parser/source_parser.rb#65 +# source://yard/lib/yard/parser/source_parser.rb#64 YARD::Parser::SourceParser::SHEBANG_LINE = T.let(T.unsafe(nil), Regexp) # Raised when an object is recognized but cannot be documented. This # generally occurs when the Ruby syntax used to declare an object is # too dynamic in nature. # -# source://yard/lib/yard/parser/source_parser.rb#10 +# source://yard/lib/yard/parser/source_parser.rb#9 class YARD::Parser::UndocumentableError < ::RuntimeError; end # The root path for YARD source libraries @@ -14813,42 +14969,42 @@ module YARD::Tags; end # @see tag:!method # @since 0.7.0 # -# source://yard/lib/yard/tags/directives.rb#461 +# source://yard/lib/yard/tags/directives.rb#460 class YARD::Tags::AttributeDirective < ::YARD::Tags::MethodDirective # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#462 + # source://yard/lib/yard/tags/directives.rb#461 def after_parse; end protected # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#470 + # source://yard/lib/yard/tags/directives.rb#469 def method_name; end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#476 + # source://yard/lib/yard/tags/directives.rb#475 def method_signature; end private # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#486 + # source://yard/lib/yard/tags/directives.rb#485 def create_attribute_data(object); end # @return [Boolean] # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#516 + # source://yard/lib/yard/tags/directives.rb#515 def readable?; end # @return [Boolean] # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#512 + # source://yard/lib/yard/tags/directives.rb#511 def writable?; end end @@ -14982,14 +15138,14 @@ end # @see Library.define_directive # @since 0.8.0 # -# source://yard/lib/yard/tags/directives.rb#23 +# source://yard/lib/yard/tags/directives.rb#22 class YARD::Tags::Directive # @param tag [Tag] the meta-data tag containing all input to the docstring # @param parser [DocstringParser] the docstring parser object # @return [Directive] a new instance of Directive # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#55 + # source://yard/lib/yard/tags/directives.rb#54 def initialize(tag, parser); end # Called after parsing all directives and tags in the docstring. Used @@ -14998,7 +15154,7 @@ class YARD::Tags::Directive # @return [void] # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#74 + # source://yard/lib/yard/tags/directives.rb#73 def after_parse; end # Called when processing the directive. Subclasses should implement @@ -15010,7 +15166,7 @@ class YARD::Tags::Directive # @return [void] # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#69 + # source://yard/lib/yard/tags/directives.rb#68 def call; end # Set this field to replace the directive definition inside of a docstring @@ -15022,7 +15178,7 @@ class YARD::Tags::Directive # @return [nil] if no expansion should take place for this directive # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#34 + # source://yard/lib/yard/tags/directives.rb#33 def expanded_text; end # Set this field to replace the directive definition inside of a docstring @@ -15034,7 +15190,7 @@ class YARD::Tags::Directive # @return [nil] if no expansion should take place for this directive # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#34 + # source://yard/lib/yard/tags/directives.rb#33 def expanded_text=(_arg0); end # @return [Handlers::Base, nil] the handler object the docstring parser @@ -15042,33 +15198,33 @@ class YARD::Tags::Directive # through {Parser::SourceParser}. # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#49 + # source://yard/lib/yard/tags/directives.rb#48 def handler; end # @return [CodeObjects::Base, nil] the object the parent docstring is # attached to. May be nil. # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#43 + # source://yard/lib/yard/tags/directives.rb#42 def object; end # @return [DocstringParser] the parser that is parsing all tag # information out of the docstring # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#38 + # source://yard/lib/yard/tags/directives.rb#37 def parser=(_arg0); end # @return [Tag] the meta-data tag containing data input to the directive # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#25 + # source://yard/lib/yard/tags/directives.rb#24 def tag; end # @return [Tag] the meta-data tag containing data input to the directive # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#25 + # source://yard/lib/yard/tags/directives.rb#24 def tag=(_arg0); end protected @@ -15076,14 +15232,14 @@ class YARD::Tags::Directive # @return [Boolean] # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#80 + # source://yard/lib/yard/tags/directives.rb#79 def inside_directive?; end # @return [DocstringParser] the parser that is parsing all tag # information out of the docstring # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#38 + # source://yard/lib/yard/tags/directives.rb#37 def parser; end end @@ -15107,11 +15263,11 @@ end # @see tag:!group # @since 0.6.0 # -# source://yard/lib/yard/tags/directives.rb#105 +# source://yard/lib/yard/tags/directives.rb#104 class YARD::Tags::EndGroupDirective < ::YARD::Tags::Directive # @since 0.6.0 # - # source://yard/lib/yard/tags/directives.rb#106 + # source://yard/lib/yard/tags/directives.rb#105 def call; end end @@ -15132,11 +15288,11 @@ end # @see tag:!endgroup # @since 0.6.0 # -# source://yard/lib/yard/tags/directives.rb#128 +# source://yard/lib/yard/tags/directives.rb#127 class YARD::Tags::GroupDirective < ::YARD::Tags::Directive # @since 0.6.0 # - # source://yard/lib/yard/tags/directives.rb#129 + # source://yard/lib/yard/tags/directives.rb#128 def call; end end @@ -15901,12 +16057,12 @@ end # end # @since 0.7.0 # -# source://yard/lib/yard/tags/directives.rb#258 +# source://yard/lib/yard/tags/directives.rb#257 class YARD::Tags::MacroDirective < ::YARD::Tags::Directive # @raise [TagFormatError] # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#259 + # source://yard/lib/yard/tags/directives.rb#258 def call; end private @@ -15914,40 +16070,40 @@ class YARD::Tags::MacroDirective < ::YARD::Tags::Directive # @return [Boolean] # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#288 + # source://yard/lib/yard/tags/directives.rb#287 def anonymous?; end # @return [Boolean] # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#277 + # source://yard/lib/yard/tags/directives.rb#276 def attach?; end # @return [Boolean] # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#283 + # source://yard/lib/yard/tags/directives.rb#282 def class_method?; end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#292 + # source://yard/lib/yard/tags/directives.rb#291 def expand(macro_data); end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#308 + # source://yard/lib/yard/tags/directives.rb#307 def find_or_create; end # @return [Boolean] # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#272 + # source://yard/lib/yard/tags/directives.rb#271 def new?; end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#332 + # source://yard/lib/yard/tags/directives.rb#331 def warn; end end @@ -15980,49 +16136,49 @@ end # @see tag:!attribute # @since 0.7.0 # -# source://yard/lib/yard/tags/directives.rb#368 +# source://yard/lib/yard/tags/directives.rb#367 class YARD::Tags::MethodDirective < ::YARD::Tags::Directive # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#373 + # source://yard/lib/yard/tags/directives.rb#372 def after_parse; end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#371 + # source://yard/lib/yard/tags/directives.rb#370 def call; end protected # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#413 + # source://yard/lib/yard/tags/directives.rb#412 def create_object; end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#381 + # source://yard/lib/yard/tags/directives.rb#380 def method_name; end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#390 + # source://yard/lib/yard/tags/directives.rb#389 def method_signature; end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#394 + # source://yard/lib/yard/tags/directives.rb#393 def sanitized_tag_signature; end # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#403 + # source://yard/lib/yard/tags/directives.rb#402 def use_indented_text; end end # @since 0.7.0 # -# source://yard/lib/yard/tags/directives.rb#369 +# source://yard/lib/yard/tags/directives.rb#368 YARD::Tags::MethodDirective::SCOPE_MATCH = T.let(T.unsafe(nil), Regexp) # source://yard/lib/yard/tags/option_tag.rb#4 @@ -16134,11 +16290,11 @@ end # # } # @since 0.8.0 # -# source://yard/lib/yard/tags/directives.rb#545 +# source://yard/lib/yard/tags/directives.rb#544 class YARD::Tags::ParseDirective < ::YARD::Tags::Directive # @since 0.8.0 # - # source://yard/lib/yard/tags/directives.rb#546 + # source://yard/lib/yard/tags/directives.rb#545 def call; end end @@ -16222,11 +16378,11 @@ end # def method2; end # @since 0.7.0 # -# source://yard/lib/yard/tags/directives.rb#579 +# source://yard/lib/yard/tags/directives.rb#578 class YARD::Tags::ScopeDirective < ::YARD::Tags::Directive # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#580 + # source://yard/lib/yard/tags/directives.rb#579 def call; end end @@ -16257,7 +16413,7 @@ class YARD::Tags::Tag # @param name [String] optional key name which the tag refers to # @return [Tag] a new instance of Tag # - # source://yard/lib/yard/tags/tag.rb#44 + # source://yard/lib/yard/tags/tag.rb#45 def initialize(tag_name, text, types = T.unsafe(nil), name = T.unsafe(nil)); end # Provides a plain English summary of the type specification, or nil @@ -16266,27 +16422,29 @@ class YARD::Tags::Tag # @return [String] a plain English description of the associated types # @return [nil] if no types are provided or not parsable # - # source://yard/lib/yard/tags/tag.rb#65 + # source://yard/lib/yard/tags/tag.rb#66 def explain_types; end # @return [String] a name associated with the tag + # @return [nil] if no tag name is supplied # - # source://yard/lib/yard/tags/tag.rb#26 + # source://yard/lib/yard/tags/tag.rb#27 def name; end # @return [String] a name associated with the tag + # @return [nil] if no tag name is supplied # - # source://yard/lib/yard/tags/tag.rb#26 + # source://yard/lib/yard/tags/tag.rb#27 def name=(_arg0); end # @return [CodeObjects::Base] the associated object # - # source://yard/lib/yard/tags/tag.rb#29 + # source://yard/lib/yard/tags/tag.rb#30 def object; end # @return [CodeObjects::Base] the associated object # - # source://yard/lib/yard/tags/tag.rb#29 + # source://yard/lib/yard/tags/tag.rb#30 def object=(_arg0); end # @return [String] the name of the tag @@ -16317,7 +16475,7 @@ class YARD::Tags::Tag # @return [String] the first of the list of specified types # @see #types # - # source://yard/lib/yard/tags/tag.rb#56 + # source://yard/lib/yard/tags/tag.rb#57 def type; end # @return [Array<String>] a list of types associated with the tag @@ -16508,11 +16666,11 @@ end # def method2; end # @since 0.7.0 # -# source://yard/lib/yard/tags/directives.rb#611 +# source://yard/lib/yard/tags/directives.rb#610 class YARD::Tags::VisibilityDirective < ::YARD::Tags::Directive # @since 0.7.0 # - # source://yard/lib/yard/tags/directives.rb#612 + # source://yard/lib/yard/tags/directives.rb#611 def call; end end @@ -16528,7 +16686,7 @@ module YARD::Templates; end # * To render a template, call {render}. # * To register a template path in the lookup paths, call {register_template_path}. # -# source://yard/lib/yard/templates/engine.rb#12 +# source://yard/lib/yard/templates/engine.rb#11 module YARD::Templates::Engine class << self # Passes a set of objects to the +:fulldoc+ template for full documentation generation. @@ -16540,7 +16698,7 @@ module YARD::Templates::Engine # @param options [Hash] (see {render}) # @return [void] # - # source://yard/lib/yard/templates/engine.rb#101 + # source://yard/lib/yard/templates/engine.rb#100 def generate(objects, options = T.unsafe(nil)); end # Registers a new template path in {template_paths} @@ -16548,7 +16706,7 @@ module YARD::Templates::Engine # @param path [String] a new template path # @return [void] # - # source://yard/lib/yard/templates/engine.rb#21 + # source://yard/lib/yard/templates/engine.rb#20 def register_template_path(path); end # Renders a template on a {CodeObjects::Base code object} using @@ -16569,7 +16727,7 @@ module YARD::Templates::Engine # @param options [Hash] the options hash # @return [String] the rendered template # - # source://yard/lib/yard/templates/engine.rb#82 + # source://yard/lib/yard/templates/engine.rb#81 def render(options = T.unsafe(nil)); end # Creates a template module representing the path. Searches on disk @@ -16583,7 +16741,7 @@ module YARD::Templates::Engine # {template_paths} on disk. # @return [Template] the module representing the template # - # source://yard/lib/yard/templates/engine.rb#35 + # source://yard/lib/yard/templates/engine.rb#34 def template(*path); end # Forces creation of a template at +path+ within a +full_path+. @@ -16592,17 +16750,17 @@ module YARD::Templates::Engine # @param full_paths [Array<String>] the full path on disk of the template # @return [Template] the template module representing the +path+ # - # source://yard/lib/yard/templates/engine.rb#53 + # source://yard/lib/yard/templates/engine.rb#52 def template!(path, full_paths = T.unsafe(nil)); end # @return [Array<String>] the list of registered template paths # - # source://yard/lib/yard/templates/engine.rb#15 + # source://yard/lib/yard/templates/engine.rb#14 def template_paths; end # @return [Array<String>] the list of registered template paths # - # source://yard/lib/yard/templates/engine.rb#15 + # source://yard/lib/yard/templates/engine.rb#14 def template_paths=(_arg0); end # Serializes the results of a block with a +serializer+ object. @@ -16613,7 +16771,7 @@ module YARD::Templates::Engine # @yield a block whose result will be serialize # @yieldreturn [String] the contents to serialize # - # source://yard/lib/yard/templates/engine.rb#115 + # source://yard/lib/yard/templates/engine.rb#114 def with_serializer(object, serializer); end private @@ -16628,7 +16786,7 @@ module YARD::Templates::Engine # @return [Array<String>] a list of full paths that are existing # candidates for a template module # - # source://yard/lib/yard/templates/engine.rb#161 + # source://yard/lib/yard/templates/engine.rb#160 def find_template_paths(from_template, path); end # Sets default options on the options hash @@ -16639,7 +16797,7 @@ module YARD::Templates::Engine # @param options [Hash] the options hash # @return [void] # - # source://yard/lib/yard/templates/engine.rb#141 + # source://yard/lib/yard/templates/engine.rb#140 def set_default_options(options = T.unsafe(nil)); end # The name of the module that represents a +path+ @@ -16647,7 +16805,7 @@ module YARD::Templates::Engine # @param path [String] the path to generate a module name for # @return [String] the module name # - # source://yard/lib/yard/templates/engine.rb#176 + # source://yard/lib/yard/templates/engine.rb#175 def template_module_name(path); end end end @@ -18058,7 +18216,7 @@ end # # @see CLI::YardocOptions # -# source://yard/lib/yard/templates/template_options.rb#10 +# source://yard/lib/yard/templates/template_options.rb#9 class YARD::Templates::TemplateOptions < ::YARD::Options # @return [OpenStruct] an open struct containing any global state across all # generated objects in a template. @@ -18101,7 +18259,7 @@ class YARD::Templates::TemplateOptions < ::YARD::Options # @return [Boolean] whether a mixin matches the embed_mixins list # @return [nil] if the mixin is not a module object # - # source://yard/lib/yard/templates/template_options.rb#78 + # source://yard/lib/yard/templates/template_options.rb#77 def embed_mixins_match?(mixin); end # @return [Symbol] the template output format @@ -18148,12 +18306,12 @@ class YARD::Templates::TemplateOptions < ::YARD::Options # @return [Boolean] whether the page is the "index" # - # source://yard/lib/yard/templates/template_options.rb#64 + # source://yard/lib/yard/templates/template_options.rb#63 def index; end # @return [Boolean] whether the page is the "index" # - # source://yard/lib/yard/templates/template_options.rb#64 + # source://yard/lib/yard/templates/template_options.rb#63 def index=(_arg0); end # @return [Symbol] the markup format to use when parsing docstrings @@ -18168,51 +18326,51 @@ class YARD::Templates::TemplateOptions < ::YARD::Options # @return [Class] the markup provider class for the markup format # - # source://yard/lib/yard/templates/template_options.rb#30 + # source://yard/lib/yard/templates/template_options.rb#29 def markup_provider; end # @return [Class] the markup provider class for the markup format # - # source://yard/lib/yard/templates/template_options.rb#30 + # source://yard/lib/yard/templates/template_options.rb#29 def markup_provider=(_arg0); end # @deprecated use {#highlight} instead. # @return [Boolean] whether highlighting should be ignored # - # source://yard/lib/yard/templates/template_options.rb#57 + # source://yard/lib/yard/templates/template_options.rb#56 def no_highlight; end - # source://yard/lib/yard/templates/template_options.rb#58 + # source://yard/lib/yard/templates/template_options.rb#57 def no_highlight=(value); end # @return [CodeObjects::Base] the main object being generated in the template # - # source://yard/lib/yard/templates/template_options.rb#38 + # source://yard/lib/yard/templates/template_options.rb#37 def object; end # @return [CodeObjects::Base] the main object being generated in the template # - # source://yard/lib/yard/templates/template_options.rb#38 + # source://yard/lib/yard/templates/template_options.rb#37 def object=(_arg0); end # @return [CodeObjects::Base] the owner of the generated object # - # source://yard/lib/yard/templates/template_options.rb#41 + # source://yard/lib/yard/templates/template_options.rb#40 def owner; end # @return [CodeObjects::Base] the owner of the generated object # - # source://yard/lib/yard/templates/template_options.rb#41 + # source://yard/lib/yard/templates/template_options.rb#40 def owner=(_arg0); end # @return [String] the title of a given page # - # source://yard/lib/yard/templates/template_options.rb#61 + # source://yard/lib/yard/templates/template_options.rb#60 def page_title; end # @return [String] the title of a given page # - # source://yard/lib/yard/templates/template_options.rb#61 + # source://yard/lib/yard/templates/template_options.rb#60 def page_title=(_arg0); end # @return [Boolean] whether serialization should be performed @@ -18228,13 +18386,13 @@ class YARD::Templates::TemplateOptions < ::YARD::Options # @return [Serializers::Base] the serializer used to generate links and serialize # output. Serialization output only occurs if {#serialize} is +true+. # - # source://yard/lib/yard/templates/template_options.rb#51 + # source://yard/lib/yard/templates/template_options.rb#50 def serializer; end # @return [Serializers::Base] the serializer used to generate links and serialize # output. Serialization output only occurs if {#serialize} is +true+. # - # source://yard/lib/yard/templates/template_options.rb#51 + # source://yard/lib/yard/templates/template_options.rb#50 def serializer=(_arg0); end # @return [Symbol] the template name used to render output @@ -18249,22 +18407,22 @@ class YARD::Templates::TemplateOptions < ::YARD::Options # @return [Symbol] the template type used to generate output # - # source://yard/lib/yard/templates/template_options.rb#44 + # source://yard/lib/yard/templates/template_options.rb#43 def type; end # @return [Symbol] the template type used to generate output # - # source://yard/lib/yard/templates/template_options.rb#44 + # source://yard/lib/yard/templates/template_options.rb#43 def type=(_arg0); end # @return [Verifier] the verifier object # - # source://yard/lib/yard/templates/template_options.rb#89 + # source://yard/lib/yard/templates/template_options.rb#88 def verifier; end # @return [Verifier] the verifier object # - # source://yard/lib/yard/templates/template_options.rb#89 + # source://yard/lib/yard/templates/template_options.rb#88 def verifier=(_arg0); end end diff --git a/sorbet/rbi/gems/zeitwerk@2.6.18.rbi b/sorbet/rbi/gems/zeitwerk@2.7.1.rbi similarity index 88% rename from sorbet/rbi/gems/zeitwerk@2.6.18.rbi rename to sorbet/rbi/gems/zeitwerk@2.7.1.rbi index f014e713..c8ce767f 100644 --- a/sorbet/rbi/gems/zeitwerk@2.6.18.rbi +++ b/sorbet/rbi/gems/zeitwerk@2.7.1.rbi @@ -5,29 +5,39 @@ # Please instead update this file by running `bin/tapioca gem zeitwerk`. -# source://zeitwerk/lib/zeitwerk/kernel.rb#3 +# source://zeitwerk/lib/zeitwerk/core_ext/kernel.rb#3 module Kernel private - # source://zeitwerk/lib/zeitwerk/kernel.rb#23 + # source://zeitwerk/lib/zeitwerk/core_ext/kernel.rb#23 def require(path); end class << self - # source://zeitwerk/lib/zeitwerk/kernel.rb#23 + # source://zeitwerk/lib/zeitwerk/core_ext/kernel.rb#23 def require(path); end end end +class Module + include ::Zeitwerk::ConstAdded +end + # source://zeitwerk/lib/zeitwerk.rb#3 module Zeitwerk class << self # This is a dangerous method. # - # source://zeitwerk/lib/zeitwerk.rb#22 + # source://zeitwerk/lib/zeitwerk.rb#24 def with_loader; end end end +# source://zeitwerk/lib/zeitwerk/core_ext/module.rb#3 +module Zeitwerk::ConstAdded + # source://zeitwerk/lib/zeitwerk/core_ext/module.rb#4 + def const_added(cname); end +end + # This private class encapsulates pairs (mod, cname). # # Objects represent the constant cname in the class or module object mod, and @@ -48,100 +58,103 @@ class Zeitwerk::Cref # # @return [Cref] a new instance of Cref # - # source://zeitwerk/lib/zeitwerk/cref.rb#23 + # source://zeitwerk/lib/zeitwerk/cref.rb#26 def initialize(mod, cname); end - # source://zeitwerk/lib/zeitwerk/cref.rb#74 + # source://zeitwerk/lib/zeitwerk/cref.rb#43 def autoload(abspath); end # @return [Boolean] # - # source://zeitwerk/lib/zeitwerk/cref.rb#68 + # source://zeitwerk/lib/zeitwerk/cref.rb#38 def autoload?; end # Returns the value of attribute cname. # - # source://zeitwerk/lib/zeitwerk/cref.rb#17 + # source://zeitwerk/lib/zeitwerk/cref.rb#20 def cname; end # @return [Boolean] # - # source://zeitwerk/lib/zeitwerk/cref.rb#79 + # source://zeitwerk/lib/zeitwerk/cref.rb#48 def defined?; end # @raise [NameError] # - # source://zeitwerk/lib/zeitwerk/cref.rb#90 + # source://zeitwerk/lib/zeitwerk/cref.rb#59 def get; end - # source://zeitwerk/lib/zeitwerk/cref.rb#34 + # Returns the value of attribute mod. + # + # source://zeitwerk/lib/zeitwerk/cref.rb#17 + def mod; end + + # source://zeitwerk/lib/zeitwerk/cref.rb#33 def path; end # @raise [NameError] # - # source://zeitwerk/lib/zeitwerk/cref.rb#96 + # source://zeitwerk/lib/zeitwerk/cref.rb#65 def remove; end - # source://zeitwerk/lib/zeitwerk/cref.rb#84 + # source://zeitwerk/lib/zeitwerk/cref.rb#53 def set(value); end end # source://zeitwerk/lib/zeitwerk/error.rb#4 class Zeitwerk::Error < ::StandardError; end -# Centralizes the logic for the trace point used to detect the creation of -# explicit namespaces, needed to descend into matching subdirectories right -# after the constant has been defined. +# This module is essentially a registry for explicit namespaces. +# +# When a loader determines that a certain file should define an explicit +# namespace, it registers it here, associating its cref with itself. +# +# If the namespace is autoloaded, our const_added callback retrieves its +# loader by calling loader_for. That way, the loader is able to scan the +# subdirectories that conform the namespace and set autoloads for their +# expected constants just in time. +# +# Once autoloaded, the namespace is unregistered. # # The implementation assumes an explicit namespace is managed by one loader. # Loaders that reopen namespaces owned by other projects are responsible for # loading their constant before setup. This is documented. # -# source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#11 +# source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#19 module Zeitwerk::ExplicitNamespace extend ::Zeitwerk::RealModName class << self - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#35 - def __register(cpath, loader); end + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#80 + def __clear; end - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#53 - def __registered?(cpath); end + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#57 + def __loader_for(mod, cname); end - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#45 - def __unregister_loader(loader); end + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#48 + def __register(cref, loader); end - private + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#73 + def __registered?(cname_or_cpath); end - # Maps constant paths that correspond to explicit namespaces according to - # the file system, to the loader responsible for them. - # - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#20 - def cpaths; end - - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#58 - def disable_tracer_if_unneeded; end + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#66 + def __unregister_loader(loader); end - # Returns the value of attribute mutex. - # - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#24 - def mutex; end + private - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#35 - def register(cpath, loader); end + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#80 + def clear; end - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#53 - def registered?(cpath); end + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#57 + def loader_for(mod, cname); end - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#65 - def tracepoint_class_callback(event); end + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#48 + def register(cref, loader); end - # Returns the value of attribute tracer. - # - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#28 - def tracer; end + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#73 + def registered?(cname_or_cpath); end - # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#45 + # source://zeitwerk/lib/zeitwerk/explicit_namespace.rb#66 def unregister_loader(loader); end end end @@ -332,7 +345,7 @@ class Zeitwerk::Loader # @return [Boolean] # - # source://zeitwerk/lib/zeitwerk/loader.rb#544 + # source://zeitwerk/lib/zeitwerk/loader.rb#546 def autoload_path_set_by_me_for?(cref); end # source://zeitwerk/lib/zeitwerk/loader.rb#462 @@ -357,7 +370,7 @@ class Zeitwerk::Loader # source://zeitwerk/lib/zeitwerk/loader.rb#32 def autoloads; end - # source://zeitwerk/lib/zeitwerk/loader.rb#523 + # source://zeitwerk/lib/zeitwerk/loader.rb#525 def define_autoload(cref, abspath); end # source://zeitwerk/lib/zeitwerk/loader.rb#444 @@ -396,13 +409,13 @@ class Zeitwerk::Loader # source://zeitwerk/lib/zeitwerk/loader.rb#512 def promote_namespace_from_implicit_to_explicit(dir:, file:, cref:); end - # source://zeitwerk/lib/zeitwerk/loader.rb#558 + # source://zeitwerk/lib/zeitwerk/loader.rb#560 def raise_if_conflicting_directory(dir); end - # source://zeitwerk/lib/zeitwerk/loader.rb#553 - def register_explicit_namespace(cpath); end + # source://zeitwerk/lib/zeitwerk/loader.rb#555 + def register_explicit_namespace(cref); end - # source://zeitwerk/lib/zeitwerk/loader.rb#582 + # source://zeitwerk/lib/zeitwerk/loader.rb#584 def run_on_unload_callbacks(cpath, value, abspath); end # source://zeitwerk/lib/zeitwerk/loader.rb#344 @@ -435,10 +448,10 @@ class Zeitwerk::Loader # source://zeitwerk/lib/zeitwerk/loader.rb#60 def to_unload; end - # source://zeitwerk/lib/zeitwerk/loader.rb#589 + # source://zeitwerk/lib/zeitwerk/loader.rb#591 def unload_autoload(cref); end - # source://zeitwerk/lib/zeitwerk/loader.rb#595 + # source://zeitwerk/lib/zeitwerk/loader.rb#597 def unload_cref(cref); end class << self @@ -515,30 +528,30 @@ module Zeitwerk::Loader::Callbacks include ::Zeitwerk::RealModName extend ::Zeitwerk::Internal - # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#40 + # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#41 def __on_dir_autoloaded(dir); end - # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#10 + # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#11 def __on_file_autoloaded(file); end # Invoked when a class or module is created or reopened, either from the - # tracer or from module autovivification. If the namespace has matching + # const_added or from module autovivification. If the namespace has matching # subdirectories, we descend into them now. # # @private # - # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#80 + # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#81 def on_namespace_loaded(namespace); end private - # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#40 + # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#41 def on_dir_autoloaded(dir); end - # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#10 + # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#11 def on_file_autoloaded(file); end - # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#91 + # source://zeitwerk/lib/zeitwerk/loader/callbacks.rb#92 def run_on_load_callbacks(cpath, value, abspath); end end @@ -847,12 +860,12 @@ module Zeitwerk::Loader::Helpers # @raise [Zeitwerk::NameError] # - # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#110 + # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#108 def cname_for(basename, abspath); end # @return [Boolean] # - # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#85 + # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#83 def dir?(path); end # Looks for a Ruby file using breadth-first search. This type of search is @@ -866,7 +879,7 @@ module Zeitwerk::Loader::Helpers # @return [Boolean] # - # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#90 + # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#88 def hidden?(basename); end # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#7 @@ -877,16 +890,16 @@ module Zeitwerk::Loader::Helpers # @return [Boolean] # - # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#80 + # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#78 def ruby?(path); end - # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#95 + # source://zeitwerk/lib/zeitwerk/loader/helpers.rb#93 def walk_up(abspath); end end # --- Inflection -------------------------------------------------------------------------------- # -# source://zeitwerk/lib/zeitwerk/loader/helpers.rb#105 +# source://zeitwerk/lib/zeitwerk/loader/helpers.rb#103 module Zeitwerk::Loader::Helpers::CNAME_VALIDATOR; end # source://zeitwerk/lib/zeitwerk/loader.rb#21 @@ -903,7 +916,12 @@ end # source://zeitwerk/lib/zeitwerk/real_mod_name.rb#3 module Zeitwerk::RealModName - # source://zeitwerk/lib/zeitwerk/real_mod_name.rb#14 + # Returns the real name of the class or module, as set after the first + # constant to which it was assigned (or nil). + # + # The name method can be overridden, hence the indirection in this method. + # + # source://zeitwerk/lib/zeitwerk/real_mod_name.rb#13 def real_mod_name(mod); end end diff --git a/sorbet/tapioca/require.rb b/sorbet/tapioca/require.rb index a7af5a4e..8ea2f470 100644 --- a/sorbet/tapioca/require.rb +++ b/sorbet/tapioca/require.rb @@ -9,4 +9,3 @@ require "minitest/unit" require "mocha/minitest" require "spoom/backtrace_filter/minitest" -require "webmock/minitest" diff --git a/test/test_helper.rb b/test/test_helper.rb index 35fd2196..62b061e5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,7 +13,6 @@ require "ruby_lsp/internal" require "ruby_lsp/test_helper" require "ruby_lsp/ruby_lsp_rails/addon" -require "webmock/minitest" if defined?(DEBUGGER__) DEBUGGER__::CONFIG[:skip_path] =