Merge pull request #16358 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-performance-1.20.0

build(deps-dev): bump rubocop-performance from 1.19.1 to 1.20.0 in /Library/Homebrew
This commit is contained in:
Mike McQuaid 2023-12-19 12:01:48 +00:00 committed by GitHub
commit 38c5e52a6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 127 additions and 98 deletions

View File

@ -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)

View File

@ -89,7 +89,7 @@ begin
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

View File

@ -72,7 +72,7 @@ module Cask
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

View File

@ -127,20 +127,20 @@ module Cask
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

View File

@ -173,7 +173,7 @@ class CompilerSelector
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

View File

@ -18,7 +18,7 @@ module OnSystem
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 @@ module OnSystem
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 @@ module OnSystem
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 @@ module OnSystem
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__)

View File

@ -111,7 +111,7 @@ module Hardware
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

View File

@ -295,7 +295,7 @@ class Formula
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 }

View File

@ -69,7 +69,7 @@ class Locale
}.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)

View File

@ -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')

View File

@ -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)

View File

@ -234,7 +234,7 @@ class Tab
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?

View File

@ -11,7 +11,7 @@ describe GitHubRunner do
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

View File

@ -16,7 +16,7 @@ describe LinuxRunnerSpec do
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

View File

@ -7,7 +7,7 @@ describe MacOSRunnerSpec do
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

View File

@ -101,7 +101,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_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")