Skip to content

Commit

Permalink
Merge pull request #13574 from Homebrew/dependabot/bundler/Library/Ho…
Browse files Browse the repository at this point in the history
…mebrew/rubocop-performance-1.14.3

build(deps): bump rubocop-performance from 1.14.2 to 1.14.3 in /Library/Homebrew
  • Loading branch information
Rylan12 authored Jul 18, 2022
2 parents 5b247cf + 114f909 commit f96b9ef
Show file tree
Hide file tree
Showing 61 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Library/Homebrew/vendor/bundle/bundler/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
$:.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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class ChainArrayAllocation < Base

RETURNS_NEW_ARRAY = (ALWAYS_RETURNS_NEW_ARRAY + RETURNS_NEW_ARRAY_WHEN_NO_BLOCK).freeze

MSG = 'Use unchained `%<method>s` and `%<second_method>s!` '\
'(followed by `return array` if required) instead of chaining '\
MSG = 'Use unchained `%<method>s` and `%<second_method>s!` ' \
'(followed by `return array` if required) instead of chaining ' \
'`%<method>s...%<second_method>s`.'

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 ...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module Performance
# end
#
class CollectionLiteralInLoop < Base
MSG = 'Avoid immutable %<literal_class>s literals in loops. '\
MSG = 'Avoid immutable %<literal_class>s literals in loops. ' \
'It is better to extract it into a local variable or a constant.'

POST_CONDITION_LOOP_TYPES = %i[while_post until_post].freeze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ def on_send(node)
# `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
Expand All @@ -68,8 +67,7 @@ def on_send(node)
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class StringIdentifierArgument < Base
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Performance
# 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]
# ----
Expand Down Expand Up @@ -43,7 +43,7 @@ module Performance
#
# @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, :+)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f96b9ef

Please sign in to comment.