brew vendor-gems: commit updates.
This commit is contained in:
parent
bc178b1a5a
commit
f72d8b0968
@ -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"
|
||||
|
@ -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'
|
@ -47,13 +47,13 @@ module RuboCop
|
||||
|
||||
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 ...)
|
@ -32,7 +32,7 @@ module RuboCop
|
||||
# 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
|
@ -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)
|
@ -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
|
@ -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, :+)
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user