From 592eb252e563d507f0736eb250f2ee42d11aa4bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 18:04:32 +0000 Subject: [PATCH 1/5] build(deps-dev): bump rubocop from 1.69.2 to 1.70.0 in /Library/Homebrew Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.69.2 to 1.70.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.69.2...v1.70.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Library/Homebrew/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 47b65f60eb6ff..4d83c701238fc 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -74,7 +74,7 @@ GEM rspec-support (3.13.2) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.69.2) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) From dbb731bce297d67ff6159e2b217e8c18e799fdf4 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Fri, 10 Jan 2025 11:00:16 -0800 Subject: [PATCH 2/5] brew style --fix --- Library/Homebrew/cmd/list.rb | 2 +- Library/Homebrew/extend/os/linux/extend/ENV/super.rb | 2 +- Library/Homebrew/tab.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 052017bc437ee..9f863d180f6f0 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -252,7 +252,7 @@ def initialize(path) when "lib" print_dir pn do |pnn| # dylibs have multiple symlinks and we don't care about them - (pnn.extname == ".dylib" || pnn.extname == ".pc") && !pnn.symlink? + [".dylib", ".pc"].include?(pnn.extname) && !pnn.symlink? end when ".brew" next # Ignore .brew diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb index f0aa87920edad..0d2676055d9f0 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb @@ -29,7 +29,7 @@ def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_a self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2" self["HOMEBREW_DYNAMIC_LINKER"] = determine_dynamic_linker_path self["HOMEBREW_RPATH_PATHS"] = determine_rpath_paths(@formula) - self["M4"] = "#{HOMEBREW_PREFIX}/opt/m4/bin/m4" if deps.any? { |d| d.name == "libtool" || d.name == "bison" } + self["M4"] = "#{HOMEBREW_PREFIX}/opt/m4/bin/m4" if deps.any? { |d| ["libtool", "bison"].include?(d.name) } end def homebrew_extra_paths diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index ac04c6880aae0..9ed84fd139379 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -176,7 +176,7 @@ def self.from_file_content(content, path) tab.source ||= {} tab.tap = tab.tapped_from if !tab.tapped_from.nil? && tab.tapped_from != "path or URL" - tab.tap = "homebrew/core" if tab.tap == "mxcl/master" || tab.tap == "Homebrew/homebrew" + tab.tap = "homebrew/core" if ["mxcl/master", "Homebrew/homebrew"].include?(tab.tap) if tab.source["spec"].nil? version = PkgVersion.parse(File.basename(File.dirname(path))) From 0add431e69e4c5f36a3607f8f00947e8af88f2ea Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Fri, 10 Jan 2025 11:06:11 -0800 Subject: [PATCH 3/5] Apply manual violation fixes --- Library/Homebrew/cmd/list.rb | 3 ++- Library/Homebrew/extend/os/linux/extend/ENV/super.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 9f863d180f6f0..538baed2c1b6d 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -245,6 +245,7 @@ def list_casks class PrettyListing sig { params(path: T.any(String, Pathname, Keg)).void } def initialize(path) + valid_lib_extensions = [".dylib", ".pc"] Pathname.new(path).children.sort_by { |p| p.to_s.downcase }.each do |pn| case pn.basename.to_s when "bin", "sbin" @@ -252,7 +253,7 @@ def initialize(path) when "lib" print_dir pn do |pnn| # dylibs have multiple symlinks and we don't care about them - [".dylib", ".pc"].include?(pnn.extname) && !pnn.symlink? + valid_lib_extensions.include?(pnn.extname) && !pnn.symlink? end when ".brew" next # Ignore .brew diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb index 0d2676055d9f0..29ff41009414c 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb @@ -29,7 +29,8 @@ def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_a self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2" self["HOMEBREW_DYNAMIC_LINKER"] = determine_dynamic_linker_path self["HOMEBREW_RPATH_PATHS"] = determine_rpath_paths(@formula) - self["M4"] = "#{HOMEBREW_PREFIX}/opt/m4/bin/m4" if deps.any? { |d| ["libtool", "bison"].include?(d.name) } + m4_path_deps = ["libtool", "bison"] + self["M4"] = "#{HOMEBREW_PREFIX}/opt/m4/bin/m4" if deps.any? { m4_path_deps.include?(_1.name) } end def homebrew_extra_paths From a1e714cf5d51bda063761d3df55a3e5a0fd0813c Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Sun, 12 Jan 2025 18:07:47 +0000 Subject: [PATCH 4/5] brew vendor-gems: commit updates. --- Library/Homebrew/vendor/bundle/bundler/setup.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 21442013ae606..1446674c63cab 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -91,7 +91,7 @@ def self.extension_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-progressbar-1.13.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-emoji-4.0.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-display_width-3.1.3/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.69.2/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.70.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-md-1.2.4/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.23.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-3.3.0/lib") From ffc661b173f0ab88593aae43ec85bdfedf1b39c5 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Sun, 12 Jan 2025 18:08:09 +0000 Subject: [PATCH 5/5] Update RBI files for rubocop. Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow. --- ...{rubocop@1.69.2.rbi => rubocop@1.70.0.rbi} | 2041 ++++++++++------- 1 file changed, 1241 insertions(+), 800 deletions(-) rename Library/Homebrew/sorbet/rbi/gems/{rubocop@1.69.2.rbi => rubocop@1.70.0.rbi} (97%) diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.69.2.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.70.0.rbi similarity index 97% rename from Library/Homebrew/sorbet/rbi/gems/rubocop@1.69.2.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop@1.70.0.rbi index 4296fe0b8e05e..c734fd5ea2ef1 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.69.2.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.70.0.rbi @@ -780,7 +780,7 @@ class RuboCop::CommentConfig # source://rubocop//lib/rubocop/comment_config.rb#63 def comment_only_line?(line_number); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def config(*_arg0, **_arg1, &_arg2); end # source://rubocop//lib/rubocop/comment_config.rb#51 @@ -804,7 +804,7 @@ class RuboCop::CommentConfig # source://rubocop//lib/rubocop/comment_config.rb#30 def processed_source; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def registry(*_arg0, **_arg1, &_arg2); end private @@ -977,26 +977,26 @@ class RuboCop::Config # @return [Config] a new instance of Config # - # source://rubocop//lib/rubocop/config.rb#30 + # source://rubocop//lib/rubocop/config.rb#31 def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def [](*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def []=(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#170 + # source://rubocop//lib/rubocop/config.rb#179 def active_support_extensions_enabled?; end - # source://rubocop//lib/rubocop/config.rb#96 + # source://rubocop//lib/rubocop/config.rb#94 def add_excludes_from_higher_level(highest_config); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#197 + # source://rubocop//lib/rubocop/config.rb#206 def allowed_camel_case_file?(file); end # Paths specified in configuration files starting with .rubocop are @@ -1005,69 +1005,74 @@ 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#241 + # source://rubocop//lib/rubocop/config.rb#250 def base_dir_for_path_parameters; end # @return [String, nil] # - # source://rubocop//lib/rubocop/config.rb#271 + # source://rubocop//lib/rubocop/config.rb#280 def bundler_lock_file_path; end - # source://rubocop//lib/rubocop/config.rb#51 + # source://rubocop//lib/rubocop/config.rb#52 def check; end # @api private # @return [Boolean] whether config for this badge has 'Include' or 'Exclude' keys # - # source://rubocop//lib/rubocop/config.rb#142 + # source://rubocop//lib/rubocop/config.rb#147 def clusivity_config_for_badge?(badge); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config.rb#167 + def cop_enabled?(name); end + + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def delete(*_arg0, **_arg1, &_arg2); end - # source://rubocop//lib/rubocop/config.rb#108 + # source://rubocop//lib/rubocop/config.rb#106 def deprecation_check; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def dig(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#162 + # source://rubocop//lib/rubocop/config.rb#171 def disabled_new_cops?; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def each(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def each_key(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#166 + # source://rubocop//lib/rubocop/config.rb#175 def enabled_new_cops?; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def fetch(*_arg0, **_arg1, &_arg2); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#219 + # source://rubocop//lib/rubocop/config.rb#228 def file_to_exclude?(file); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#178 + # source://rubocop//lib/rubocop/config.rb#187 def file_to_include?(file); end - # source://rubocop//lib/rubocop/config.rb#158 + # source://rubocop//lib/rubocop/config.rb#163 def for_all_cops; end # Note: the 'Enabled' attribute is same as that returned by `for_cop` # # @return [Config] for the given cop merged with that of its department (if any) # - # source://rubocop//lib/rubocop/config.rb#128 + # source://rubocop//lib/rubocop/config.rb#133 def for_badge(badge); end # Note: the 'Enabled' attribute is calculated according to the department's @@ -1075,7 +1080,7 @@ class RuboCop::Config # # @return [Config] for the given cop / cop name. # - # source://rubocop//lib/rubocop/config.rb#122 + # source://rubocop//lib/rubocop/config.rb#120 def for_cop(cop); end # Note: the 'Enabled' attribute will be present only if specified @@ -1083,60 +1088,68 @@ class RuboCop::Config # # @return [Config] for the given department name. # - # source://rubocop//lib/rubocop/config.rb#153 + # source://rubocop//lib/rubocop/config.rb#158 def for_department(department_name); end + # If the given cop is enabled, returns its configuration hash. + # Otherwise, returns an empty hash. + # + # @return [Config, Hash] for the given cop / cop name. + # + # source://rubocop//lib/rubocop/config.rb#127 + def for_enabled_cop(cop); end + # Returns target's locked gem versions (i.e. from Gemfile.lock or gems.locked) # - # source://rubocop//lib/rubocop/config.rb#296 + # source://rubocop//lib/rubocop/config.rb#305 def gem_versions_in_target; end - # source://rubocop//lib/rubocop/config.rb#300 + # source://rubocop//lib/rubocop/config.rb#309 def inspect; end # True if this is a config file that is shipped with RuboCop # # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#76 + # source://rubocop//lib/rubocop/config.rb#77 def internal?; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def key?(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def keys(*_arg0, **_arg1, &_arg2); end - # source://rubocop//lib/rubocop/config.rb#47 + # source://rubocop//lib/rubocop/config.rb#48 def loaded_features; end # Returns the value of attribute loaded_path. # - # source://rubocop//lib/rubocop/config.rb#20 + # source://rubocop//lib/rubocop/config.rb#21 def loaded_path; end - # source://rubocop//lib/rubocop/config.rb#81 + # source://rubocop//lib/rubocop/config.rb#82 def make_excludes_absolute; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def map(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def merge(*_arg0, **_arg1, &_arg2); end - # source://rubocop//lib/rubocop/config.rb#251 + # source://rubocop//lib/rubocop/config.rb#260 def parser_engine; end - # source://rubocop//lib/rubocop/config.rb#232 + # source://rubocop//lib/rubocop/config.rb#241 def path_relative_to_config(path); end - # source://rubocop//lib/rubocop/config.rb#228 + # source://rubocop//lib/rubocop/config.rb#237 def patterns_to_exclude; end - # source://rubocop//lib/rubocop/config.rb#224 + # source://rubocop//lib/rubocop/config.rb#233 def patterns_to_include; end - # source://rubocop//lib/rubocop/config.rb#282 + # source://rubocop//lib/rubocop/config.rb#291 def pending_cops; end # Returns true if there's a chance that an Include pattern matches hidden @@ -1144,78 +1157,78 @@ class RuboCop::Config # # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#211 + # source://rubocop//lib/rubocop/config.rb#220 def possibly_include_hidden?; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def replace(*_arg0, **_arg1, &_arg2); end - # source://rubocop//lib/rubocop/config.rb#71 + # source://rubocop//lib/rubocop/config.rb#72 def signature; end - # source://rubocop//lib/rubocop/config.rb#266 + # source://rubocop//lib/rubocop/config.rb#275 def smart_loaded_path; end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#174 + # source://rubocop//lib/rubocop/config.rb#183 def string_literals_frozen_by_default?; end - # source://rubocop//lib/rubocop/config.rb#255 + # source://rubocop//lib/rubocop/config.rb#264 def target_rails_version; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def target_ruby_version(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def to_h(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def to_hash(*_arg0, **_arg1, &_arg2); end - # source://rubocop//lib/rubocop/config.rb#67 + # source://rubocop//lib/rubocop/config.rb#68 def to_s; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def transform_values(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def validate(*_arg0, **_arg1, &_arg2); end - # source://rubocop//lib/rubocop/config.rb#58 + # source://rubocop//lib/rubocop/config.rb#59 def validate_after_resolution; end private - # source://rubocop//lib/rubocop/config.rb#350 + # source://rubocop//lib/rubocop/config.rb#359 def department_of(qualified_cop_name); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config.rb#338 + # source://rubocop//lib/rubocop/config.rb#347 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#325 + # source://rubocop//lib/rubocop/config.rb#334 def gem_version_to_major_minor_float(gem_version); end - # source://rubocop//lib/rubocop/config.rb#331 + # source://rubocop//lib/rubocop/config.rb#340 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#312 + # source://rubocop//lib/rubocop/config.rb#321 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#307 + # source://rubocop//lib/rubocop/config.rb#316 def target_rails_version_from_bundler_lock_file; end class << self - # source://rubocop//lib/rubocop/config.rb#22 + # source://rubocop//lib/rubocop/config.rb#23 def create(hash, path, check: T.unsafe(nil)); end end end @@ -1253,9 +1266,12 @@ class RuboCop::Config::CopConfig < ::Struct end end -# source://rubocop//lib/rubocop/config.rb#19 +# source://rubocop//lib/rubocop/config.rb#20 RuboCop::Config::DEFAULT_RAILS_VERSION = T.let(T.unsafe(nil), Float) +# source://rubocop//lib/rubocop/config.rb#19 +RuboCop::Config::EMPTY_CONFIG = T.let(T.unsafe(nil), Hash) + # This class has methods related to finding configuration path. # # @api private @@ -1348,7 +1364,7 @@ class RuboCop::ConfigLoader extend ::RuboCop::FileFinder class << self - # source://rubocop//lib/rubocop/config_loader.rb#137 + # source://rubocop//lib/rubocop/config_loader.rb#141 def add_excludes_from_files(config, config_file); end # Used to add features that were required inside a config or from @@ -1356,10 +1372,10 @@ class RuboCop::ConfigLoader # # @api private # - # source://rubocop//lib/rubocop/config_loader.rb#198 + # source://rubocop//lib/rubocop/config_loader.rb#202 def add_loaded_features(loaded_features); end - # source://rubocop//lib/rubocop/config_loader.rb#80 + # source://rubocop//lib/rubocop/config_loader.rb#84 def add_missing_namespaces(path, hash); end # source://rubocop//lib/rubocop/config_loader.rb#41 @@ -1371,10 +1387,10 @@ class RuboCop::ConfigLoader # user's home directory is checked. If there's no .rubocop.yml # there either, the path to the default file is returned. # - # source://rubocop//lib/rubocop/config_loader.rb#104 + # source://rubocop//lib/rubocop/config_loader.rb#108 def configuration_file_for(target_dir); end - # source://rubocop//lib/rubocop/config_loader.rb#108 + # source://rubocop//lib/rubocop/config_loader.rb#112 def configuration_from_file(config_file, check: T.unsafe(nil)); end # Returns the value of attribute debug. @@ -1394,7 +1410,7 @@ class RuboCop::ConfigLoader # source://rubocop//lib/rubocop/config_loader.rb#33 def debug?; end - # source://rubocop//lib/rubocop/config_loader.rb#147 + # source://rubocop//lib/rubocop/config_loader.rb#151 def default_configuration; end # Sets the attribute default_configuration @@ -1459,15 +1475,15 @@ class RuboCop::ConfigLoader # @api private # - # source://rubocop//lib/rubocop/config_loader.rb#155 + # source://rubocop//lib/rubocop/config_loader.rb#159 def inject_defaults!(project_root); end - # source://rubocop//lib/rubocop/config_loader.rb#47 + # source://rubocop//lib/rubocop/config_loader.rb#51 def load_file(file, check: T.unsafe(nil)); end # @raise [TypeError] # - # source://rubocop//lib/rubocop/config_loader.rb#67 + # source://rubocop//lib/rubocop/config_loader.rb#71 def load_yaml_configuration(absolute_path); end # Returns the value of attribute loaded_features. @@ -1479,20 +1495,20 @@ class RuboCop::ConfigLoader # with the addition that any value that is a hash, and occurs in both # arguments, will also be merged. And so on. # - # source://rubocop//lib/rubocop/config_loader.rb#95 + # source://rubocop//lib/rubocop/config_loader.rb#99 def merge(base_hash, derived_hash); end # Merges the given configuration with the default one. # - # source://rubocop//lib/rubocop/config_loader.rb#191 + # source://rubocop//lib/rubocop/config_loader.rb#195 def merge_with_default(config, config_file, unset_nil: T.unsafe(nil)); end - # source://rubocop//lib/rubocop/config_loader.rb#128 + # source://rubocop//lib/rubocop/config_loader.rb#132 def pending_cops_only_qualified(pending_cops); end # @return [Boolean] # - # source://rubocop//lib/rubocop/config_loader.rb#132 + # source://rubocop//lib/rubocop/config_loader.rb#136 def possible_new_cops?(config); end # Returns the path RuboCop inferred as the root of the project. No file @@ -1500,37 +1516,37 @@ class RuboCop::ConfigLoader # # @deprecated Use `RuboCop::ConfigFinder.project_root` instead. # - # source://rubocop//lib/rubocop/config_loader.rb#166 + # source://rubocop//lib/rubocop/config_loader.rb#170 def project_root; end - # source://rubocop//lib/rubocop/config_loader.rb#175 + # source://rubocop//lib/rubocop/config_loader.rb#179 def warn_on_pending_cops(pending_cops); end - # source://rubocop//lib/rubocop/config_loader.rb#183 + # source://rubocop//lib/rubocop/config_loader.rb#187 def warn_pending_cop(cop); end private - # source://rubocop//lib/rubocop/config_loader.rb#212 + # source://rubocop//lib/rubocop/config_loader.rb#216 def check_duplication(yaml_code, absolute_path); end - # source://rubocop//lib/rubocop/config_loader.rb#204 + # source://rubocop//lib/rubocop/config_loader.rb#208 def file_path(file); end # Read the specified file, or exit with a friendly, concise message on # stderr. Care is taken to use the standard OS exit code for a "file not # found" error. # - # source://rubocop//lib/rubocop/config_loader.rb#232 + # source://rubocop//lib/rubocop/config_loader.rb#236 def read_file(absolute_path); end - # source://rubocop//lib/rubocop/config_loader.rb#208 + # source://rubocop//lib/rubocop/config_loader.rb#212 def resolver; end - # source://rubocop//lib/rubocop/config_loader.rb#238 + # source://rubocop//lib/rubocop/config_loader.rb#242 def yaml_tree_to_hash(yaml_tree); end - # source://rubocop//lib/rubocop/config_loader.rb#248 + # source://rubocop//lib/rubocop/config_loader.rb#252 def yaml_tree_to_hash!(yaml_tree); end end end @@ -1616,12 +1632,12 @@ class RuboCop::ConfigLoaderResolver # @api private # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#208 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#215 def base_configs(path, inherit_from, file); end # @api private # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#176 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#183 def determine_inherit_mode(hash, key); end # @api private @@ -1638,52 +1654,63 @@ class RuboCop::ConfigLoaderResolver # @api private # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#267 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#177 + def duplicate_setting_warning(opts, key); end + + # @api private + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#278 def gem_config_path(gem_name, relative_config_path); end # @api private # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#245 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#256 def handle_disabled_by_default(config, new_default_configuration); end # @api private # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#220 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#227 def inherited_file(path, inherit_from, file); end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#204 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#211 def merge_hashes?(base_hash, derived_hash, key); end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#241 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#252 + def remote_config?(file); end + + # @api private + # @return [Boolean] + # + # source://rubocop//lib/rubocop/config_loader_resolver.rb#248 def remote_file?(uri); end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#196 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#203 def should_merge?(mode, key); end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#200 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#207 def should_override?(mode, key); end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#182 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#189 def should_union?(derived_hash, base_hash, root_mode, key); end # @api private # - # source://rubocop//lib/rubocop/config_loader_resolver.rb#263 + # source://rubocop//lib/rubocop/config_loader_resolver.rb#274 def transform(config, &block); end # @api private @@ -2263,25 +2290,25 @@ end # Handles validation of configuration, for example cop names, parameter # names, and Ruby versions. # -# source://rubocop//lib/rubocop/config_validator.rb#6 +# source://rubocop//lib/rubocop/config_validator.rb#7 class RuboCop::ConfigValidator extend ::RuboCop::SimpleForwardable # @return [ConfigValidator] a new instance of ConfigValidator # - # source://rubocop//lib/rubocop/config_validator.rb#27 + # source://rubocop//lib/rubocop/config_validator.rb#28 def initialize(config); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def for_all_cops(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def smart_loaded_path(*_arg0, **_arg1, &_arg2); end - # source://rubocop//lib/rubocop/config_validator.rb#63 + # source://rubocop//lib/rubocop/config_validator.rb#65 def target_ruby_version; end - # source://rubocop//lib/rubocop/config_validator.rb#33 + # source://rubocop//lib/rubocop/config_validator.rb#34 def validate; end # Validations that should only be run after all config resolving has @@ -2290,103 +2317,101 @@ 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#59 + # source://rubocop//lib/rubocop/config_validator.rb#61 def validate_after_resolution; end - # @raise [ValidationError] - # - # source://rubocop//lib/rubocop/config_validator.rb#67 - def validate_section_presence(name); end - private # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#104 + # source://rubocop//lib/rubocop/config_validator.rb#100 def alert_about_unrecognized_cops(invalid_cop_names); end - # source://rubocop//lib/rubocop/config_validator.rb#254 + # source://rubocop//lib/rubocop/config_validator.rb#263 def check_cop_config_value(hash, parent = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/config_validator.rb#77 + # source://rubocop//lib/rubocop/config_validator.rb#73 def check_obsoletions; end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#84 + # source://rubocop//lib/rubocop/config_validator.rb#80 def check_target_ruby; end - # source://rubocop//lib/rubocop/config_validator.rb#195 + # source://rubocop//lib/rubocop/config_validator.rb#204 def each_invalid_parameter(cop_name); end - # source://rubocop//lib/rubocop/config_validator.rb#120 + # source://rubocop//lib/rubocop/config_validator.rb#116 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#274 + # source://rubocop//lib/rubocop/config_validator.rb#283 def param_error_message(parent, key, value, supposed_values); end - # source://rubocop//lib/rubocop/config_validator.rb#242 + # source://rubocop//lib/rubocop/config_validator.rb#251 def reject_conflicting_safe_settings; end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#233 + # source://rubocop//lib/rubocop/config_validator.rb#242 def reject_mutually_exclusive_defaults; end - # source://rubocop//lib/rubocop/config_validator.rb#142 + # source://rubocop//lib/rubocop/config_validator.rb#138 def suggestion(name); end # Returns the value of attribute target_ruby. # - # source://rubocop//lib/rubocop/config_validator.rb#75 + # source://rubocop//lib/rubocop/config_validator.rb#71 def target_ruby; end - # source://rubocop//lib/rubocop/config_validator.rb#207 + # source://rubocop//lib/rubocop/config_validator.rb#216 def validate_enforced_styles(valid_cop_names); end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#169 + # source://rubocop//lib/rubocop/config_validator.rb#165 def validate_new_cops_parameter; end - # source://rubocop//lib/rubocop/config_validator.rb#180 + # source://rubocop//lib/rubocop/config_validator.rb#190 def validate_parameter_names(valid_cop_names); end - # source://rubocop//lib/rubocop/config_validator.rb#227 + # source://rubocop//lib/rubocop/config_validator.rb#176 + def validate_parameter_shape(valid_cop_names); end + + # source://rubocop//lib/rubocop/config_validator.rb#236 def validate_support_and_has_list(name, formats, valid); end # @raise [ValidationError] # - # source://rubocop//lib/rubocop/config_validator.rb#158 + # source://rubocop//lib/rubocop/config_validator.rb#154 def validate_syntax_cop; end end # @api private # -# source://rubocop//lib/rubocop/config_validator.rb#10 +# source://rubocop//lib/rubocop/config_validator.rb#11 RuboCop::ConfigValidator::COMMON_PARAMS = T.let(T.unsafe(nil), Array) -# source://rubocop//lib/rubocop/config_validator.rb#22 +# source://rubocop//lib/rubocop/config_validator.rb#23 RuboCop::ConfigValidator::CONFIG_CHECK_AUTOCORRECTS = 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_DEPARTMENTS = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop//lib/rubocop/config_validator.rb#20 +# source://rubocop//lib/rubocop/config_validator.rb#21 RuboCop::ConfigValidator::CONFIG_CHECK_KEYS = T.let(T.unsafe(nil), Set) # @api private # -# source://rubocop//lib/rubocop/config_validator.rb#13 +# source://rubocop//lib/rubocop/config_validator.rb#14 RuboCop::ConfigValidator::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) # @api private # -# source://rubocop//lib/rubocop/config_validator.rb#17 +# source://rubocop//lib/rubocop/config_validator.rb#18 RuboCop::ConfigValidator::NEW_COPS_VALUES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/util.rb#4 @@ -2971,7 +2996,7 @@ class RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#272 + # source://rubocop//lib/rubocop/cop/base.rb#278 def active_support_extensions_enabled?; end # Adds an offense that has no particular location. @@ -2991,19 +3016,19 @@ class RuboCop::Cop::Base # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#351 + # source://rubocop//lib/rubocop/cop/base.rb#357 def always_autocorrect?; end # Called before any investigation # # @api private # - # source://rubocop//lib/rubocop/cop/base.rb#337 + # source://rubocop//lib/rubocop/cop/base.rb#343 def begin_investigation(processed_source, offset: T.unsafe(nil), original: T.unsafe(nil)); end # @api private # - # source://rubocop//lib/rubocop/cop/base.rb#318 + # source://rubocop//lib/rubocop/cop/base.rb#324 def callbacks_needed; end # Returns the value of attribute config. @@ -3020,7 +3045,7 @@ class RuboCop::Cop::Base # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#357 + # source://rubocop//lib/rubocop/cop/base.rb#363 def contextual_autocorrect?; end # Configuration Helpers @@ -3033,7 +3058,7 @@ class RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#289 + # source://rubocop//lib/rubocop/cop/base.rb#295 def excluded_file?(file); end # This method should be overridden when a cop's behavior depends @@ -3055,7 +3080,7 @@ class RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/base.rb#234 def external_dependency_checksum; end - # source://rubocop//lib/rubocop/cop/base.rb#361 + # source://rubocop//lib/rubocop/cop/base.rb#367 def inspect; end # Gets called if no message is specified when calling `add_offense` or @@ -3070,7 +3095,7 @@ class RuboCop::Cop::Base # @deprecated Make potential errors with previous API more obvious # - # source://rubocop//lib/rubocop/cop/base.rb#309 + # source://rubocop//lib/rubocop/cop/base.rb#315 def offenses; end # Called after all on_... have been called @@ -3093,10 +3118,10 @@ class RuboCop::Cop::Base # There should be very limited reasons for a Cop to do it's own parsing # - # source://rubocop//lib/rubocop/cop/base.rb#294 + # source://rubocop//lib/rubocop/cop/base.rb#300 def parse(source, path = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/base.rb#264 + # source://rubocop//lib/rubocop/cop/base.rb#270 def parser_engine; end # Returns the value of attribute processed_source. @@ -3108,20 +3133,25 @@ class RuboCop::Cop::Base # # @api private # - # source://rubocop//lib/rubocop/cop/base.rb#300 + # source://rubocop//lib/rubocop/cop/base.rb#306 def ready; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#280 + # source://rubocop//lib/rubocop/cop/base.rb#286 def relevant_file?(file); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#276 + # source://rubocop//lib/rubocop/cop/base.rb#282 def string_literals_frozen_by_default?; end - # source://rubocop//lib/rubocop/cop/base.rb#268 + # Returns a gems locked versions (i.e. from Gemfile.lock or gems.locked) + # + # source://rubocop//lib/rubocop/cop/base.rb#266 + def target_gem_version(gem_name); end + + # source://rubocop//lib/rubocop/cop/base.rb#274 def target_rails_version; end # source://rubocop//lib/rubocop/cop/base.rb#260 @@ -3129,90 +3159,90 @@ class RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/base.rb#479 + # source://rubocop//lib/rubocop/cop/base.rb#485 def annotate(message); end - # source://rubocop//lib/rubocop/cop/base.rb#373 + # source://rubocop//lib/rubocop/cop/base.rb#379 def apply_correction(corrector); end # @return [Symbol] offense status # - # source://rubocop//lib/rubocop/cop/base.rb#443 + # source://rubocop//lib/rubocop/cop/base.rb#449 def attempt_correction(range, corrector); end # Reserved for Cop::Cop # - # source://rubocop//lib/rubocop/cop/base.rb#369 + # source://rubocop//lib/rubocop/cop/base.rb#375 def callback_argument(range); end # Called to complete an investigation # - # source://rubocop//lib/rubocop/cop/base.rb#402 + # source://rubocop//lib/rubocop/cop/base.rb#408 def complete_investigation; end # @return [Symbol, Corrector] offense status # - # source://rubocop//lib/rubocop/cop/base.rb#417 + # source://rubocop//lib/rubocop/cop/base.rb#423 def correct(range); end - # source://rubocop//lib/rubocop/cop/base.rb#387 + # source://rubocop//lib/rubocop/cop/base.rb#393 def current_corrector; end # Reserved for Commissioner: # - # source://rubocop//lib/rubocop/cop/base.rb#379 + # source://rubocop//lib/rubocop/cop/base.rb#385 def current_offense_locations; end - # source://rubocop//lib/rubocop/cop/base.rb#391 + # source://rubocop//lib/rubocop/cop/base.rb#397 def current_offenses; end - # source://rubocop//lib/rubocop/cop/base.rb#383 + # source://rubocop//lib/rubocop/cop/base.rb#389 def currently_disabled_lines; end - # source://rubocop//lib/rubocop/cop/base.rb#507 + # source://rubocop//lib/rubocop/cop/base.rb#513 def custom_severity; end - # source://rubocop//lib/rubocop/cop/base.rb#503 + # source://rubocop//lib/rubocop/cop/base.rb#509 def default_severity; end - # source://rubocop//lib/rubocop/cop/base.rb#457 + # source://rubocop//lib/rubocop/cop/base.rb#463 def disable_uncorrectable(range); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#493 + # source://rubocop//lib/rubocop/cop/base.rb#499 def enabled_line?(line_number); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#485 + # source://rubocop//lib/rubocop/cop/base.rb#491 def file_name_matches_any?(file, parameter, default_result); end - # source://rubocop//lib/rubocop/cop/base.rb#475 + # source://rubocop//lib/rubocop/cop/base.rb#481 def find_message(range, message); end - # source://rubocop//lib/rubocop/cop/base.rb#499 + # source://rubocop//lib/rubocop/cop/base.rb#505 def find_severity(_range, severity); end - # source://rubocop//lib/rubocop/cop/base.rb#520 + # source://rubocop//lib/rubocop/cop/base.rb#526 def range_for_original(range); end - # source://rubocop//lib/rubocop/cop/base.rb#464 + # source://rubocop//lib/rubocop/cop/base.rb#470 def range_from_node_or_range(node_or_range); end # Actually private methods # - # source://rubocop//lib/rubocop/cop/base.rb#412 + # source://rubocop//lib/rubocop/cop/base.rb#418 def reset_investigation; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/base.rb#528 + # source://rubocop//lib/rubocop/cop/base.rb#534 def target_satisfies_all_gem_version_requirements?; end # @return [Symbol] offense status # - # source://rubocop//lib/rubocop/cop/base.rb#432 + # source://rubocop//lib/rubocop/cop/base.rb#438 def use_corrector(range, corrector); end class << self @@ -3232,7 +3262,7 @@ class RuboCop::Cop::Base # @api private # - # source://rubocop//lib/rubocop/cop/base.rb#323 + # source://rubocop//lib/rubocop/cop/base.rb#329 def callbacks_needed; end # source://rubocop//lib/rubocop/cop/base.rb#97 @@ -3323,12 +3353,12 @@ class RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/base.rb#395 + # source://rubocop//lib/rubocop/cop/base.rb#401 def restrict_on_send; end end end -# source://rubocop//lib/rubocop/cop/base.rb#399 +# source://rubocop//lib/rubocop/cop/base.rb#405 RuboCop::Cop::Base::EMPTY_OFFENSES = T.let(T.unsafe(nil), Array) # Reports of an investigation. @@ -4178,7 +4208,7 @@ module RuboCop::Cop::CheckLineBreakable # 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 + # If a `send` or `csend` node contains a heredoc argument, splitting cannot happen # after the heredoc or else it will cause a syntax error. # # @api private @@ -7535,9 +7565,6 @@ class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#71 def flattened_arguments(node); end - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#151 - def hash_argument_config; end - # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#111 def message(_node); end @@ -9627,60 +9654,60 @@ class RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier < ::RuboCop::Cop::Bas # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#114 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#115 def allowed_only_before_style?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#163 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#164 def block_start?(line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#169 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#170 def body_end?(line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#157 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#158 def class_def?(line); end - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#123 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#124 def correct_next_line_if_denied_style(corrector, node, line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#153 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#154 def empty_lines_around?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#103 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#104 def expected_empty_lines?(node); end - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#179 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#180 def message(node); end - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#188 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#189 def message_for_around_style(node); end - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#198 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#199 def message_for_only_before_style(node); end - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#175 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#176 def next_empty_line_range(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#147 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#148 def next_line_empty?(last_send_line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#140 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#141 def previous_line_empty?(send_line); end - # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#136 + # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#137 def previous_line_ignoring_comments(processed_source, send_line); end end @@ -10759,9 +10786,6 @@ class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#281 - def argument_alignment_config; end - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#174 def autocorrect(corrector, node); end @@ -10787,7 +10811,7 @@ class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#277 + # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#276 def enable_layout_first_method_argument_line_break?; end # @return [Boolean] @@ -10915,9 +10939,6 @@ class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Base private - # 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#108 def autocorrect(corrector, node); end @@ -11132,9 +11153,6 @@ class RuboCop::Cop::Layout::FirstHashElementIndentation < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#233 - def argument_alignment_config; end - # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#137 def autocorrect(corrector, node); end @@ -11635,29 +11653,32 @@ class RuboCop::Cop::Layout::HashAlignment < ::RuboCop::Cop::Base # Returns the value of attribute column_deltas. # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#218 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#219 def column_deltas; end # Sets the attribute column_deltas # # @param value the value to set the attribute column_deltas to. # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#218 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#219 def column_deltas=(_arg0); end # Returns the value of attribute offenses_by. # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#218 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#219 def offenses_by; end # Sets the attribute offenses_by # # @param value the value to set the attribute offenses_by to. # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#218 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#219 def offenses_by=(_arg0); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#208 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#195 + def on_csend(node); end + + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#209 def on_hash(node); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#195 @@ -11671,75 +11692,77 @@ class RuboCop::Cop::Layout::HashAlignment < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#265 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#267 def add_offenses; end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#371 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#373 def adjust(corrector, delta, range); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#300 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#302 def alignment_for(pair); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#314 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#316 def alignment_for_colons; end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#310 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#312 def alignment_for_hash_rockets; end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#390 - def argument_alignment_config; end - - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#233 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#235 def argument_before_hash(hash_node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#222 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#223 def autocorrect_incompatible_with_other_cops?(node); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#283 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#285 def check_delta(delta, node:, alignment:); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#246 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#248 def check_pairs(node); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#337 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#339 def correct_key_value(corrector, delta, key, value, separator); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#333 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#335 def correct_no_value(corrector, key_delta, key); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#318 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#320 def correct_node(corrector, node, delta); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#242 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#244 def double_splat?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#384 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#386 def enforce_first_argument_with_fixed_indentation?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#380 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#382 def good_alignment?(column_deltas); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#291 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#293 def ignore_hash_argument?(node); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#353 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#355 def new_alignment(key); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#273 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#275 def register_offenses_with_format(offenses, format); end - # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#237 + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#239 def reset!; end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#391 + def same_line?(node1, node2); end end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#183 @@ -11800,15 +11823,18 @@ class RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis < ::RuboCop::Cop:: include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#64 + def on_csend(node); end + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#64 def on_send(node); end private - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#184 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#185 def add_correct_closing_paren(node, corrector); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#271 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#272 def add_correct_external_trailing_comma(node, corrector); end # Autocorrection note: @@ -11838,106 +11864,106 @@ class RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis < ::RuboCop::Cop:: # third_array_value, # ] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#107 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#108 def autocorrect(corrector, node); end # Closing parenthesis helpers. # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#162 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#163 def end_keyword_before_closing_parenthesis?(parenthesized_send_node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#222 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#223 def exist_argument_between_heredoc_end_and_closing_parentheses?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#289 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#290 def external_trailing_comma?(node); end # Returns nil if no trailing external comma. # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#294 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#295 def external_trailing_comma_offset_from_loc_end(node); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#137 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#138 def extract_heredoc(node); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#133 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#134 def extract_heredoc_argument(node); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#230 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#231 def find_most_bottom_of_heredoc_end(arguments); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#179 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#180 def fix_closing_parenthesis(node, corrector); end # External trailing comma helpers. # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#266 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#267 def fix_external_trailing_comma(node, corrector); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#149 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#150 def heredoc_node?(node); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#197 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#198 def incorrect_parenthesis_removal_begin(node); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#213 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#214 def incorrect_parenthesis_removal_end(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#244 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#245 def internal_trailing_comma?(node); end # Returns nil if no trailing internal comma. # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#249 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#250 def internal_trailing_comma_offset_from_last_arg(node); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#115 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#116 def outermost_send_on_same_line(heredoc); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#188 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#189 def remove_incorrect_closing_paren(node, corrector); end - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#277 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#278 def remove_incorrect_external_trailing_comma(node, corrector); end # Internal trailing comma helpers. # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#238 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#239 def remove_internal_trailing_comma(node, corrector); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#207 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#208 def safe_to_remove_line_containing_closing_paren?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#126 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#127 def send_missing_closing_parens?(parent, child, heredoc); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#153 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#154 def single_line_send_with_heredoc_receiver?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#305 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#306 def space?(pos); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#168 + # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#169 def subsequent_closing_parentheses_in_same_line?(outermost_send); end class << self @@ -12863,6 +12889,11 @@ class RuboCop::Cop::Layout::LineContinuationSpacing < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#91 def ignored_literal_ranges(ast); end + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#130 + def ignored_parent?(node); end + # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#125 def ignored_ranges; end @@ -12877,12 +12908,12 @@ class RuboCop::Cop::Layout::LineContinuationSpacing < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#130 + # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#136 def no_space_style?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#134 + # source://rubocop//lib/rubocop/cop/layout/line_continuation_spacing.rb#140 def space_style?; end end @@ -13072,6 +13103,9 @@ class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 def on_block(node); end + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#87 + def on_csend(node); end + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#87 def on_def(node); end @@ -13081,10 +13115,10 @@ class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/layout/line_length.rb#87 def on_hash(node); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#101 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#102 def on_investigation_end; end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#95 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#96 def on_new_investigation; end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 @@ -13103,60 +13137,60 @@ class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#306 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#307 def allow_heredoc?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#314 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#315 def allow_string_split?; end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#310 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#311 def allowed_heredoc; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#263 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#264 def allowed_line?(line, line_index); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#178 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#179 def breakable_block_range(block_node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#365 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#366 def breakable_dstr?(node); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#227 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#228 def breakable_dstr_begin_position(node); end # Returns the value of attribute breakable_range. # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#109 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#110 def breakable_range; end # Sets the attribute breakable_range # # @param value the value to set the attribute breakable_range to. # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#109 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#110 def breakable_range=(_arg0); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#186 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#187 def breakable_range_after_semicolon(semicolon_token); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#232 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#233 def breakable_range_by_line_index; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#169 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#170 def breakable_string?(node); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#236 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#237 def breakable_string_delimiters; end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#199 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#200 def breakable_string_position(node); end # Locate where to break a string that is too long, ensuring that escape characters @@ -13164,72 +13198,72 @@ class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base # If the string contains spaces, use them to determine a place for a clean break; # otherwise, the string will be broken at the line length limit. # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#211 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#212 def breakable_string_range(node); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#341 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#342 def check_directive_line(line, line_index); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#132 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#133 def check_for_breakable_block(block_node); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#154 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#155 def check_for_breakable_dstr(node); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#111 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#112 def check_for_breakable_node(node); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#124 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#125 def check_for_breakable_semicolons(processed_source); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#142 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#143 def check_for_breakable_str(node); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#251 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#252 def check_line(line, line_index); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#358 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#359 def check_uri_line(line, line_index); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#291 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#292 def excess_range(uri_range, line, line_index); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#318 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#319 def extract_heredocs(ast); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#240 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#241 def heredocs; end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#244 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#245 def highlight_start(line); end # Find the largest possible substring of a string node to retain before a break # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#379 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#380 def largest_possible_string(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#337 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#338 def line_in_heredoc?(line_number); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#328 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#329 def line_in_permitted_heredoc?(line_number); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#302 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#303 def max; end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#273 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#274 def register_offense(loc, line, line_index, length: T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#269 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#270 def shebang?(line, line_index); end - # source://rubocop//lib/rubocop/cop/layout/line_length.rb#370 + # source://rubocop//lib/rubocop/cop/layout/line_length.rb#371 def string_delimiter(node); end end @@ -13784,6 +13818,18 @@ RuboCop::Cop::Layout::MultilineHashKeyLineBreaks::MSG = T.let(T.unsafe(nil), Str # foo(a, b, c) # @example AllowMultilineFinalElement: false (default) # +# # bad +# foo(a, b, +# c +# ) +# +# # bad +# foo( +# a, b, { +# foo: "bar", +# } +# ) +# # # good # foo( # a, @@ -13794,6 +13840,18 @@ RuboCop::Cop::Layout::MultilineHashKeyLineBreaks::MSG = T.let(T.unsafe(nil), Str # ) # @example AllowMultilineFinalElement: true # +# # bad +# foo(a, b, +# c +# ) +# +# # good +# foo( +# a, b, { +# foo: "bar", +# } +# ) +# # # good # foo( # a, @@ -13803,23 +13861,23 @@ RuboCop::Cop::Layout::MultilineHashKeyLineBreaks::MSG = T.let(T.unsafe(nil), Str # } # ) # -# source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#56 +# source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#80 class RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks < ::RuboCop::Cop::Base include ::RuboCop::Cop::MultilineElementLineBreaks extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#62 + # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#86 def on_send(node); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#81 + # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#105 def ignore_last_element?; end end -# source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#60 +# source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#84 RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks::MSG = T.let(T.unsafe(nil), String) # Checks that the closing brace in a method call is either @@ -17618,6 +17676,120 @@ end # source://rubocop//lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb#30 RuboCop::Cop::Lint::ConstantOverwrittenInRescue::MSG = T.let(T.unsafe(nil), String) +# Checks for constant reassignments. +# +# Emulates Ruby's runtime warning "already initialized constant X" +# when a constant is reassigned in the same file and namespace using the +# `NAME = value` syntax. +# +# The cop cannot catch all offenses, like, for example, when a constant +# is reassigned in another file, or when using metaprogramming (`Module#const_set`). +# +# The cop only takes into account constants assigned in a "simple" way: directly +# inside class/module definition, or within another constant. Other type of assignments +# (e.g., inside a conditional) are disregarded. +# +# The cop also tracks constant removal using `Module#remove_const` with symbol +# or string argument. +# +# @example +# # bad +# X = :foo +# X = :bar +# +# # bad +# class A +# X = :foo +# X = :bar +# end +# +# # bad +# module A +# X = :foo +# X = :bar +# end +# +# # good - keep only one assignment +# X = :bar +# +# class A +# X = :bar +# end +# +# module A +# X = :bar +# end +# +# # good - use OR assignment +# X = :foo +# X ||= :bar +# +# # good - use conditional assignment +# X = :foo +# X = :bar unless defined?(X) +# +# # good - remove the assigned constant first +# class A +# X = :foo +# remove_const :X +# X = :bar +# end +# +# source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#65 +class RuboCop::Cop::Lint::ConstantReassignment < ::RuboCop::Cop::Base + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#76 + def on_casgn(node); end + + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#84 + def on_send(node); end + + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#71 + def remove_constant(param0 = T.unsafe(nil)); end + + private + + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#139 + def ancestor_namespaces(node); end + + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#146 + def constant_names; end + + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#135 + def constant_namespaces(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#98 + def fixed_constant_path?(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#115 + def freeze_method?(node); end + + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#119 + def fully_qualified_constant_name(node); end + + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#131 + def fully_qualified_name_for(namespaces, constant); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#111 + def namespace_definition?(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#102 + def simple_assignment?(node); end +end + +# source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#66 +RuboCop::Cop::Lint::ConstantReassignment::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop//lib/rubocop/cop/lint/constant_reassignment.rb#68 +RuboCop::Cop::Lint::ConstantReassignment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Check that certain constants are fully qualified. # # This is not enabled by default because it would mark a lot of offenses @@ -18711,7 +18883,7 @@ 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. +# Checks for duplicate literal, constant, or variable elements in Set and SortedSet. # # @example # @@ -18733,29 +18905,41 @@ RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String) # # good # [:foo, :bar].to_set # -# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#28 +# # bad +# SortedSet[:foo, :bar, :foo] +# +# # good +# SortedSet[:foo, :bar] +# +# # bad +# SortedSet.new([:foo, :bar, :foo]) +# +# # good +# SortedSet.new([:foo, :bar]) +# +# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#39 class RuboCop::Cop::Lint::DuplicateSetElement < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#43 + # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#54 def on_csend(node); end - # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#43 + # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#54 def on_send(node); end - # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#35 + # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#46 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 + # source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#75 + def register_offense(current_element, prev_element, node); end end -# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#31 +# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#42 RuboCop::Cop::Lint::DuplicateSetElement::MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#32 +# source://rubocop//lib/rubocop/cop/lint/duplicate_set_element.rb#43 RuboCop::Cop::Lint::DuplicateSetElement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks if each_with_object is called with an immutable @@ -20539,65 +20723,65 @@ class RuboCop::Cop::Lint::LiteralInInterpolation < ::RuboCop::Cop::Base include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#24 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#25 def on_interpolation(begin_node); end private - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#60 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#68 def autocorrected_value(node); end - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#127 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#135 def autocorrected_value_for_array(node); end - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#133 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#141 def autocorrected_value_for_hash(node); end - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#103 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#111 def autocorrected_value_for_string(node); end - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#111 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#119 def autocorrected_value_for_symbol(node); end - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#144 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#152 def autocorrected_value_in_hash(node); end - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#118 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#126 def autocorrected_value_in_hash_for_symbol(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#174 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#182 def ends_heredoc_line?(node); end - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#82 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#90 def handle_special_regexp_chars(begin_node, value); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#182 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#190 def in_array_percent_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#46 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#54 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#165 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#173 def prints_as_self?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#170 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#178 def space_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#54 + # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#62 def special_keyword?(node); end end @@ -21093,10 +21277,10 @@ 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#127 + # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#131 def eval_call?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#132 + # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#136 def exec_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#97 @@ -21109,9 +21293,14 @@ class RuboCop::Cop::Lint::NestedMethodDefinition < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#120 + # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#124 def allowed_method_name?(node); end + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#120 + def allowed_subject_type?(subject); end + # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#115 @@ -21321,25 +21510,25 @@ class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#98 def allowable_use_with_if?(if_node); end - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#122 + # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#123 def autocorrect(corrector, node, range); end - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#133 + # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#134 def autocorrect_replace_method(corrector, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#153 + # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#154 def force_method?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#167 + # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#168 def force_method_name?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#163 + # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#164 def force_option?(node); end # @return [Boolean] @@ -21356,12 +21545,12 @@ class RuboCop::Cop::Lint::NonAtomicFileOperation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#102 def register_offense(node, exist_node); end - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#141 + # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#142 def replacement_method(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#157 + # source://rubocop//lib/rubocop/cop/lint/non_atomic_file_operation.rb#158 def require_mode_keyword?(node); end end @@ -21737,30 +21926,27 @@ RuboCop::Cop::Lint::NumberedParameterAssignment::NUMBERED_PARAMETER_RANGE = T.le RuboCop::Cop::Lint::NumberedParameterAssignment::NUM_PARAM_MSG = T.let(T.unsafe(nil), String) # Certain numeric operations have a constant result, usually 0 or 1. -# Subtracting a number from itself or multiplying it by 0 will always return 0. -# Additionally, a variable modulo 0 or itself will always return 0. +# Multiplying a number by 0 will always return 0. # Dividing a number by itself or raising it to the power of 0 will always return 1. # As such, they can be replaced with that result. # These are probably leftover from debugging, or are mistakes. # Other numeric operations that are similarly leftover from debugging or mistakes # are handled by Lint/UselessNumericOperation. # +# NOTE: This cop doesn't detect offenses for the `-` and `%` operator because it +# can't determine the type of `x`. If `x` is an Array or String, it doesn't perform +# a numeric operation. +# # @example # # # bad -# x - x # x * 0 -# x % 1 -# x % x # # # good # 0 # # # bad -# x -= x # x *= 0 -# x %= 1 -# x %= x # # # good # x = 0 @@ -21779,36 +21965,34 @@ RuboCop::Cop::Lint::NumberedParameterAssignment::NUM_PARAM_MSG = T.let(T.unsafe( # # good # x = 1 # -# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#49 +# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#46 class RuboCop::Cop::Lint::NumericOperationWithConstantResult < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#59 + # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#56 def abbreviated_assignment_with_constant_result?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#74 + # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#71 def on_op_asgn(node); end - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#62 + # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#59 def on_send(node); end - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#55 + # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#52 def operation_with_constant_result?(param0 = T.unsafe(nil)); end private - # rubocop :disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity - # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#89 + # source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#85 def constant_result?(variable, operation, number); end end -# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#51 +# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#48 RuboCop::Cop::Lint::NumericOperationWithConstantResult::MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#52 +# source://rubocop//lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb#49 RuboCop::Cop::Lint::NumericOperationWithConstantResult::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for unintended or-assignment to a constant. @@ -24043,6 +24227,63 @@ end # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#42 RuboCop::Cop::Lint::ShadowingOuterLocalVariable::MSG = T.let(T.unsafe(nil), String) +# Checks for Hash creation with a mutable default value. +# Creating a Hash in such a way will share the default value +# across all keys, causing unexpected behavior when modifying it. +# +# For example, when the Hash was created with an Array as the argument, +# calling `hash[:foo] << 'bar'` will also change the value of all +# other keys that have not been explicitly assigned to. +# +# @example +# # bad +# Hash.new([]) +# Hash.new({}) +# Hash.new(Array.new) +# Hash.new(Hash.new) +# +# # okay -- In rare cases that intentionally have this behavior, +# # without disabling the cop, you can set the default explicitly. +# h = Hash.new +# h.default = [] +# h[:a] << 1 +# h[:b] << 2 +# h # => {:a => [1, 2], :b => [1, 2]} +# +# # okay -- beware this will discard mutations and only remember assignments +# Hash.new { Array.new } +# Hash.new { Hash.new } +# Hash.new { {} } +# Hash.new { [] } +# +# # good - frozen solution will raise an error when mutation attempted +# Hash.new([].freeze) +# Hash.new({}.freeze) +# +# # good - using a proc will create a new object for each key +# h = Hash.new +# h.default_proc = ->(h, k) { [] } +# h.default_proc = ->(h, k) { {} } +# +# # good - using a block will create a new object for each key +# Hash.new { |h, k| h[k] = [] } +# Hash.new { |h, k| h[k] = {} } +# +# source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#47 +class RuboCop::Cop::Lint::SharedMutableDefault < ::RuboCop::Cop::Base + # source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#53 + def hash_initialized_with_mutable_shared_object?(param0 = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#57 + def on_send(node); end +end + +# source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#48 +RuboCop::Cop::Lint::SharedMutableDefault::MSG = T.let(T.unsafe(nil), String) + +# source://rubocop//lib/rubocop/cop/lint/shared_mutable_default.rb#50 +RuboCop::Cop::Lint::SharedMutableDefault::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + # Checks unexpected overrides of the `Struct` built-in methods # via `Struct.new`. # @@ -24320,24 +24561,27 @@ RuboCop::Cop::Lint::SymbolConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Ar # # source://rubocop//lib/rubocop/cop/lint/syntax.rb#8 class RuboCop::Cop::Lint::Syntax < ::RuboCop::Cop::Base - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#9 + # source://rubocop//lib/rubocop/cop/lint/syntax.rb#11 def on_other_file; end private - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#19 + # source://rubocop//lib/rubocop/cop/lint/syntax.rb#22 def add_offense_from_diagnostic(diagnostic, ruby_version); end - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#29 + # source://rubocop//lib/rubocop/cop/lint/syntax.rb#32 def add_offense_from_error(error); end - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#34 + # source://rubocop//lib/rubocop/cop/lint/syntax.rb#37 def beautify_message(message); end - # source://rubocop//lib/rubocop/cop/lint/syntax.rb#40 + # source://rubocop//lib/rubocop/cop/lint/syntax.rb#43 def find_severity(_range, _severity); end end +# source://rubocop//lib/rubocop/cop/lint/syntax.rb#9 +RuboCop::Cop::Lint::Syntax::LEVELS = T.let(T.unsafe(nil), Array) + # Ensures that `to_enum`/`enum_for`, called for the current method, # has correct arguments. # @@ -24662,10 +24906,10 @@ class RuboCop::Cop::Lint::UnescapedBracketInRegexp < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#69 + # 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#84 + # source://rubocop//lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb#81 def range_at_index(node, index, offset); end end @@ -25361,7 +25605,7 @@ class RuboCop::Cop::Lint::UnusedMethodArgument < ::RuboCop::Cop::Base def message(variable); end class << self - # source://rubocop-performance/1.23.0/lib/rubocop-performance.rb#15 + # source://rubocop-performance/1.23.1/lib/rubocop-performance.rb#15 def autocorrect_incompatible_with; end # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#84 @@ -26361,58 +26605,58 @@ class RuboCop::Cop::Lint::Void < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/void.rb#259 + # source://rubocop//lib/rubocop/cop/lint/void.rb#260 def all_keys_entirely_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/void.rb#263 + # source://rubocop//lib/rubocop/cop/lint/void.rb#264 def all_values_entirely_literal?(node); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#237 + # source://rubocop//lib/rubocop/cop/lint/void.rb#238 def autocorrect_nonmutating_send(corrector, node, suggestion); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#231 + # source://rubocop//lib/rubocop/cop/lint/void.rb#232 def autocorrect_void_expression(corrector, node); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#218 + # source://rubocop//lib/rubocop/cop/lint/void.rb#219 def autocorrect_void_op(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#101 def check_begin(node); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#198 + # source://rubocop//lib/rubocop/cop/lint/void.rb#199 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#156 + # source://rubocop//lib/rubocop/cop/lint/void.rb#157 def check_literal(node); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#180 + # source://rubocop//lib/rubocop/cop/lint/void.rb#181 def check_nonmutating(node); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#164 + # source://rubocop//lib/rubocop/cop/lint/void.rb#165 def check_self(node); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#138 + # source://rubocop//lib/rubocop/cop/lint/void.rb#139 def check_var(node); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#172 + # source://rubocop//lib/rubocop/cop/lint/void.rb#173 def check_void_expression(node); end - # source://rubocop//lib/rubocop/cop/lint/void.rb#127 + # source://rubocop//lib/rubocop/cop/lint/void.rb#128 def check_void_op(node, &block); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/void.rb#246 + # source://rubocop//lib/rubocop/cop/lint/void.rb#247 def entirely_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/lint/void.rb#211 + # source://rubocop//lib/rubocop/cop/lint/void.rb#212 def in_void_context?(node); end end @@ -27063,7 +27307,12 @@ class RuboCop::Cop::Metrics::MethodLength < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#66 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#73 + def allowed?(method_name); end + + # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#69 def cop_label; end end @@ -30265,101 +30514,113 @@ end module RuboCop::Cop::PrecedingFollowingAlignment private + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#78 + def aligned_comment_lines; end + # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#93 - def aligned_assignment?(range, lineno); end - - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#70 - def aligned_comment_lines; end + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#101 + def aligned_equals_operator?(range, lineno); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#122 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#132 def aligned_identical?(range, line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#81 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#89 def aligned_operator?(range, line, lineno); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#77 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#85 def aligned_token?(range, line, lineno); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#34 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#42 def aligned_with_adjacent_line?(range, predicate); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#52 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#60 def aligned_with_any_line?(line_ranges, range, indent = T.unsafe(nil), &predicate); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#42 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#50 def aligned_with_any_line_range?(line_ranges, range, &predicate); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#114 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#124 def aligned_with_append_operator?(range, token); end - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#126 - def aligned_with_assignment(token, line_range); end + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#136 + def aligned_with_equals_sign(token, line_range); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#56 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#64 def aligned_with_line?(line_nos, range, indent = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#18 - def aligned_with_operator?(range); end - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#22 - def aligned_with_preceding_assignment(token); end + def aligned_with_operator?(range); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#108 - def aligned_with_preceding_assignment?(range, token); end + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#118 + def aligned_with_preceding_equals?(range, token); end + + # Allows alignment with a preceding operator that ends with an `=`, + # including assignment and comparison operators. + # + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#28 + def aligned_with_preceding_equals_operator(token); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#14 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#18 def aligned_with_something?(range); end - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#28 - def aligned_with_subsequent_assignment(token); end + # Allows alignment with a subsequent operator that ends with an `=`, + # including assignment and comparison operators. + # + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#36 + def aligned_with_subsequent_equals_operator(token); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#85 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#93 def aligned_words?(range, line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#10 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#14 def allow_for_alignment?; end - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#141 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#151 def assignment_lines; end - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#145 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#155 def assignment_tokens; end - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#161 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#171 def relevant_assignment_lines(line_range); end - # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#188 + # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#198 def remove_optarg_equals(asgn_tokens, processed_source); end end +# Tokens that end with an `=`, as well as `<<`, that can be aligned together: +# `=`, `==`, `===`, `!=`, `<=`, `>=`, `<<` and operator assignment (`+=`, etc). +# +# source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#10 +RuboCop::Cop::PrecedingFollowingAlignment::ASSIGNMENT_OR_COMPARISON_TOKENS = T.let(T.unsafe(nil), Array) + # Common functionality for handling percent literal delimiters. # # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#6 @@ -30418,36 +30679,36 @@ end module RuboCop::Cop::RSpec; end class RuboCop::Cop::RSpec::MultipleExpectations < ::RuboCop::Cop::RSpec::Base - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#78 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#78 def aggregate_failures?(param0 = T.unsafe(nil), param1); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#89 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#89 def aggregate_failures_block?(param0 = T.unsafe(nil)); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#86 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#86 def expect?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 def max=(value); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#93 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#93 def on_block(node); end private - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#109 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#109 def example_with_aggregate_failures?(example_node); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#116 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#116 def find_aggregate_failures(example_node); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#121 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#121 def find_expectation(node, &block); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#132 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#132 def flag_example(node, expectation_count:); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_expectations.rb#143 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_expectations.rb#143 def max_expectations; end end @@ -30455,30 +30716,30 @@ class RuboCop::Cop::RSpec::MultipleMemoizedHelpers < ::RuboCop::Cop::RSpec::Base # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 def max=(value); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#91 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#91 def on_block(node); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#102 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#102 def on_new_investigation; end private - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#111 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#111 def all_helpers(node); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#141 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#141 def allow_subject?; end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#109 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#109 def example_group_memoized_helpers; end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#116 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#116 def helpers(node); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#137 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#137 def max; end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#127 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb#127 def variable_nodes(node); end end @@ -30486,27 +30747,27 @@ class RuboCop::Cop::RSpec::NestedGroups < ::RuboCop::Cop::RSpec::Base # source://rubocop//lib/rubocop/cop/exclude_limit.rb#11 def max=(value); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/nested_groups.rb#107 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/nested_groups.rb#107 def on_top_level_group(node); end private - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/nested_groups.rb#157 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/nested_groups.rb#157 def allowed_groups; end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/nested_groups.rb#134 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/nested_groups.rb#134 def count_up_nesting?(node, example_group); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/nested_groups.rb#119 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/nested_groups.rb#119 def find_nested_example_groups(node, nesting: T.unsafe(nil), &block); end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/nested_groups.rb#144 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/nested_groups.rb#144 def max_nesting; end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/nested_groups.rb#148 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/nested_groups.rb#148 def max_nesting_config; end - # source://rubocop-rspec/3.2.0/lib/rubocop/cop/rspec/nested_groups.rb#140 + # source://rubocop-rspec/3.3.0/lib/rubocop/cop/rspec/nested_groups.rb#140 def message(nesting); end end @@ -31474,22 +31735,13 @@ module RuboCop::Cop::Style; end # 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) +# @example AllowModifiersOnAliasMethod: false # # bad # class Foo # -# private def bar; end -# private def baz; end -# -# end -# -# # good -# class Foo -# -# private -# -# def bar; end -# def baz; end +# public alias_method :bar, :foo +# protected alias_method :baz, :foo +# private alias_method :qux, :foo # # end # @example EnforcedStyle: inline @@ -31556,117 +31808,152 @@ module RuboCop::Cop::Style; end # private attr :quux # # end +# @example AllowModifiersOnAliasMethod: true (default) +# # good +# class Foo +# +# public alias_method :bar, :foo +# protected alias_method :baz, :foo +# private alias_method :qux, :foo +# +# end +# @example EnforcedStyle: group (default) +# # bad +# class Foo +# +# private def bar; end +# private def baz; end +# +# end +# +# # good +# class Foo +# +# private # -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#115 +# def bar; end +# def baz; end +# +# end +# +# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#135 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#143 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#169 + def access_modifier_with_alias_method?(param0 = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#163 def access_modifier_with_attr?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#136 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#156 def access_modifier_with_symbol?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#148 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#174 def on_send(node); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#218 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#249 def access_modifier_is_inlined?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#222 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#253 def access_modifier_is_not_inlined?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#193 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#224 + def allow_modifiers_on_alias_method?(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#220 def allow_modifiers_on_attrs?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#189 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#216 def allow_modifiers_on_symbols?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#163 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#189 def allowed?(node); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#170 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#197 def autocorrect(corrector, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#203 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#234 def correctable_group_offense?(node); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#305 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#336 def def_source(node, def_nodes); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#265 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#296 def find_argument_less_modifier_node(node); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#246 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#277 def find_corresponding_def_nodes(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#210 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#241 def group_style?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#214 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#245 def inline_style?; end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#295 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#326 def insert_inline_modifier(corrector, node, modifier_name); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#236 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#267 def message(range); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#197 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#228 def offense?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#185 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#212 def percent_symbol_array?(node); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#299 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#330 def remove_nodes(corrector, *nodes); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#279 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#310 def replace_defs(corrector, node, def_nodes); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#226 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#257 def right_siblings_same_inline_method?(node); end - # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#273 + # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#304 def select_grouped_def_nodes(node); end end -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#133 +# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#153 RuboCop::Cop::Style::AccessModifierDeclarations::ALLOWED_NODE_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#121 +# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#141 RuboCop::Cop::Style::AccessModifierDeclarations::GROUP_STYLE_MESSAGE = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#126 +# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#146 RuboCop::Cop::Style::AccessModifierDeclarations::INLINE_STYLE_MESSAGE = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#131 +# source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#151 RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for grouping of accessors in `class` and `module` bodies. @@ -33662,16 +33949,16 @@ class RuboCop::Cop::Style::ClassAndModuleChildren < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#89 def add_trailing_end(corrector, node, padding); end - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#170 + # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#173 def autocorrect(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#159 + # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#162 def check_compact_style(node, body); end - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#151 + # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#154 def check_nested_style(node); end - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#141 + # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#144 def check_style(node, body); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#94 @@ -33685,18 +33972,18 @@ class RuboCop::Cop::Style::ClassAndModuleChildren < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#180 + # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#183 def compact_node_name?(node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#105 def compact_replacement(node); end - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#137 + # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#140 def leading_spaces(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#176 + # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#179 def needs_compacting?(body); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#62 @@ -36237,10 +36524,10 @@ class RuboCop::Cop::Style::EachForSimpleLoop < ::RuboCop::Cop::Base # 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#64 + # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#63 def each_range_with_zero_origin?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#76 + # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#74 def each_range_without_block_argument?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#29 @@ -36558,56 +36845,62 @@ class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#139 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#141 def on_case(node); end - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#135 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#137 def on_normal_if_unless(node); end private - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#172 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#174 def autocorrect(corrector, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#194 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#196 def autocorrect_forbidden?(type); end - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#187 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#189 def base_node(node); end - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#145 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#147 def check(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#180 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#182 def comment_in_else?(node); end - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#160 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#162 def empty_check(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#156 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#158 def empty_style?; end - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#198 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#200 def missing_else_style; end - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#166 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#168 def nil_check(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/empty_else.rb#152 + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#154 def nil_style?; end end +# source://rubocop//lib/rubocop/cop/style/empty_else.rb#135 +RuboCop::Cop::Style::EmptyElse::EMPTY_STYLES = T.let(T.unsafe(nil), Array) + # source://rubocop//lib/rubocop/cop/style/empty_else.rb#133 RuboCop::Cop::Style::EmptyElse::MSG = T.let(T.unsafe(nil), String) +# source://rubocop//lib/rubocop/cop/style/empty_else.rb#134 +RuboCop::Cop::Style::EmptyElse::NIL_STYLES = T.let(T.unsafe(nil), Array) + # Checks for using empty heredoc to reduce redundancy. # # @example @@ -37243,10 +37536,10 @@ class RuboCop::Cop::Style::ExactRegexpMatch < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#63 + # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#56 def exact_match_pattern?(parsed_regexp); end - # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#70 + # source://rubocop//lib/rubocop/cop/style/exact_regexp_match.rb#63 def new_method(node); end end @@ -37451,7 +37744,7 @@ RuboCop::Cop::Style::ExplicitBlockArgument::MSG = T.let(T.unsafe(nil), String) # # * `scientific` which enforces a mantissa between 1 (inclusive) and 10 (exclusive). # * `engineering` which enforces the exponent to be a multiple of 3 and the mantissa -# to be between 0.1 (inclusive) and 10 (exclusive). +# to be between 0.1 (inclusive) and 1000 (exclusive). # * `integral` which enforces the mantissa to always be a whole number without # trailing zeroes. # @@ -37994,32 +38287,35 @@ class RuboCop::Cop::Style::FloatDivision < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/float_division.rb#71 def left_coerce?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/float_division.rb#83 + # source://rubocop//lib/rubocop/cop/style/float_division.rb#87 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/float_division.rb#67 def right_coerce?(param0 = T.unsafe(nil)); end + # source://rubocop//lib/rubocop/cop/style/float_division.rb#83 + def to_f_method?(param0 = T.unsafe(nil)); end + private - # source://rubocop//lib/rubocop/cop/style/float_division.rb#121 + # source://rubocop//lib/rubocop/cop/style/float_division.rb#125 def add_to_f_method(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/float_division.rb#130 + # source://rubocop//lib/rubocop/cop/style/float_division.rb#134 def correct_from_slash_to_fdiv(corrector, node, receiver, argument); end - # source://rubocop//lib/rubocop/cop/style/float_division.rb#141 + # source://rubocop//lib/rubocop/cop/style/float_division.rb#145 def extract_receiver_source(node); end - # source://rubocop//lib/rubocop/cop/style/float_division.rb#117 + # source://rubocop//lib/rubocop/cop/style/float_division.rb#121 def message(_node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/float_division.rb#102 + # source://rubocop//lib/rubocop/cop/style/float_division.rb#106 def offense_condition?(node); end - # source://rubocop//lib/rubocop/cop/style/float_division.rb#125 + # source://rubocop//lib/rubocop/cop/style/float_division.rb#129 def remove_to_f_method(corrector, send_node); end end @@ -39051,8 +39347,10 @@ RuboCop::Cop::Style::HashEachMethods::UNUSED_BLOCK_ARG_MSG = T.let(T.unsafe(nil) # (`Hash#except` was added in Ruby 3.0.) # # For safe detection, it is limited to commonly used string and symbol comparisons -# when used `==`. -# And do not check `Hash#delete_if` and `Hash#keep_if` to change receiver object. +# when using `==` or `!=`. +# +# This cop doesn't check for `Hash#delete_if` and `Hash#keep_if` because they +# modify the receiver. # # @example # @@ -39078,73 +39376,81 @@ RuboCop::Cop::Style::HashEachMethods::UNUSED_BLOCK_ARG_MSG = T.let(T.unsafe(nil) # # good # {foo: 1, bar: 2, baz: 3}.except(:bar) # -# source://rubocop//lib/rubocop/cop/style/hash_except.rb#44 +# source://rubocop//lib/rubocop/cop/style/hash_except.rb#46 class RuboCop::Cop::Style::HashExcept < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::TargetRubyVersion extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#71 - def bad_method_with_active_support?(param0 = T.unsafe(nil)); end + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#60 + def block_with_first_arg_check?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#55 - def bad_method_with_poro?(param0 = T.unsafe(nil)); end - - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#86 + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#75 def on_csend(node); end - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#86 + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#75 def on_send(node); end private - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#105 - def bad_method?(block); end - - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#181 + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#169 def decorate_source(value); end - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#189 + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#177 def except_key(node); end - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#168 + # 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#162 + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#148 def extract_body_if_negated(body); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#139 - def included?(negated, body); end + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#93 + def extracts_hash_subset?(block); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#147 - def not_included?(negated, body); end + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#126 + def included?(body, negated); end - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#198 + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#134 + def not_included?(body, negated); end + + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#185 def offense_range(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#151 + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#138 def safe_to_register_offense?(block, except_key); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_except.rb#123 - def semantically_except_method?(send, block); end + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#116 + def semantically_except_method?(node, block); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/hash_except.rb#108 + def supported_subset_method?(method); end end -# source://rubocop//lib/rubocop/cop/style/hash_except.rb#51 +# source://rubocop//lib/rubocop/cop/style/hash_except.rb#57 +RuboCop::Cop::Style::HashExcept::ACTIVE_SUPPORT_SUBSET_METHODS = T.let(T.unsafe(nil), Array) + +# source://rubocop//lib/rubocop/cop/style/hash_except.rb#53 RuboCop::Cop::Style::HashExcept::MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/hash_except.rb#52 +# source://rubocop//lib/rubocop/cop/style/hash_except.rb#54 RuboCop::Cop::Style::HashExcept::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +# source://rubocop//lib/rubocop/cop/style/hash_except.rb#56 +RuboCop::Cop::Style::HashExcept::SUBSET_METHODS = T.let(T.unsafe(nil), Array) + # Checks for places where `case-when` represents a simple 1:1 # mapping and can be replaced with a hash lookup. # @@ -39323,67 +39629,67 @@ class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#185 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#186 def alternative_style; end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#163 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#164 def hash_rockets_check(pairs); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#177 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#178 def no_mixed_keys_check(pairs); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#141 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#142 def on_hash(node); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#159 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#160 def ruby19_check(pairs); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#167 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#168 def ruby19_no_mixed_keys_check(pairs); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#217 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#218 def acceptable_19_syntax_symbol?(sym_name); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#274 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#275 def argument_without_space?(node); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#196 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#197 def autocorrect(corrector, node); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#278 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#281 def autocorrect_hash_rockets(corrector, pair_node); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#287 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#290 def autocorrect_no_mixed_keys(corrector, pair_node); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#253 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#254 def autocorrect_ruby19(corrector, pair_node); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#238 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#239 def check(pairs, delim, msg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#295 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#298 def force_hash_rockets?(pairs); end - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#266 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#267 def range_for_autocorrect_ruby19(pair_node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#206 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#207 def sym_indices?(pairs); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#210 + # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#211 def word_symbol_pair?(pair); end end @@ -39396,6 +39702,9 @@ RuboCop::Cop::Style::HashSyntax::MSG_HASH_ROCKETS = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#138 RuboCop::Cop::Style::HashSyntax::MSG_NO_MIXED_KEYS = T.let(T.unsafe(nil), String) +# source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#140 +RuboCop::Cop::Style::HashSyntax::NO_MIXED_KEYS_STYLES = T.let(T.unsafe(nil), Array) + # Looks for uses of `\_.each_with_object({}) {...}`, # `\_.map {...}.to_h`, and `Hash[\_.map {...}]` that are actually just # transforming the keys of a hash, and tries to use a simpler & faster @@ -40592,6 +40901,34 @@ 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) +# Checks for assignments to a local `it` variable inside a block +# where `it` can refer to the first anonymous parameter as of Ruby 3.4. +# +# Although Ruby allows reassigning `it` in these cases, it could +# cause confusion if `it` is used as a block parameter elsewhere. +# For consistency, this also applies to numblocks and blocks with +# parameters, even though `it` cannot be used in those cases. +# +# @example +# # bad +# foo { it = 5 } +# foo { |bar| it = bar } +# foo { it = _2 } +# +# # good - use a different variable name +# foo { var = 5 } +# foo { |bar| var = bar } +# foo { bar = _2 } +# +# source://rubocop//lib/rubocop/cop/style/it_assignment.rb#24 +class RuboCop::Cop::Style::ItAssignment < ::RuboCop::Cop::Base + # source://rubocop//lib/rubocop/cop/style/it_assignment.rb#27 + def on_lvasgn(node); end +end + +# source://rubocop//lib/rubocop/cop/style/it_assignment.rb#25 +RuboCop::Cop::Style::ItAssignment::MSG = T.let(T.unsafe(nil), String) + # When passing an existing hash as keyword arguments, provide additional arguments # directly rather than using `merge`. # @@ -41086,10 +41423,10 @@ class RuboCop::Cop::Style::MagicCommentFormat::CommentRange # source://rubocop//lib/rubocop/cop/style/magic_comment_format.rb#125 def directives; end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def loc(*_arg0, **_arg1, &_arg2); end - # source://rubocop-ast/1.36.2/lib/rubocop/ast/utilities/simple_forwardable.rb#9 + # source://rubocop-ast/1.37.0/lib/rubocop/ast/utilities/simple_forwardable.rb#9 def text(*_arg0, **_arg1, &_arg2); end # A magic comment can contain one value (normal style) or @@ -41485,6 +41822,8 @@ RuboCop::Cop::Style::MapToSet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # https://bugs.ruby-lang.org/issues/18396. # - Parentheses are required in anonymous arguments, keyword arguments # and block passing in Ruby 3.2. +# - Parentheses are required when the first argument is a beginless range or +# the last argument is an endless range. # # @example AllowParenthesesInStringInterpolation: true # @@ -41613,7 +41952,7 @@ RuboCop::Cop::Style::MapToSet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # # okay with `^assert` listed in `AllowedPatterns` # assert_equal 'test', x # -# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#202 +# source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#204 class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::AllowedMethods @@ -41623,30 +41962,30 @@ class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#219 def on_csend(node); end - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#219 def on_send(node); end - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#217 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#219 def on_yield(node); end private - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#225 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#227 def args_begin(node); end - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#233 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#235 def args_end(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#237 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#239 def args_parenthesized?(node); end class << self - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#213 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#215 def autocorrect_incompatible_with; end end end @@ -41666,12 +42005,12 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#184 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#194 def allowed_chained_call_with_parentheses?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#180 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#190 def allowed_multiline_call_with_parentheses?(node); end # @return [Boolean] @@ -41681,17 +42020,22 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#193 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#203 def ambiguous_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#222 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#183 + def ambiguous_range_argument?(node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#232 def assigned_before?(node, target); 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 assignment_in_condition?(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#34 @@ -41699,12 +42043,12 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#161 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#164 def call_as_argument_or_chain?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#154 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#157 def call_in_argument_with_block?(node); end # @return [Boolean] @@ -41719,7 +42063,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#167 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#170 def call_in_match_pattern?(node); end # @return [Boolean] @@ -41734,27 +42078,27 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#138 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#139 def call_with_ambiguous_arguments?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#150 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#153 def call_with_braced_block?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#240 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#250 def forwards_anonymous_rest_arguments?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#209 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#219 def hash_literal?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#173 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#176 def hash_literal_in_arguments?(node); end # @return [Boolean] @@ -41764,7 +42108,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#226 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#236 def inside_string_interpolation?(node); end # Require hash value omission be enclosed in parentheses to prevent the following issue: @@ -41782,7 +42126,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#205 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#215 def logical_operator?(node); end # @return [Boolean] @@ -41803,7 +42147,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#213 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#223 def regexp_slash_literal?(node); end # @return [Boolean] @@ -41813,7 +42157,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#197 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#207 def splat?(node); end # @return [Boolean] @@ -41828,12 +42172,12 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#201 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#211 def ternary_if?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#217 + # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#227 def unary_literal?(node); end end @@ -42346,32 +42690,32 @@ class RuboCop::Cop::Style::MissingElse < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#159 + # source://rubocop//lib/rubocop/cop/style/missing_else.rb#161 def case_style?; end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#127 def check(node); end - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#177 + # source://rubocop//lib/rubocop/cop/style/missing_else.rb#179 def empty_else_config; end - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#171 + # source://rubocop//lib/rubocop/cop/style/missing_else.rb#173 def empty_else_style; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#155 + # source://rubocop//lib/rubocop/cop/style/missing_else.rb#157 def if_style?; end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#135 def message_template; end - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#167 + # source://rubocop//lib/rubocop/cop/style/missing_else.rb#169 def unless_else_config; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/missing_else.rb#163 + # source://rubocop//lib/rubocop/cop/style/missing_else.rb#165 def unless_else_cop_enabled?; end end @@ -43153,53 +43497,51 @@ RuboCop::Cop::Style::MultilineWhenThen::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::MultipleComparison < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#58 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#74 def on_or(node); end - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#82 - def simple_comparison_lhs?(param0 = T.unsafe(nil)); end + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#64 + def simple_comparison_lhs(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#87 - def simple_comparison_rhs?(param0 = T.unsafe(nil)); end + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#69 + def simple_comparison_rhs(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#79 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#59 def simple_double_comparison?(param0 = T.unsafe(nil)); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#148 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#154 def allow_method_comparison?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#127 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#132 def comparison?(node); end - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#152 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#158 def comparisons_threshold; end - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#92 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#97 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#119 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#124 def nested_comparison?(node); end - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#111 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#116 def offense_range(values); end - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#138 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#144 def root_of_or_node(or_node); end - # @return [Boolean] - # - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#131 - def simple_comparison?(node); end + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#136 + def simple_comparison(node); end - # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#115 + # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#120 def variable_name(node); end end @@ -44691,23 +45033,26 @@ class RuboCop::Cop::Style::ObjectThen < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/object_then.rb#35 def on_block(node); end + # source://rubocop//lib/rubocop/cop/style/object_then.rb#42 + def on_csend(node); end + # source://rubocop//lib/rubocop/cop/style/object_then.rb#35 def on_numblock(node); end - # source://rubocop//lib/rubocop/cop/style/object_then.rb#41 + # source://rubocop//lib/rubocop/cop/style/object_then.rb#42 def on_send(node); end private - # source://rubocop//lib/rubocop/cop/style/object_then.rb#49 + # source://rubocop//lib/rubocop/cop/style/object_then.rb#51 def check_method_node(node); end - # source://rubocop//lib/rubocop/cop/style/object_then.rb#71 + # source://rubocop//lib/rubocop/cop/style/object_then.rb#69 def message(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/object_then.rb#60 + # source://rubocop//lib/rubocop/cop/style/object_then.rb#65 def preferred_method?(node); end end @@ -45825,51 +46170,54 @@ class RuboCop::Cop::Style::RaiseArgs < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#56 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#59 def on_send(node); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#132 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#135 def acceptable_exploded_args?(args); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#146 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#148 def allowed_non_exploded_type?(arg); end - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#95 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#98 def check_compact(node); end - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#111 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#114 def check_exploded(node); end - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#69 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#72 def correction_compact_to_exploded(node); end - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#81 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#84 def correction_exploded_to_compact(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#152 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#154 def requires_parens?(parent); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/raise_args.rb#128 + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#131 def use_new_method?(first_arg); end end +# source://rubocop//lib/rubocop/cop/style/raise_args.rb#53 +RuboCop::Cop::Style::RaiseArgs::ACCEPTABLE_ARG_TYPES = T.let(T.unsafe(nil), Array) + # source://rubocop//lib/rubocop/cop/style/raise_args.rb#52 RuboCop::Cop::Style::RaiseArgs::COMPACT_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/raise_args.rb#51 RuboCop::Cop::Style::RaiseArgs::EXPLODED_MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/raise_args.rb#54 +# source://rubocop//lib/rubocop/cop/style/raise_args.rb#57 RuboCop::Cop::Style::RaiseArgs::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for the use of randomly generated numbers, @@ -46626,7 +46974,8 @@ end # source://rubocop//lib/rubocop/cop/style/redundant_constant_base.rb#46 RuboCop::Cop::Style::RedundantConstantBase::MSG = T.let(T.unsafe(nil), String) -# Checks for uses a redundant current directory in path. +# Checks for paths given to `require_relative` that start with +# the current directory (`./`), which can be omitted. # # @example # @@ -46636,22 +46985,22 @@ RuboCop::Cop::Style::RedundantConstantBase::MSG = T.let(T.unsafe(nil), String) # # good # require_relative 'path/to/feature' # -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#16 +# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#17 class RuboCop::Cop::Style::RedundantCurrentDirectoryInPath < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#24 + # source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#25 def on_send(node); end end -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#22 +# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#23 RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::CURRENT_DIRECTORY_PATH = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#20 +# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#21 RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#21 +# source://rubocop//lib/rubocop/cop/style/redundant_current_directory_in_path.rb#22 RuboCop::Cop::Style::RedundantCurrentDirectoryInPath::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for redundant uses of double splat hash braces. @@ -47144,6 +47493,9 @@ RuboCop::Cop::Style::RedundantHeredocDelimiterQuotes::STRING_INTERPOLATION_OR_ES # will not register an offense, because it allows the initializer to take a different # number of arguments as its superclass potentially does. # +# NOTE: If an initializer takes any arguments and has an empty body, RuboCop +# assumes it to *not* be redundant. This is to prevent potential `ArgumentError`. +# # NOTE: If an initializer argument has a default value, RuboCop assumes it # to *not* be redundant. # @@ -47198,6 +47550,10 @@ RuboCop::Cop::Style::RedundantHeredocDelimiterQuotes::STRING_INTERPOLATION_OR_ES # end # # # good (changes the parameter requirements) +# def initialize(_) +# end +# +# # good (changes the parameter requirements) # def initialize(*) # end # @@ -47221,48 +47577,48 @@ RuboCop::Cop::Style::RedundantHeredocDelimiterQuotes::STRING_INTERPOLATION_OR_ES # # Overriding to negate superclass `initialize` method. # end # -# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#97 +# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#106 class RuboCop::Cop::Style::RedundantInitialize < ::RuboCop::Cop::Base include ::RuboCop::Cop::CommentsHelp include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#106 + # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#115 def initialize_forwards?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#110 + # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#119 def on_def(node); end private # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#134 + # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#143 def acceptable?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#142 + # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#151 def allow_comments?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#138 + # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#147 def forwards?(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#128 + # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#137 def register_offense(node, message); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#148 + # source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#157 def same_args?(super_node, args); end end -# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#102 +# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#111 RuboCop::Cop::Style::RedundantInitialize::MSG = T.let(T.unsafe(nil), String) -# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#103 +# source://rubocop//lib/rubocop/cop/style/redundant_initialize.rb#112 RuboCop::Cop::Style::RedundantInitialize::MSG_EMPTY = T.let(T.unsafe(nil), String) # Checks for strings that are just an interpolated expression. @@ -47447,12 +47803,12 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#201 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#205 def argument_is_method?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#165 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#169 def argument_newline?(node); end # @return [Boolean] @@ -47460,12 +47816,12 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # 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#181 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#185 def find_node_for_line(last_line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#150 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#153 def inside_string_literal?(range, token); end # @return [Boolean] @@ -47473,17 +47829,17 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # 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#138 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#141 def inspect_end_of_ruby_code_line_continuation; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#122 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#125 def leading_dot_method_chain_with_blank_line?(range); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#208 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#212 def method_call_with_arguments?(node); end # A method call without parentheses such as the following cannot remove `\`: @@ -47493,12 +47849,12 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#158 - def method_with_argument?(current_token, next_token); end + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#161 + def method_with_argument?(line_range, current_token, next_token); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#128 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#131 def redundant_line_continuation?(range); end # @return [Boolean] @@ -47508,12 +47864,12 @@ class RuboCop::Cop::Style::RedundantLineContinuation < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#187 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#191 def same_line?(node, line); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#212 + # source://rubocop//lib/rubocop/cop/style/redundant_line_continuation.rb#216 def start_with_arithmetic_operator?(source_line); end # @return [Boolean] @@ -47558,13 +47914,13 @@ 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#261 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#258 def first_send_argument?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#266 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#263 def first_super_argument?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#271 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#268 def first_yield_argument?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#166 @@ -47611,26 +47967,26 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#275 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#272 def call_chain_starts_with_int?(begin_node, send_node); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#127 def check(begin_node); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#175 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#172 def check_send(begin_node, node); end - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#185 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#182 def check_unary(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#206 def disallowed_literal?(begin_node, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#281 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#278 def do_end_block_in_method_chain?(begin_node, node); end # @return [Boolean] @@ -47648,7 +48004,7 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#250 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#247 def first_argument?(node); end # @return [Boolean] @@ -47658,12 +48014,12 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#205 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#202 def keyword_ancestor?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#224 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#221 def keyword_with_redundant_parentheses?(node); end # @return [Boolean] @@ -47673,7 +48029,7 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#237 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#234 def method_call_with_redundant_parentheses?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#119 @@ -47684,12 +48040,12 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # 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#195 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#192 def offense(node, msg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#246 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#243 def only_begin_arg?(args); end # @return [Boolean] @@ -47699,12 +48055,12 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#213 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#210 def raised_to_power_negative_numeric?(begin_node, node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#201 + # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#198 def suspect_unary?(node); end # @return [Boolean] @@ -47857,7 +48213,7 @@ class RuboCop::Cop::Style::RedundantRegexpArgument < ::RuboCop::Cop::Base # 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#85 + # source://rubocop//lib/rubocop/cop/style/redundant_regexp_argument.rb#88 def replacement(regexp_node); end end @@ -48369,6 +48725,9 @@ class RuboCop::Cop::Style::RedundantSelfAssignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector + # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#71 + def on_csend(node); end + # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#53 def on_cvasgn(node); end @@ -48384,25 +48743,25 @@ class RuboCop::Cop::Style::RedundantSelfAssignment < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#71 def on_send(node); end - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#98 + # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#99 def redundant_nonself_assignment?(param0 = T.unsafe(nil), param1, param2); end - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#88 + # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#89 def redundant_self_assignment?(param0 = T.unsafe(nil), param1); end private - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#114 + # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#115 def correction_range(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#83 + # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#84 def method_returning_self?(method_name); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#107 + # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#108 def redundant_assignment?(node); end end @@ -50009,6 +50368,9 @@ RuboCop::Cop::Style::Send::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) 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_csend(node); end + # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#68 def on_send(node); end @@ -50016,13 +50378,13 @@ class RuboCop::Cop::Style::SendWithLiteralMethodName < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#90 + # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#91 def allow_send?; end - # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#94 + # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#95 def offense_range(node); end - # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#98 + # source://rubocop//lib/rubocop/cop/style/send_with_literal_method_name.rb#99 def removal_argument_range(first_argument, second_argument); end end @@ -50489,6 +50851,9 @@ class RuboCop::Cop::Style::SlicingWithRange < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#77 + def on_csend(node); end + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#77 def on_send(node); end @@ -50503,14 +50868,28 @@ class RuboCop::Cop::Style::SlicingWithRange < ::RuboCop::Cop::Base private - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#111 + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#140 + def arguments_source(node); end + + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#136 def beginless(range_node); end - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#107 + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#132 def endless(range_node); end - # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#93 - def offense_message_with_removal_range(range_node, selector); end + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#102 + def find_offense_range(node); end + + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#126 + def offense_message_for_partial_range(node, prefer, offense_range); end + + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#110 + def offense_message_with_removal_range(node, range_node, offense_range); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#98 + def unparenthesized_call?(node); end end # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#52 @@ -51441,6 +51820,10 @@ RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String) # `define_method`, therefore, `super` used within these blocks will be allowed. # This approach might result in false negatives, yet ensuring safe detection takes precedence. # +# NOTE: When forwarding the same arguments but replacing the block argument with a new inline +# block, it is not necessary to explicitly list the non-block arguments. As such, an offense +# will be registered in this case. +# # @example # # bad # def method(*args, **kwargs) @@ -51462,6 +51845,16 @@ RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String) # super() # end # +# # bad - forwarding with overridden block +# def method(*args, **kwargs, &block) +# super(*args, **kwargs) { do_something } +# end +# +# # good - implicitly passing all non-block arguments +# def method(*args, **kwargs, &block) +# super { do_something } +# 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, @@ -51470,69 +51863,85 @@ RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String) # super(&block) # end # -# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#54 +# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#68 class RuboCop::Cop::Style::SuperArguments < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#62 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#78 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 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#126 + def argument_list_size_differs?(def_args, super_args, super_node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#108 + def arguments_identical?(def_node, super_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 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#181 + def block_arg_same?(def_node, super_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 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#195 def block_reassigned?(def_node, block_arg_name); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#158 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#135 + def block_sends_to_super?(super_node, parent_node = T.unsafe(nil)); end + + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#96 + def find_def_node(super_node); end + + # @return [Boolean] + # + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#206 def forward_arg_same?(def_arg, super_arg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#116 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#161 def keyword_arg_same?(def_arg, super_arg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#126 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#171 def keyword_rest_arg_same?(def_arg, super_arg); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#99 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#144 def positional_arg_same?(def_arg, super_arg); end - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#106 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#151 def positional_rest_arg_same(def_arg, super_arg); end - # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#162 + # source://rubocop//lib/rubocop/cop/style/super_arguments.rb#210 def preprocess_super_args(super_args); end end -# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#58 +# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#72 RuboCop::Cop::Style::SuperArguments::ASSIGN_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#57 +# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#71 RuboCop::Cop::Style::SuperArguments::DEF_TYPES = T.let(T.unsafe(nil), Array) -# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#60 +# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#74 RuboCop::Cop::Style::SuperArguments::MSG = T.let(T.unsafe(nil), String) +# source://rubocop//lib/rubocop/cop/style/super_arguments.rb#75 +RuboCop::Cop::Style::SuperArguments::MSG_INLINE_BLOCK = 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. @@ -53488,77 +53897,83 @@ class RuboCop::Cop::Style::YodaCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#90 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#96 def file_constant_equal_program_name?(param0 = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#94 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#100 def on_send(node); end private - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#149 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#153 def actual_code_range(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#145 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#149 def constant_portion?(node); end - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#138 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#142 def corrected_code(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#107 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#113 def enforce_yoda?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#112 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#117 def equality_only?; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#173 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#177 def interpolation?(node); end - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#134 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#138 def message(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#157 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#161 def non_equality_operator?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#161 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#165 def noncommutative_operator?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#169 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#173 def program_name?(name); end - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#153 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#157 def reverse_comparison(operator); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#165 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#169 def source_file_path_constant?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#122 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#126 def valid_yoda?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#117 + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#121 def yoda_compatible_condition?(node); end end +# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#88 +RuboCop::Cop::Style::YodaCondition::ENFORCE_YODA_STYLES = T.let(T.unsafe(nil), Array) + +# source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#91 +RuboCop::Cop::Style::YodaCondition::EQUALITY_ONLY_STYLES = T.let(T.unsafe(nil), Array) + # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#84 RuboCop::Cop::Style::YodaCondition::EQUALITY_OPERATORS = T.let(T.unsafe(nil), Array) @@ -53620,23 +54035,23 @@ class RuboCop::Cop::Style::YodaExpression < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#73 + # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#74 def constant_portion?(node); end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#81 + # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#82 def offended_ancestor?(node); end - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#85 + # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#86 def offended_nodes; end - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#77 + # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#78 def supported_operators; end # @return [Boolean] # - # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#69 + # source://rubocop//lib/rubocop/cop/style/yoda_expression.rb#70 def yoda_expression_constant?(lhs, rhs); end end @@ -54227,7 +54642,7 @@ module RuboCop::Cop::Util # source://rubocop//lib/rubocop/cop/util.rb#22 def comment_lines?(node); end - # source://rubocop//lib/rubocop/cop/util.rb#198 + # source://rubocop//lib/rubocop/cop/util.rb#206 def compatible_external_encoding_for?(src); end # If converting a string to Ruby string literal source code, must @@ -54245,7 +54660,7 @@ module RuboCop::Cop::Util # source://rubocop//lib/rubocop/cop/util.rb#118 def first_part_of_call_chain(node); end - # source://rubocop//lib/rubocop/cop/util.rb#203 + # source://rubocop//lib/rubocop/cop/util.rb#210 def include_or_equal?(source, target); end # source://rubocop//lib/rubocop/cop/util.rb#185 @@ -54269,6 +54684,9 @@ module RuboCop::Cop::Util # source://rubocop//lib/rubocop/cop/util.rb#34 def parentheses?(node); end + # source://rubocop//lib/rubocop/cop/util.rb#196 + def parse_regexp(text); end + # source://rubocop//lib/rubocop/cop/util.rb#177 def same_line?(node1, node2); end @@ -54358,6 +54776,9 @@ module RuboCop::Cop::Util # source://rubocop//lib/rubocop/cop/util.rb#34 def parentheses?(node); end + # source://rubocop//lib/rubocop/cop/util.rb#196 + def parse_regexp(text); end + # @return [Boolean] # # source://rubocop//lib/rubocop/cop/util.rb#177 @@ -58329,29 +58750,29 @@ module RuboCop::PathUtil # Returns true for an absolute Unix or Windows path. # - # source://rubocop//lib/rubocop/path_util.rb#76 + # source://rubocop//lib/rubocop/path_util.rb#79 def absolute?(path); end # Returns true for a glob # - # source://rubocop//lib/rubocop/path_util.rb#81 + # source://rubocop//lib/rubocop/path_util.rb#84 def glob?(path); end - # source://rubocop//lib/rubocop/path_util.rb#111 + # source://rubocop//lib/rubocop/path_util.rb#114 def hidden_dir?(path); end - # source://rubocop//lib/rubocop/path_util.rb#94 + # source://rubocop//lib/rubocop/path_util.rb#97 def hidden_file?(path); end - # source://rubocop//lib/rubocop/path_util.rb#85 + # source://rubocop//lib/rubocop/path_util.rb#88 def hidden_file_in_not_hidden_dir?(pattern, path); end - # source://rubocop//lib/rubocop/path_util.rb#48 + # source://rubocop//lib/rubocop/path_util.rb#51 def match_path?(pattern, path); end # Loose check to reduce memory allocations # - # source://rubocop//lib/rubocop/path_util.rb#101 + # source://rubocop//lib/rubocop/path_util.rb#104 def maybe_hidden_file?(path); end # source://rubocop//lib/rubocop/path_util.rb#13 @@ -58365,41 +58786,41 @@ module RuboCop::PathUtil # # @return [Boolean] # - # source://rubocop//lib/rubocop/path_util.rb#76 + # source://rubocop//lib/rubocop/path_util.rb#79 def absolute?(path); end # Returns true for a glob # # @return [Boolean] # - # source://rubocop//lib/rubocop/path_util.rb#81 + # source://rubocop//lib/rubocop/path_util.rb#84 def glob?(path); end # @return [Boolean] # - # source://rubocop//lib/rubocop/path_util.rb#111 + # source://rubocop//lib/rubocop/path_util.rb#114 def hidden_dir?(path); end # @return [Boolean] # - # source://rubocop//lib/rubocop/path_util.rb#94 + # source://rubocop//lib/rubocop/path_util.rb#97 def hidden_file?(path); end # @return [Boolean] # - # source://rubocop//lib/rubocop/path_util.rb#85 + # source://rubocop//lib/rubocop/path_util.rb#88 def hidden_file_in_not_hidden_dir?(pattern, path); end # @return [Boolean] # - # source://rubocop//lib/rubocop/path_util.rb#48 + # source://rubocop//lib/rubocop/path_util.rb#51 def match_path?(pattern, path); end # Loose check to reduce memory allocations # # @return [Boolean] # - # source://rubocop//lib/rubocop/path_util.rb#101 + # source://rubocop//lib/rubocop/path_util.rb#104 def maybe_hidden_file?(path); end # source://rubocop//lib/rubocop/path_util.rb#13 @@ -58422,7 +58843,7 @@ module RuboCop::PathUtil end end -# source://rubocop//lib/rubocop/path_util.rb#98 +# source://rubocop//lib/rubocop/path_util.rb#101 RuboCop::PathUtil::HIDDEN_FILE_PATTERN = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/path_util.rb#31 @@ -58955,24 +59376,24 @@ RuboCop::ResultCache::NON_CHANGING = T.let(T.unsafe(nil), Array) class RuboCop::Runner # @return [Runner] a new instance of Runner # - # source://rubocop//lib/rubocop/runner.rb#63 + # source://rubocop//lib/rubocop/runner.rb#59 def initialize(options, config_store); end # Sets the attribute aborting # # @param value the value to set the attribute aborting to. # - # source://rubocop//lib/rubocop/runner.rb#61 + # source://rubocop//lib/rubocop/runner.rb#57 def aborting=(_arg0); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#87 + # source://rubocop//lib/rubocop/runner.rb#83 def aborting?; end # Returns the value of attribute errors. # - # source://rubocop//lib/rubocop/runner.rb#60 + # source://rubocop//lib/rubocop/runner.rb#56 def errors; end # source://rubocop-md/1.2.4/lib/rubocop/markdown/rubocop_ext.rb#63 @@ -58984,121 +59405,121 @@ class RuboCop::Runner # source://rubocop-md/1.2.4/lib/rubocop/markdown/rubocop_ext.rb#49 def get_processed_source(*args); end - # source://rubocop//lib/rubocop/runner.rb#71 + # source://rubocop//lib/rubocop/runner.rb#67 def run(paths); end # Returns the value of attribute warnings. # - # source://rubocop//lib/rubocop/runner.rb#60 + # source://rubocop//lib/rubocop/runner.rb#56 def warnings; end private - # source://rubocop//lib/rubocop/runner.rb#200 + # source://rubocop//lib/rubocop/runner.rb#199 def add_redundant_disables(file, offenses, source); end - # source://rubocop//lib/rubocop/runner.rb#174 + # source://rubocop//lib/rubocop/runner.rb#173 def cached_result(file, team); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#254 + # source://rubocop//lib/rubocop/runner.rb#253 def cached_run?; end # Check whether a run created source identical to a previous run, which # means that we definitely have an infinite loop. # - # source://rubocop//lib/rubocop/runner.rb#332 + # source://rubocop//lib/rubocop/runner.rb#331 def check_for_infinite_loop(processed_source, offenses_by_iteration); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#226 + # source://rubocop//lib/rubocop/runner.rb#225 def check_for_redundant_disables?(source); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#434 + # source://rubocop//lib/rubocop/runner.rb#433 def considered_failure?(offense); end - # source://rubocop//lib/rubocop/runner.rb#471 + # source://rubocop//lib/rubocop/runner.rb#470 def default_config(cop_name); end - # source://rubocop//lib/rubocop/runner.rb#276 + # source://rubocop//lib/rubocop/runner.rb#275 def do_inspection_loop(file); end - # source://rubocop//lib/rubocop/runner.rb#137 + # source://rubocop//lib/rubocop/runner.rb#133 def each_inspected_file(files); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#240 + # source://rubocop//lib/rubocop/runner.rb#239 def except_redundant_cop_disable_directive?; end - # source://rubocop//lib/rubocop/runner.rb#361 + # source://rubocop//lib/rubocop/runner.rb#360 def extract_ruby_sources(processed_source); end - # source://rubocop//lib/rubocop/runner.rb#166 + # source://rubocop//lib/rubocop/runner.rb#165 def file_offenses(file); end - # source://rubocop//lib/rubocop/runner.rb#244 + # source://rubocop//lib/rubocop/runner.rb#243 def file_started(file); end - # source://rubocop//lib/rubocop/runner.rb#414 + # source://rubocop//lib/rubocop/runner.rb#413 def filter_cop_classes(cop_classes, config); end - # source://rubocop//lib/rubocop/runner.rb#108 + # source://rubocop//lib/rubocop/runner.rb#104 def find_target_files(paths); end - # source://rubocop//lib/rubocop/runner.rb#425 + # source://rubocop//lib/rubocop/runner.rb#424 def formatter_set; end - # source://rubocop//lib/rubocop/runner.rb#346 + # source://rubocop//lib/rubocop/runner.rb#345 def inspect_file(processed_source, team = T.unsafe(nil)); end - # source://rubocop//lib/rubocop/runner.rb#119 + # source://rubocop//lib/rubocop/runner.rb#115 def inspect_files(files); end - # source://rubocop//lib/rubocop/runner.rb#307 + # source://rubocop//lib/rubocop/runner.rb#306 def iterate_until_no_changes(source, offenses_by_iteration); end - # source://rubocop//lib/rubocop/runner.rb#152 + # source://rubocop//lib/rubocop/runner.rb#148 def list_files(paths); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#467 + # source://rubocop//lib/rubocop/runner.rb#466 def mark_as_safe_by_config?(config); end - # source://rubocop//lib/rubocop/runner.rb#475 + # source://rubocop//lib/rubocop/runner.rb#474 def minimum_severity_to_fail; end - # source://rubocop//lib/rubocop/runner.rb#375 + # source://rubocop//lib/rubocop/runner.rb#374 def mobilize_team(processed_source); end - # source://rubocop//lib/rubocop/runner.rb#380 + # source://rubocop//lib/rubocop/runner.rb#379 def mobilized_cop_classes(config); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#443 + # source://rubocop//lib/rubocop/runner.rb#442 def offense_displayed?(offense); end - # source://rubocop//lib/rubocop/runner.rb#455 + # source://rubocop//lib/rubocop/runner.rb#454 def offenses_to_report(offenses); end - # source://rubocop//lib/rubocop/runner.rb#156 + # source://rubocop//lib/rubocop/runner.rb#152 def process_file(file); end - # source://rubocop//lib/rubocop/runner.rb#404 + # source://rubocop//lib/rubocop/runner.rb#403 def qualify_option_cop_names; end # @yield [cop] # - # source://rubocop//lib/rubocop/runner.rb#232 + # source://rubocop//lib/rubocop/runner.rb#231 def redundant_cop_disable_directive(file); end - # source://rubocop//lib/rubocop/runner.rb#266 + # source://rubocop//lib/rubocop/runner.rb#265 def save_in_cache(cache, offenses); end # A Cop::Team instance is stateful and may change when inspecting. @@ -59106,41 +59527,41 @@ class RuboCop::Runner # otherwise dormant team that can be used for config- and option- # level caching in ResultCache. # - # source://rubocop//lib/rubocop/runner.rb#514 + # source://rubocop//lib/rubocop/runner.rb#513 def standby_team(config); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#421 + # source://rubocop//lib/rubocop/runner.rb#420 def style_guide_cops_only?(config); end # @return [Boolean] # - # source://rubocop//lib/rubocop/runner.rb#459 + # source://rubocop//lib/rubocop/runner.rb#458 def supports_safe_autocorrect?(offense); end # @yield [team] # - # source://rubocop//lib/rubocop/runner.rb#215 + # source://rubocop//lib/rubocop/runner.rb#214 def team_for_redundant_disables(file, offenses, source); end # Warms up the RuboCop cache by forking a suitable number of RuboCop # instances that each inspects its allotted group of files. # - # source://rubocop//lib/rubocop/runner.rb#95 + # source://rubocop//lib/rubocop/runner.rb#91 def warm_cache(target_files); end class << self # @return [Array<#call>] # - # source://rubocop//lib/rubocop/runner.rb#33 + # source://rubocop//lib/rubocop/runner.rb#29 def ruby_extractors; end private # @return [#call] # - # source://rubocop//lib/rubocop/runner.rb#40 + # source://rubocop//lib/rubocop/runner.rb#36 def default_ruby_extractor; end end end @@ -59163,12 +59584,12 @@ end # @api private # -# source://rubocop//lib/rubocop/runner.rb#53 +# source://rubocop//lib/rubocop/runner.rb#49 RuboCop::Runner::MAX_ITERATIONS = T.let(T.unsafe(nil), Integer) # @api private # -# source://rubocop//lib/rubocop/runner.rb#56 +# source://rubocop//lib/rubocop/runner.rb#52 RuboCop::Runner::REDUNDANT_COP_DISABLE_DIRECTIVE_RULES = T.let(T.unsafe(nil), Array) # Take a string with embedded escapes, and convert the escapes as the Ruby @@ -59388,34 +59809,34 @@ class RuboCop::TargetRuby # @api private # @return [TargetRuby] a new instance of TargetRuby # - # source://rubocop//lib/rubocop/target_ruby.rb#258 + # source://rubocop//lib/rubocop/target_ruby.rb#273 def initialize(config); end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#274 + # source://rubocop//lib/rubocop/target_ruby.rb#289 def rubocop_version_with_support; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#262 + # source://rubocop//lib/rubocop/target_ruby.rb#277 def source; end # @api private # @return [Boolean] # - # source://rubocop//lib/rubocop/target_ruby.rb#270 + # source://rubocop//lib/rubocop/target_ruby.rb#285 def supported?; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#266 + # source://rubocop//lib/rubocop/target_ruby.rb#281 def version; end class << self # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#244 + # source://rubocop//lib/rubocop/target_ruby.rb#258 def supported_versions; end end end @@ -59424,23 +59845,23 @@ end # # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#191 +# source://rubocop//lib/rubocop/target_ruby.rb#205 class RuboCop::TargetRuby::BundlerLockFile < ::RuboCop::TargetRuby::Source # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#192 + # source://rubocop//lib/rubocop/target_ruby.rb#206 def name; end private # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#225 + # source://rubocop//lib/rubocop/target_ruby.rb#239 def bundler_lock_file_path; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#198 + # source://rubocop//lib/rubocop/target_ruby.rb#212 def find_version; end end @@ -59453,18 +59874,18 @@ RuboCop::TargetRuby::DEFAULT_VERSION = T.let(T.unsafe(nil), Float) # # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#232 +# source://rubocop//lib/rubocop/target_ruby.rb#246 class RuboCop::TargetRuby::Default < ::RuboCop::TargetRuby::Source # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#233 + # source://rubocop//lib/rubocop/target_ruby.rb#247 def name; end private # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#239 + # source://rubocop//lib/rubocop/target_ruby.rb#253 def find_version; end end @@ -59472,51 +59893,51 @@ end # # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#53 +# source://rubocop//lib/rubocop/target_ruby.rb#67 class RuboCop::TargetRuby::GemspecFile < ::RuboCop::TargetRuby::Source extend ::RuboCop::AST::NodePattern::Macros - # source://rubocop//lib/rubocop/target_ruby.rb#62 + # source://rubocop//lib/rubocop/target_ruby.rb#76 def gem_requirement_versions(param0 = T.unsafe(nil)); end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#68 + # source://rubocop//lib/rubocop/target_ruby.rb#82 def name; end - # source://rubocop//lib/rubocop/target_ruby.rb#57 + # source://rubocop//lib/rubocop/target_ruby.rb#71 def required_ruby_version(param0); end private # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#123 + # source://rubocop//lib/rubocop/target_ruby.rb#137 def find_minimal_known_ruby(right_hand_side); end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#74 + # source://rubocop//lib/rubocop/target_ruby.rb#88 def find_version; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#84 + # source://rubocop//lib/rubocop/target_ruby.rb#98 def gemspec_filepath; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#119 + # source://rubocop//lib/rubocop/target_ruby.rb#133 def version_from_array(array); end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#98 + # source://rubocop//lib/rubocop/target_ruby.rb#112 def version_from_gemspec_file(file); end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#107 + # source://rubocop//lib/rubocop/target_ruby.rb#121 def version_from_right_hand_side(right_hand_side); end end @@ -59534,8 +59955,28 @@ RuboCop::TargetRuby::OBSOLETE_RUBIES = T.let(T.unsafe(nil), Hash) # # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#39 +# source://rubocop//lib/rubocop/target_ruby.rb#53 class RuboCop::TargetRuby::RuboCopConfig < ::RuboCop::TargetRuby::Source + # @api private + # + # source://rubocop//lib/rubocop/target_ruby.rb#54 + def name; end + + private + + # @api private + # + # source://rubocop//lib/rubocop/target_ruby.rb#60 + def find_version; end +end + +# The target ruby version may be configured by setting the +# `RUBOCOP_TARGET_RUBY_VERSION` environment variable. +# +# @api private +# +# source://rubocop//lib/rubocop/target_ruby.rb#39 +class RuboCop::TargetRuby::RuboCopEnvVar < ::RuboCop::TargetRuby::Source # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#40 @@ -59553,49 +59994,49 @@ end # # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#137 +# source://rubocop//lib/rubocop/target_ruby.rb#151 class RuboCop::TargetRuby::RubyVersionFile < ::RuboCop::TargetRuby::Source # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#141 + # source://rubocop//lib/rubocop/target_ruby.rb#155 def name; end private # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#147 + # source://rubocop//lib/rubocop/target_ruby.rb#161 def filename; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#155 + # source://rubocop//lib/rubocop/target_ruby.rb#169 def find_version; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#151 + # source://rubocop//lib/rubocop/target_ruby.rb#165 def pattern; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#162 + # source://rubocop//lib/rubocop/target_ruby.rb#176 def version_file; end end # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#138 +# source://rubocop//lib/rubocop/target_ruby.rb#152 RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_FILENAME = T.let(T.unsafe(nil), String) # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#139 +# source://rubocop//lib/rubocop/target_ruby.rb#153 RuboCop::TargetRuby::RubyVersionFile::RUBY_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp) # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#248 +# source://rubocop//lib/rubocop/target_ruby.rb#262 RuboCop::TargetRuby::SOURCES = T.let(T.unsafe(nil), Array) # A place where information about a target ruby version is found. @@ -59631,34 +60072,34 @@ end # # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#170 +# source://rubocop//lib/rubocop/target_ruby.rb#184 class RuboCop::TargetRuby::ToolVersionsFile < ::RuboCop::TargetRuby::RubyVersionFile # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#174 + # source://rubocop//lib/rubocop/target_ruby.rb#188 def name; end private # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#180 + # source://rubocop//lib/rubocop/target_ruby.rb#194 def filename; end # @api private # - # source://rubocop//lib/rubocop/target_ruby.rb#184 + # source://rubocop//lib/rubocop/target_ruby.rb#198 def pattern; end end # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#171 +# source://rubocop//lib/rubocop/target_ruby.rb#185 RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_FILENAME = T.let(T.unsafe(nil), String) # @api private # -# source://rubocop//lib/rubocop/target_ruby.rb#172 +# source://rubocop//lib/rubocop/target_ruby.rb#186 RuboCop::TargetRuby::ToolVersionsFile::TOOL_VERSIONS_PATTERN = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/ast_aliases.rb#7