From 311b268340075c3077e2cc69c335f6b12034dff7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:59:59 +0000 Subject: [PATCH 1/4] build(deps-dev): bump rubocop-performance in /Library/Homebrew Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.19.1 to 1.20.0. - [Release notes](https://github.com/rubocop/rubocop-performance/releases) - [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.19.1...v1.20.0) --- updated-dependencies: - dependency-name: rubocop-performance dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Library/Homebrew/Gemfile.lock | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 0c83e4de27ee1..707d9dce0a7d2 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -113,9 +113,9 @@ GEM rubocop (~> 1.41) rubocop-factory_bot (2.24.0) rubocop (~> 1.33) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + rubocop-performance (1.20.0) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) rubocop-rails (2.23.0) activesupport (>= 4.2.0) rack (>= 1.1) @@ -181,7 +181,6 @@ GEM zeitwerk (2.6.12) PLATFORMS - aarch64-linux arm-linux arm64-darwin x86_64-darwin From 5c01bc34d37a5c0fe3a82c36cc57b973b3fcd996 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:03:04 +0000 Subject: [PATCH 2/4] brew vendor-gems: commit updates. --- Library/Homebrew/Gemfile.lock | 1 + Library/Homebrew/vendor/bundle/bundler/setup.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 707d9dce0a7d2..cb7f2ae847be2 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -181,6 +181,7 @@ GEM zeitwerk (2.6.12) PLATFORMS + aarch64-linux arm-linux arm64-darwin x86_64-darwin diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index fe58db0ac9884..71d9143bc4642 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -101,7 +101,7 @@ def self.extension_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.59.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-capybara-2.19.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-factory_bot-2.24.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.19.1/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.20.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rails-2.23.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-2.25.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.7.6/lib") From f04d777c856be8ed9a787e4c8888f6101fe24efd Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:09:12 +0000 Subject: [PATCH 3/4] Update RBI files for rubocop-performance. Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow. --- ...9.1.rbi => rubocop-performance@1.20.0.rbi} | 178 ++++++++++-------- .../sorbet/rbi/hidden-definitions/hidden.rbi | 1 + 2 files changed, 104 insertions(+), 75 deletions(-) rename Library/Homebrew/sorbet/rbi/gems/{rubocop-performance@1.19.1.rbi => rubocop-performance@1.20.0.rbi} (98%) diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.19.1.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.20.0.rbi similarity index 98% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.19.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.20.0.rbi index 36039351b91f3..697c41d0b5ed3 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.19.1.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.20.0.rbi @@ -785,15 +785,18 @@ RuboCop::Cop::Performance::ConstantRegexp::MSG = T.let(T.unsafe(nil), String) # Model.select('field AS field_one').count # Model.select(:value).count # -# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#49 +# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#48 class RuboCop::Cop::Performance::Count < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector - # source://rubocop-performance//lib/rubocop/cop/performance/count.rb#56 + # source://rubocop-performance//lib/rubocop/cop/performance/count.rb#55 def count_candidate?(param0 = T.unsafe(nil)); end - # source://rubocop-performance//lib/rubocop/cop/performance/count.rb#63 + # source://rubocop-performance//lib/rubocop/cop/performance/count.rb#62 + def on_csend(node); end + + # source://rubocop-performance//lib/rubocop/cop/performance/count.rb#62 def on_send(node); end private @@ -825,10 +828,10 @@ class RuboCop::Cop::Performance::Count < ::RuboCop::Cop::Base def source_starting_at(node); end end -# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#53 +# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#52 RuboCop::Cop::Performance::Count::MSG = T.let(T.unsafe(nil), String) -# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#54 +# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#53 RuboCop::Cop::Performance::Count::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # In Ruby 2.5, `String#delete_prefix` has been added. @@ -1211,6 +1214,9 @@ class RuboCop::Cop::Performance::FixedSize < ::RuboCop::Cop::Base # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#52 def counter(param0 = T.unsafe(nil)); end + # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#56 + def on_csend(node); end + # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#56 def on_send(node); end @@ -1218,32 +1224,32 @@ class RuboCop::Cop::Performance::FixedSize < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#72 + # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#73 def allowed_argument?(arg); end # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#76 + # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#77 def allowed_parent?(node); end # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#68 + # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#69 def allowed_variable?(var); end # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#86 + # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#87 def contains_double_splat?(node); end # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#80 + # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#81 def contains_splat?(node); end # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#92 + # source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#93 def non_string_argument?(node); end end @@ -1274,21 +1280,24 @@ class RuboCop::Cop::Performance::FlatMap < ::RuboCop::Cop::Base # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#28 def flat_map_candidate?(param0 = T.unsafe(nil)); end + # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#39 + def on_csend(node); end + # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#39 def on_send(node); end private - # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#72 + # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#73 def autocorrect(corrector, node); end - # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#52 + # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#53 def offense_for_levels(node, map_node, first_method, flatten); end - # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#58 + # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#59 def offense_for_method(node, map_node, first_method, flatten); end - # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#62 + # source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#63 def register_offense(node, map_node, first_method, flatten, message); end end @@ -1547,7 +1556,7 @@ class RuboCop::Cop::Performance::MapMethodChain < ::RuboCop::Cop::Base private - # source://rubocop-performance//lib/rubocop/cop/performance/map_method_chain.rb#71 + # source://rubocop-performance//lib/rubocop/cop/performance/map_method_chain.rb#72 def find_begin_of_chained_map_method(node, map_args); end end @@ -1639,6 +1648,9 @@ RuboCop::Cop::Performance::OpenStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), A class RuboCop::Cop::Performance::RangeInclude < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector + # source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#44 + def on_csend(node); end + # source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#44 def on_send(node); end @@ -1938,10 +1950,10 @@ class RuboCop::Cop::Performance::RedundantMerge < ::RuboCop::Cop::Base # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#98 def kwsplat_used?(pairs); end - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#144 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#146 def leading_spaces(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#148 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#150 def max_key_value_pairs; end # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#71 @@ -1975,44 +1987,44 @@ RuboCop::Cop::Performance::RedundantMerge::AREF_ASGN = T.let(T.unsafe(nil), Stri # A utility class for checking the use of values within an # `each_with_object` call. # -# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#154 +# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#156 class RuboCop::Cop::Performance::RedundantMerge::EachWithObjectInspector extend ::RuboCop::AST::NodePattern::Macros # @return [EachWithObjectInspector] a new instance of EachWithObjectInspector # - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#157 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#159 def initialize(node, receiver); end - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#188 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#190 def each_with_object_node(param0 = T.unsafe(nil)); end # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#162 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#164 def value_used?; end private # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#172 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#174 def eligible_receiver?; end # Returns the value of attribute node. # - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#170 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#172 def node; end # Returns the value of attribute receiver. # - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#170 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#172 def receiver; end - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#176 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#178 def second_argument; end - # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#183 + # source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#185 def unwind(receiver); end end @@ -2434,14 +2446,11 @@ class RuboCop::Cop::Performance::ReverseFirst < ::RuboCop::Cop::Base private - # source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#64 - def build_bad_method(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#56 def build_good_method(node); end # source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#50 - def build_message(node); end + def build_message(node, range); end # source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#46 def correction_range(receiver, node); end @@ -2471,20 +2480,17 @@ class RuboCop::Cop::Performance::SelectMap < ::RuboCop::Cop::Base extend ::RuboCop::Cop::TargetRubyVersion # source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#27 - def bad_method?(param0 = T.unsafe(nil)); end - - # source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#31 def on_csend(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#31 + # source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#27 def on_send(node); end private - # source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#45 + # source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#41 def map_method_candidate(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#55 + # source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#51 def offense_range(node, map_method); end end @@ -2540,6 +2546,9 @@ class RuboCop::Cop::Performance::Size < ::RuboCop::Cop::Base # source://rubocop-performance//lib/rubocop/cop/performance/size.rb#52 def hash?(param0 = T.unsafe(nil)); end + # source://rubocop-performance//lib/rubocop/cop/performance/size.rb#65 + def on_csend(node); end + # source://rubocop-performance//lib/rubocop/cop/performance/size.rb#65 def on_send(node); end end @@ -2699,31 +2708,38 @@ RuboCop::Cop::Performance::StartWith::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Ar # send('do_something') # attr_accessor 'do_something' # instance_variable_get('@ivar') +# const_get("string_#{interpolation}") # # # good # send(:do_something) # attr_accessor :do_something # instance_variable_get(:@ivar) +# const_get(:"string_#{interpolation}") # -# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#25 +# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#27 class RuboCop::Cop::Performance::StringIdentifierArgument < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#48 + # source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#51 def on_send(node); end + + private + + # source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#71 + def argument_replacement(node, value); end end -# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#30 +# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#32 RuboCop::Cop::Performance::StringIdentifierArgument::COMMAND_METHODS = T.let(T.unsafe(nil), Array) -# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#28 +# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#30 RuboCop::Cop::Performance::StringIdentifierArgument::MSG = T.let(T.unsafe(nil), String) # NOTE: `attr` method is not included in this list as it can cause false positives in Nokogiri API. # And `attr` may not be used because `Style/Attr` registers an offense. # https://github.com/rubocop/rubocop-performance/issues/278 # -# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#38 +# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#40 RuboCop::Cop::Performance::StringIdentifierArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Identifies unnecessary use of a regex where `String#include?` would suffice. @@ -2736,38 +2752,39 @@ RuboCop::Cop::Performance::StringIdentifierArgument::RESTRICT_ON_SEND = T.let(T. # /ab/ =~ str # str.match(/ab/) # /ab/.match(str) +# /ab/ === str # # # good # str.include?('ab') # -# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#22 +# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#23 class RuboCop::Cop::Performance::StringInclude < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#35 + # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#36 def on_csend(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#35 + # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#36 def on_match_with_lvasgn(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#35 + # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#36 def on_send(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#28 + # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#29 def redundant_regex?(param0 = T.unsafe(nil)); end private # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#57 + # source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#58 def literal?(regex_str); end end -# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#25 +# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#26 RuboCop::Cop::Performance::StringInclude::MSG = T.let(T.unsafe(nil), String) -# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#26 +# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#27 RuboCop::Cop::Performance::StringInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Identifies places where `gsub` can be replaced by `tr` or `delete`. @@ -2903,9 +2920,12 @@ class RuboCop::Cop::Performance::Sum < ::RuboCop::Cop::Base # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#102 def elem_plus_acc?(param0 = T.unsafe(nil), param1, param2); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#114 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#115 def on_block(node); end + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#107 + def on_csend(node); end + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#107 def on_send(node); end @@ -2922,54 +2942,54 @@ class RuboCop::Cop::Performance::Sum < ::RuboCop::Cop::Base # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#159 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#160 def array_literal?(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#164 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#165 def autocorrect(corrector, init, range); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#172 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#173 def autocorrect_sum_map(corrector, sum, map, init); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#248 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#250 def build_block_bad_method(method, init, var_acc, var_elem, body); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#215 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#217 def build_block_message(send, init, var_acc, var_elem, body); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#221 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#223 def build_good_method(init, block_pass = T.unsafe(nil)); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#234 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#236 def build_method_bad_method(init, method, operation); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#197 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#198 def build_method_message(node, method, init, operation); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#208 - def build_sum_map_message(method, init); end + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#209 + def build_sum_map_message(send_node, init); end # @return [Boolean] # - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#154 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#155 def empty_array_literal?(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#129 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#130 def handle_sum_candidate(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#142 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#143 def handle_sum_map_candidate(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#259 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#261 def method_call_with_args_range(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#193 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#194 def sum_block_range(send, node); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#189 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#190 def sum_map_range(map, sum); end - # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#185 + # source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#186 def sum_method_range(node); end end @@ -3001,24 +3021,32 @@ RuboCop::Cop::Performance::Sum::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Performance::TimesMap < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector - # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#43 + # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#44 def on_block(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#43 + # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#39 + def on_csend(node); end + + # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#44 def on_numblock(node); end # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#39 def on_send(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#69 + # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#79 def times_map_call(param0 = T.unsafe(nil)); end private - # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#50 + # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#51 def check(node); end - # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#60 + # @return [Boolean] + # + # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#63 + def handleable_receiver?(node); end + + # source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#70 def message(map_or_collect, count); end end @@ -3037,8 +3065,8 @@ RuboCop::Cop::Performance::TimesMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr # # @example # # bad -# ''.dup -# "something".dup +# ''.dup # when Ruby 3.2 or lower +# "something".dup # when Ruby 3.2 or lower # String.new # String.new('') # String.new('something') diff --git a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi index cdd2943ab347a..fa19717524341 100644 --- a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi +++ b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi @@ -8961,6 +8961,7 @@ module RuboCop::AST::NodePattern::Sets SET_HTML_HTML5 = ::T.let(nil, ::T.untyped) SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped) SET_MAC_LINUX = ::T.let(nil, ::T.untyped) + SET_MATCH_MATCH_ = ::T.let(nil, ::T.untyped) SET_ON_ARM_ON_INTEL_ON_SONOMA_ETC = ::T.let(nil, ::T.untyped) SET_ON_INTEL_ON_ARM = ::T.let(nil, ::T.untyped) SET_OR_NEWER_OR_OLDER = ::T.let(nil, ::T.untyped) From 9dee80cb2daf2a6299195a50156718386d24512b Mon Sep 17 00:00:00 2001 From: Patrick Linnane Date: Mon, 18 Dec 2023 09:34:01 -0800 Subject: [PATCH 4/4] various: fix style errors --- Library/Homebrew/brew.rb | 2 +- Library/Homebrew/cask/artifact/abstract_uninstall.rb | 2 +- Library/Homebrew/cask/dsl.rb | 10 +++++----- Library/Homebrew/compilers.rb | 2 +- Library/Homebrew/extend/on_system.rb | 8 ++++---- Library/Homebrew/extend/os/linux/hardware/cpu.rb | 2 +- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/locale.rb | 2 +- Library/Homebrew/tab.rb | 2 +- Library/Homebrew/test/github_runner_spec.rb | 2 +- Library/Homebrew/test/linux_runner_spec_spec.rb | 2 +- Library/Homebrew/test/macos_runner_spec_spec.rb | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index c5e5bf5b13204..78b51cb55ce84 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -89,7 +89,7 @@ exit Homebrew.failed? ? 1 : 0 elsif Commands.external_cmd_path(cmd) %w[CACHE LIBRARY_PATH].each do |env| - ENV["HOMEBREW_#{env}"] = Object.const_get("HOMEBREW_#{env}").to_s + ENV["HOMEBREW_#{env}"] = Object.const_get(:"HOMEBREW_#{env}").to_s end exec "brew-#{cmd}", *ARGV else diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 78547326b5d80..efc63b5f1e9e2 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -72,7 +72,7 @@ def dispatch_uninstall_directive(directive_sym, **options) args = directives[directive_sym] - send("uninstall_#{directive_sym}", *(args.is_a?(Hash) ? [args] : args), **options) + send(:"uninstall_#{directive_sym}", *(args.is_a?(Hash) ? [args] : args), **options) end def stanza diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index e6c31b8ec3c26..978251abb399d 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -127,20 +127,20 @@ def desc(description = nil) end def set_unique_stanza(stanza, should_return) - return instance_variable_get("@#{stanza}") if should_return + return instance_variable_get(:"@#{stanza}") if should_return unless @cask.allow_reassignment - if instance_variable_defined?("@#{stanza}") && !@called_in_on_system_block + if instance_variable_defined?(:"@#{stanza}") && !@called_in_on_system_block raise CaskInvalidError.new(cask, "'#{stanza}' stanza may only appear once.") end - if instance_variable_defined?("@#{stanza}_set_in_block") && @called_in_on_system_block + if instance_variable_defined?(:"@#{stanza}_set_in_block") && @called_in_on_system_block raise CaskInvalidError.new(cask, "'#{stanza}' stanza may only be overridden once.") end end - instance_variable_set("@#{stanza}_set_in_block", true) if @called_in_on_system_block - instance_variable_set("@#{stanza}", yield) + instance_variable_set(:"@#{stanza}_set_in_block", true) if @called_in_on_system_block + instance_variable_set(:"@#{stanza}", yield) rescue CaskInvalidError raise rescue => e diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 12ac6cdb2243f..bd49263dd8dea 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -173,7 +173,7 @@ def compiler_version(name) when "gcc", GNU_GCC_REGEXP versions.gcc_version(name.to_s) else - versions.send("#{name}_build_version") + versions.send(:"#{name}_build_version") end end end diff --git a/Library/Homebrew/extend/on_system.rb b/Library/Homebrew/extend/on_system.rb index 6ebeef7ab86e4..5df367ac844c5 100644 --- a/Library/Homebrew/extend/on_system.rb +++ b/Library/Homebrew/extend/on_system.rb @@ -18,7 +18,7 @@ def self.arch_condition_met?(arch) sig { params(os_name: Symbol, or_condition: T.nilable(Symbol)).returns(T::Boolean) } def self.os_condition_met?(os_name, or_condition = nil) - return Homebrew::SimulateSystem.send("simulating_or_running_on_#{os_name}?") if BASE_OS_OPTIONS.include?(os_name) + return Homebrew::SimulateSystem.send(:"simulating_or_running_on_#{os_name}?") if BASE_OS_OPTIONS.include?(os_name) raise ArgumentError, "Invalid OS condition: #{os_name.inspect}" unless MacOSVersion::SYMBOLS.key?(os_name) @@ -51,7 +51,7 @@ def self.condition_from_method_name(method_name) sig { params(base: Class).void } def self.setup_arch_methods(base) ARCH_OPTIONS.each do |arch| - base.define_method("on_#{arch}") do |&block| + base.define_method(:"on_#{arch}") do |&block| @on_system_blocks_exist = true return unless OnSystem.arch_condition_met? OnSystem.condition_from_method_name(T.must(__method__)) @@ -78,7 +78,7 @@ def self.setup_arch_methods(base) sig { params(base: Class).void } def self.setup_base_os_methods(base) BASE_OS_OPTIONS.each do |base_os| - base.define_method("on_#{base_os}") do |&block| + base.define_method(:"on_#{base_os}") do |&block| @on_system_blocks_exist = true return unless OnSystem.os_condition_met? OnSystem.condition_from_method_name(T.must(__method__)) @@ -124,7 +124,7 @@ def self.setup_base_os_methods(base) sig { params(base: Class).void } def self.setup_macos_methods(base) MacOSVersion::SYMBOLS.each_key do |os_name| - base.define_method("on_#{os_name}") do |or_condition = nil, &block| + base.define_method(:"on_#{os_name}") do |or_condition = nil, &block| @on_system_blocks_exist = true os_condition = OnSystem.condition_from_method_name T.must(__method__) diff --git a/Library/Homebrew/extend/os/linux/hardware/cpu.rb b/Library/Homebrew/extend/os/linux/hardware/cpu.rb index 12762704bcbed..1ae24e1d73cb3 100644 --- a/Library/Homebrew/extend/os/linux/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/linux/hardware/cpu.rb @@ -111,7 +111,7 @@ def features end %w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag| - define_method("#{flag}?") do + define_method(:"#{flag}?") do T.bind(self, T.class_of(Hardware::CPU)) flags.include? flag end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index cdae57e8b8503..ac99e16df6462 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -295,7 +295,7 @@ def spec_eval(name) spec.owner = self add_global_deps_to_spec(spec) - instance_variable_set("@#{name}", spec) + instance_variable_set(:"@#{name}", spec) end sig { params(spec: SoftwareSpec).void } diff --git a/Library/Homebrew/locale.rb b/Library/Homebrew/locale.rb index 7979f1fc3dc53..2f2863a7b6a56 100644 --- a/Library/Homebrew/locale.rb +++ b/Library/Homebrew/locale.rb @@ -69,7 +69,7 @@ def initialize(language, script, region) }.each do |key, value| next if value.nil? - regex = self.class.const_get("#{key.upcase}_REGEX") + regex = self.class.const_get(:"#{key.upcase}_REGEX") raise ParserError, "'#{value}' does not match #{regex}" unless value&.match?(regex) instance_variable_set(:"@#{key}", value) diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 4070738df6faf..d38503bde7da5 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -234,7 +234,7 @@ def self.runtime_deps_hash(formula, deps) end def initialize(attributes = {}) - attributes.each { |key, value| instance_variable_set("@#{key}", value) } + attributes.each { |key, value| instance_variable_set(:"@#{key}", value) } end def any_args_or_options? diff --git a/Library/Homebrew/test/github_runner_spec.rb b/Library/Homebrew/test/github_runner_spec.rb index bcbadf07bc6b5..7859b0325b1e4 100644 --- a/Library/Homebrew/test/github_runner_spec.rb +++ b/Library/Homebrew/test/github_runner_spec.rb @@ -11,7 +11,7 @@ it "has immutable attributes" do [:platform, :arch, :spec, :macos_version].each do |attribute| - expect(runner.respond_to?("#{attribute}=")).to be(false) + expect(runner.respond_to?(:"#{attribute}=")).to be(false) end end diff --git a/Library/Homebrew/test/linux_runner_spec_spec.rb b/Library/Homebrew/test/linux_runner_spec_spec.rb index 1c63d6361530c..010b550790a5f 100644 --- a/Library/Homebrew/test/linux_runner_spec_spec.rb +++ b/Library/Homebrew/test/linux_runner_spec_spec.rb @@ -16,7 +16,7 @@ it "has immutable attributes" do [:name, :runner, :container, :workdir, :timeout, :cleanup].each do |attribute| - expect(spec.respond_to?("#{attribute}=")).to be(false) + expect(spec.respond_to?(:"#{attribute}=")).to be(false) end end diff --git a/Library/Homebrew/test/macos_runner_spec_spec.rb b/Library/Homebrew/test/macos_runner_spec_spec.rb index e0711b19092a6..e676434d58286 100644 --- a/Library/Homebrew/test/macos_runner_spec_spec.rb +++ b/Library/Homebrew/test/macos_runner_spec_spec.rb @@ -7,7 +7,7 @@ it "has immutable attributes" do [:name, :runner, :timeout, :cleanup].each do |attribute| - expect(spec.respond_to?("#{attribute}=")).to be(false) + expect(spec.respond_to?(:"#{attribute}=")).to be(false) end end