brew vendor-gems: commit updates.

This commit is contained in:
BrewTestBot 2022-05-25 14:23:59 +00:00
parent 9cb7975b18
commit 554eaa27da
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
59 changed files with 69 additions and 71 deletions

View File

@ -85,7 +85,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-1.18.0/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.1.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.27.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.13.3/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.14.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.14.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.11.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.8/lib"

View File

@ -247,7 +247,7 @@ Performance/RedundantSortBlock:
VersionAdded: '1.7'
Performance/RedundantSplitRegexpArgument:
Description: 'This cop identifies places where `split` argument can be replaced from a deterministic regexp to a string.'
Description: 'Identifies places where `split` argument can be replaced from a deterministic regexp to a string.'
Enabled: pending
VersionAdded: '1.10'

View File

@ -54,9 +54,9 @@ module RuboCop
def drop_start_metacharacter(regexp_string)
if regexp_string.start_with?('\\A')
regexp_string[2..-1] # drop `\A` anchor
regexp_string[2..] # drop `\A` anchor
else
regexp_string[1..-1] # drop `^` anchor
regexp_string[1..] # drop `^` anchor
end
end

View File

@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `ancestors.include?` and
# change them to use `<=` instead.
# Identifies usages of `ancestors.include?` and change them to use `<=` instead.
#
# @safety
# This cop is unsafe because it can't tell whether the receiver is a class or an object.

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where slicing arrays with semi-infinite ranges
# Identifies places where slicing arrays with semi-infinite ranges
# can be replaced by `Array#take` and `Array#drop`.
# This cop was created due to a mistake in microbenchmark and hence is disabled by default.
# Refer https://github.com/rubocop/rubocop-performance/pull/175#issuecomment-731892717

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where numeric argument to BigDecimal should be
# Identifies places where numeric argument to BigDecimal should be
# converted to string. Initializing from String is faster
# than from Numeric for BigDecimal.
#

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies unnecessary use of a `block_given?` where explicit check
# Identifies unnecessary use of a `block_given?` where explicit check
# of block argument would suffice.
#
# @example

View File

@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `caller[n]`
# can be replaced by `caller(n..n).first`.
# Identifies places where `caller[n]` can be replaced by `caller(n..n).first`.
#
# @example
# # bad

View File

@ -18,7 +18,7 @@ module RuboCop
# that is inside of the splat expansion.
#
# @safety
# This cop is not unsafe auto-correction because it is not a guaranteed
# This cop is not unsafe autocorrection because it is not a guaranteed
# performance improvement. If the data being processed by the `case` condition is
# normalized in a manner that favors hitting a condition in the splat expansion,
# it is possible that moving the splat condition to the end will use more memory,
@ -168,7 +168,7 @@ module RuboCop
def needs_reorder?(when_node)
following_branches =
when_node.parent.when_branches[(when_node.branch_index + 1)..-1]
when_node.parent.when_branches[(when_node.branch_index + 1)..]
following_branches.any? do |when_branch|
when_branch.conditions.any? do |condition|

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where a case-insensitive string comparison
# Identifies places where a case-insensitive string comparison
# can better be implemented using `casecmp`.
#
# @safety
@ -54,11 +54,11 @@ module RuboCop
return unless (parts = take_method_apart(node))
_receiver, method, arg, variable = parts
good_method = build_good_method(arg, variable)
good_method = build_good_method(method, arg, variable)
message = format(MSG, good: good_method, bad: node.source)
add_offense(node, message: message) do |corrector|
correction(corrector, node, method, arg, variable)
autocorrect(corrector, node, good_method)
end
end
@ -81,22 +81,20 @@ module RuboCop
[receiver, method, arg, variable]
end
def correction(corrector, node, method, arg, variable)
corrector.insert_before(node.loc.expression, '!') if method == :!=
replacement = build_good_method(arg, variable)
corrector.replace(node.loc.expression, replacement)
def autocorrect(corrector, node, replacement)
corrector.replace(node, replacement)
end
def build_good_method(arg, variable)
def build_good_method(method, arg, variable)
bang = method == :!= ? '!' : ''
# We want resulting call to be parenthesized
# if arg already includes one or more sets of parens, don't add more
# or if method call already used parens, again, don't add more
if arg.send_type? || !parentheses?(arg)
"#{variable.source}.casecmp(#{arg.source}).zero?"
"#{bang}#{variable.source}.casecmp(#{arg.source}).zero?"
else
"#{variable.source}.casecmp#{arg.source}.zero?"
"#{bang}#{variable.source}.casecmp#{arg.source}.zero?"
end
end
end

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `array.compact.flatten.map { |x| x.downcase }`.
# Identifies usages of `array.compact.flatten.map { |x| x.downcase }`.
# Each of these methods (`compact`, `flatten`, `map`) will generate a new intermediate array
# that is promptly thrown away. Instead it is faster to mutate when we know it's safe.
#

View File

@ -5,8 +5,8 @@ require 'set'
module RuboCop
module Cop
module Performance
# This cop identifies places where Array and Hash literals are used
# within loops. It is better to extract them into a local variable or constant
# Identifies places where Array and Hash literals are used within loops.
# It is better to extract them into a local variable or constant
# to avoid unnecessary allocations on each iteration.
#
# You can set the minimum number of elements to consider

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `sort { |a, b| a.foo <=> b.foo }`
# Identifies places where `sort { |a, b| a.foo <=> b.foo }`
# can be replaced by `sort_by(&:foo)`.
# This cop also checks `max` and `min` methods.
#

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `Concurrent.monotonic_time`
# Identifies places where `Concurrent.monotonic_time`
# can be replaced by `Process.clock_gettime(Process::CLOCK_MONOTONIC)`.
#
# @example

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop finds regular expressions with dynamic components that are all constants.
# Finds regular expressions with dynamic components that are all constants.
#
# Ruby allocates a new Regexp object every time it executes a code containing such
# a regular expression. It is more efficient to extract it into a constant,

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `count` on an `Enumerable` that
# Identifies usages of `count` on an `Enumerable` that
# follow calls to `select`, `find_all`, `filter` or `reject`. Querying logic can instead be
# passed to the `count` call.
#

View File

@ -49,6 +49,9 @@ module RuboCop
class DeletePrefix < Base
include RegexpMetacharacter
extend AutoCorrector
extend TargetRubyVersion
minimum_target_ruby_version 2.5
MSG = 'Use `%<prefer>s` instead of `%<current>s`.'
RESTRICT_ON_SEND = %i[gsub gsub! sub sub!].freeze

View File

@ -49,6 +49,9 @@ module RuboCop
class DeleteSuffix < Base
include RegexpMetacharacter
extend AutoCorrector
extend TargetRubyVersion
minimum_target_ruby_version 2.5
MSG = 'Use `%<prefer>s` instead of `%<current>s`.'
RESTRICT_ON_SEND = %i[gsub gsub! sub sub!].freeze

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `first`, `last`, `[0]` or `[-1]`
# Identifies usages of `first`, `last`, `[0]` or `[-1]`
# chained to `select`, `find_all` or `filter` and change them to use
# `detect` instead.
#

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for double `#start_with?` or `#end_with?` calls
# Checks for double `#start_with?` or `#end_with?` calls
# separated by `||`. In some cases such calls can be replaced
# with an single `#start_with?`/`#end_with?` call.
#

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies unnecessary use of a regex where `String#end_with?` would suffice.
# Identifies unnecessary use of a regex where `String#end_with?` would suffice.
#
# This cop has `SafeMultiline` configuration option that `true` by default because
# `end$` is unsafe as it will behave incompatible with `end_with?`

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `map { ... }.flatten` and
# Identifies usages of `map { ... }.flatten` and
# change them to use `flat_map { ... }` instead.
#
# @example

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for inefficient searching of keys and values within
# Checks for inefficient searching of keys and values within
# hashes.
#
# `Hash#keys.include?` is less efficient than `Hash#key?` because

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where inefficient `readlines` method
# Identifies places where inefficient `readlines` method
# can be replaced by `each_line` to avoid fully loading file content into memory.
#
# @example

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where methods are converted to blocks, with the
# Identifies places where methods are converted to blocks, with the
# use of `&method`, and passed as arguments to method calls.
# It is faster to replace those with explicit blocks, calling those methods inside.
#

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for `OpenStruct.new` calls.
# Checks for `OpenStruct.new` calls.
# Instantiation of an `OpenStruct` invalidates
# Ruby global method cache as it causes dynamic method
# definition during program runtime.

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies uses of `Range#include?` and `Range#member?`, which iterates over each
# Identifies uses of `Range#include?` and `Range#member?`, which iterates over each
# item in a `Range` to see if a specified item is there. In contrast,
# `Range#cover?` simply compares the target item with the beginning and
# end points of the `Range`. In a great majority of cases, this is what
@ -11,7 +11,7 @@ module RuboCop
#
# @safety
# This cop is unsafe because `Range#include?` (or `Range#member?`) and `Range#cover?`
# are not equivalent behaviour.
# are not equivalent behavior.
#
# @example
# # bad

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies the use of a `&block` parameter and `block.call`
# Identifies the use of a `&block` parameter and `block.call`
# where `yield` would do just as well.
#
# @example

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`,
# Checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`,
# and `Enumerable#none?` are compared with `===` or similar methods in block.
#
# By default, `Object#===` behaves the same as `Object#==`, but this
@ -25,6 +25,9 @@ module RuboCop
#
class RedundantEqualityComparisonBlock < Base
extend AutoCorrector
extend TargetRubyVersion
minimum_target_ruby_version 2.5
MSG = 'Use `%<prefer>s` instead of block.'

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies the use of `Regexp#match` or `String#match`, which
# Identifies the use of `Regexp#match` or `String#match`, which
# returns `#<MatchData>`/`nil`. The return value of `=~` is an integral
# index/`nil` and is more performant.
#

View File

@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `Hash#merge!` can be replaced by
# `Hash#[]=`.
# Identifies places where `Hash#merge!` can be replaced by `Hash#[]=`.
# You can set the maximum number of key-value pairs to consider
# an offense with `MaxKeyValuePairs`.
#

View File

@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `sort { |a, b| a <=> b }`
# can be replaced with `sort`.
# Identifies places where `sort { |a, b| a <=> b }` can be replaced with `sort`.
#
# @example
# # bad

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `split` argument can be replaced from
# Identifies places where `split` argument can be replaced from
# a deterministic regexp to a string.
#
# @example

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for redundant `String#chars`.
# Checks for redundant `String#chars`.
#
# @example
# # bad

View File

@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `reverse.each` and
# change them to use `reverse_each` instead.
# Identifies usages of `reverse.each` and change them to use `reverse_each` instead.
#
# If the return value is used, it will not be detected because the result will be different.
#

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `reverse.first(n)` and `reverse.first`
# Identifies places where `reverse.first(n)` and `reverse.first`
# can be replaced by `last(n).reverse` and `last`.
#
# @example

View File

@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop is used to identify usages of `count` on an
# `Array` and `Hash` and change them to `size`.
# Identifies usages of `count` on an `Array` and `Hash` and change them to `size`.
#
# @example
# # bad

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `sort { |a, b| b <=> a }`
# Identifies places where `sort { |a, b| b <=> a }`
# can be replaced by a faster `sort.reverse`.
#
# @example

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `gsub(/a+/, 'a')` and `gsub!(/a+/, 'a')`
# Identifies places where `gsub(/a+/, 'a')` and `gsub!(/a+/, 'a')`
# can be replaced by `squeeze('a')` and `squeeze!('a')`.
#
# The `squeeze('a')` method is faster than `gsub(/a+/, 'a')`.

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies unnecessary use of a regex where `String#start_with?` would suffice.
# Identifies unnecessary use of a regex where `String#start_with?` would suffice.
#
# This cop has `SafeMultiline` configuration option that `true` by default because
# `^start` is unsafe as it will behave incompatible with `start_with?`

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where string identifier argument can be replaced
# Identifies places where string identifier argument can be replaced
# by symbol identifier argument.
# It prevents the redundancy of the internal string-to-symbol conversion.
#
@ -46,7 +46,7 @@ module RuboCop
def on_send(node)
return unless (first_argument = node.first_argument)
return unless first_argument.str_type?
return if first_argument.value.include?(' ')
return if first_argument.value.include?(' ') || first_argument.value.include?('::')
replacement = first_argument.value.to_sym.inspect

View File

@ -3,11 +3,10 @@
module RuboCop
module Cop
module Performance
# This cop identifies unnecessary use of a regex where
# `String#include?` would suffice.
# Identifies unnecessary use of a regex where `String#include?` would suffice.
#
# @safety
# This cop's offenses are not safe to auto-correct if a receiver is nil.
# This cop's offenses are not safe to autocorrect if a receiver is nil.
#
# @example
# # bad

View File

@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `gsub` can be replaced by
# `tr` or `delete`.
# Identifies places where `gsub` can be replaced by `tr` or `delete`.
#
# @example
# # bad

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where custom code finding the sum of elements
# Identifies places where custom code finding the sum of elements
# in some Enumerable object can be replaced by `Enumerable#sum` method.
#
# @safety

View File

@ -3,7 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop checks for .times.map calls.
# Checks for .times.map calls.
# In most cases such calls can be replaced
# with an explicit array creation.
#

View File

@ -3,8 +3,7 @@
module RuboCop
module Cop
module Performance
# This cop identifies places where `URI::Parser.new`
# can be replaced by `URI::DEFAULT_PARSER`.
# Identifies places where `URI::Parser.new` can be replaced by `URI::DEFAULT_PARSER`.
#
# @example
# # bad

View File

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