Merge pull request #13574 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-performance-1.14.3

build(deps): bump rubocop-performance from 1.14.2 to 1.14.3 in /Library/Homebrew
This commit is contained in:
Rylan Polster 2022-07-18 22:45:10 +02:00 committed by GitHub
commit f96b9ef535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 14 additions and 15 deletions

View File

@ -136,7 +136,7 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.19.1)
parser (>= 3.1.1.0)
rubocop-performance (1.14.2)
rubocop-performance (1.14.3)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.15.2)

View File

@ -6,6 +6,7 @@
module RuboCop; end
module RuboCop::Cop; end
RuboCop::Cop::IgnoredPattern = RuboCop::Cop::AllowedPattern
module RuboCop::Cop::Performance; end
class RuboCop::Cop::Performance::AncestorsInclude < ::RuboCop::Cop::Base

View File

@ -87,7 +87,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-1.19.1/li
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.2.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.31.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.14.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.14.3/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.15.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.12.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.11/lib"

View File

@ -160,7 +160,7 @@ Performance/FlatMap:
Description: >-
Use `Enumerable#flat_map`
instead of `Enumerable#map...Array#flatten(1)`
or `Enumberable#collect..Array#flatten(1)`.
or `Enumerable#collect..Array#flatten(1)`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
Enabled: true
VersionAdded: '0.30'

View File

@ -53,7 +53,7 @@ module RuboCop
def_node_matcher :chain_array_allocation?, <<~PATTERN
(send {
(send _ $%RETURN_NEW_ARRAY_WHEN_ARGS {int lvar ivar cvar gvar})
(send _ $%RETURN_NEW_ARRAY_WHEN_ARGS {int lvar ivar cvar gvar send})
(block (send _ $%ALWAYS_RETURNS_NEW_ARRAY) ...)
(send _ $%RETURNS_NEW_ARRAY ...)
} $%HAS_MUTATION_ALTERNATIVE ...)

View File

@ -58,8 +58,7 @@ module RuboCop
# `key?`/`value?` method.
corrector.replace(
node.loc.expression,
"#{autocorrect_hash_expression(node)}."\
"#{autocorrect_method(node)}(#{autocorrect_argument(node)})"
"#{autocorrect_hash_expression(node)}.#{autocorrect_method(node)}(#{autocorrect_argument(node)})"
)
end
end
@ -68,8 +67,7 @@ module RuboCop
private
def message(node)
"Use `##{autocorrect_method(node)}` instead of "\
"`##{current_method(node)}.include?`."
"Use `##{autocorrect_method(node)}` instead of `##{current_method(node)}.include?`."
end
def autocorrect_method(node)

View File

@ -38,7 +38,7 @@ module RuboCop
remove_class_variable remove_method undef_method class_variable_get class_variable_set
deprecate_constant module_function private private_constant protected public public_constant
remove_const ruby2_keywords
define_singleton_method instance_variable_defined instance_variable_get instance_variable_set
define_singleton_method instance_variable_defined? instance_variable_get instance_variable_set
method public_method public_send remove_instance_variable respond_to? send singleton_method
__send__
].freeze

View File

@ -7,7 +7,7 @@ module RuboCop
# in some Enumerable object can be replaced by `Enumerable#sum` method.
#
# @safety
# Auto-corrections are unproblematic wherever an initial value is provided explicitly:
# Autocorrections are unproblematic wherever an initial value is provided explicitly:
#
# [source,ruby]
# ----
@ -43,7 +43,7 @@ module RuboCop
#
# @example OnlySumOrWithInitialValue: false (default)
# # bad
# [1, 2, 3].inject(:+) # Auto-corrections for cases without initial value are unsafe
# [1, 2, 3].inject(:+) # Autocorrections for cases without initial value are unsafe
# [1, 2, 3].inject(&:+) # and will only be performed when using the `-A` option.
# [1, 2, 3].reduce { |acc, elem| acc + elem } # They can be prohibited completely using `SafeAutoCorrect: true`.
# [1, 2, 3].reduce(10, :+)

View File

@ -4,7 +4,7 @@ module RuboCop
module Performance
# This module holds the RuboCop Performance version information.
module Version
STRING = '1.14.2'
STRING = '1.14.3'
def self.document_version
STRING.match('\d+\.\d+').to_s