Merge pull request #14528 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-performance-1.16.0
build(deps): bump rubocop-performance from 1.15.2 to 1.16.0 in /Library/Homebrew
This commit is contained in:
commit
b761344428
@ -72,8 +72,8 @@ SimpleCov.start do
|
||||
|
||||
require "rbconfig"
|
||||
host_os = RbConfig::CONFIG["host_os"]
|
||||
add_filter %r{/os/mac} unless /darwin/.match?(host_os)
|
||||
add_filter %r{/os/linux} unless /linux/.match?(host_os)
|
||||
add_filter %r{/os/mac} unless host_os.include?("darwin")
|
||||
add_filter %r{/os/linux} unless host_os.include?("linux")
|
||||
|
||||
# Add groups and the proper project name to the output.
|
||||
project_name "Homebrew"
|
||||
|
||||
@ -144,7 +144,7 @@ GEM
|
||||
parser (>= 3.1.1.0)
|
||||
rubocop-capybara (2.17.0)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-performance (1.15.2)
|
||||
rubocop-performance (1.16.0)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
rubocop-ast (>= 0.4.0)
|
||||
rubocop-rails (2.17.4)
|
||||
|
||||
@ -44,8 +44,8 @@ module SystemConfig
|
||||
return unless /-microsoft/i.match?(kernel)
|
||||
|
||||
return "2 (Microsoft Store)" if Version.new(kernel[/Linux ([0-9.]*)-.*/, 1]) > Version.new("5.15")
|
||||
return "2" if /-microsoft/.match?(kernel)
|
||||
return "1" if /-Microsoft/.match?(kernel)
|
||||
return "2" if kernel.include?("-microsoft")
|
||||
return "1" if kernel.include?("-Microsoft")
|
||||
end
|
||||
|
||||
def dump_verbose_config(out = $stdout)
|
||||
|
||||
@ -49,7 +49,7 @@ module FormulaCellarChecks
|
||||
python_modules = Pathname.glob lib/"python*/site-packages/**/*.so"
|
||||
framework_links = python_modules.select do |obj|
|
||||
dlls = obj.dynamically_linked_libraries
|
||||
dlls.any? { |dll| /Python\.framework/.match dll }
|
||||
dlls.any? { |dll| dll.include?("Python.framework") }
|
||||
end
|
||||
return if framework_links.empty?
|
||||
|
||||
|
||||
@ -508,6 +508,7 @@ RuboCop::Cop::Performance::RedundantMatch::MSG = T.let(T.unsafe(nil), String)
|
||||
RuboCop::Cop::Performance::RedundantMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
||||
|
||||
class RuboCop::Cop::Performance::RedundantMerge < ::RuboCop::Cop::Base
|
||||
include ::RuboCop::Cop::Alignment
|
||||
extend ::RuboCop::Cop::AutoCorrector
|
||||
|
||||
def modifier_flow_control?(param0 = T.unsafe(nil)); end
|
||||
@ -519,7 +520,6 @@ class RuboCop::Cop::Performance::RedundantMerge < ::RuboCop::Cop::Base
|
||||
def correct_multiple_elements(corrector, node, parent, new_source); end
|
||||
def correct_single_element(corrector, node, new_source); end
|
||||
def each_redundant_merge(node); end
|
||||
def indent_width; end
|
||||
def kwsplat_used?(pairs); end
|
||||
def leading_spaces(node); end
|
||||
def max_key_value_pairs; end
|
||||
@ -105,7 +105,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-display_width-2.4.2/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.44.1/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-capybara-2.17.0/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.15.2/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-performance-1.16.0/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rails-2.17.4/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-rspec-2.18.1/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-sorbet-0.7.0/lib")
|
||||
|
||||
@ -33,7 +33,7 @@ module RuboCop
|
||||
RETURNS_NEW_ARRAY_WHEN_NO_BLOCK = %i[zip product].to_set.freeze
|
||||
|
||||
# These methods ALWAYS return a new array
|
||||
# after they're called it's safe to mutate the the resulting array
|
||||
# after they're called it's safe to mutate the resulting array
|
||||
ALWAYS_RETURNS_NEW_ARRAY = %i[* + - collect compact drop
|
||||
drop_while flatten map reject
|
||||
reverse rotate select shuffle sort
|
||||
@ -8,9 +8,12 @@ module RuboCop
|
||||
# `detect` instead.
|
||||
#
|
||||
# @safety
|
||||
# This cop is unsafe because is has known compatibility issues with `ActiveRecord` and other
|
||||
# frameworks. `ActiveRecord` does not implement a `detect` method and `find` has its own
|
||||
# meaning. Correcting `ActiveRecord` methods with this cop should be considered unsafe.
|
||||
# This cop is unsafe because is assumes the class implements the
|
||||
# `Enumerable` interface, but can't reliably detect this. This creates
|
||||
# known compatibility issues with `Hash`, `ActiveRecord` and other
|
||||
# frameworks. `Hash` and `ActiveRecord` do not implement a `detect`
|
||||
# method and `find` has its own meaning. Correcting `Hash` and
|
||||
# `ActiveRecord` methods with this cop should be considered unsafe.
|
||||
#
|
||||
# @example
|
||||
# # bad
|
||||
@ -28,6 +28,7 @@ module RuboCop
|
||||
# hash[:a] = 1
|
||||
# hash[:b] = 2
|
||||
class RedundantMerge < Base
|
||||
include Alignment
|
||||
extend AutoCorrector
|
||||
|
||||
AREF_ASGN = '%<receiver>s[%<key>s] = %<value>s'
|
||||
@ -129,7 +130,7 @@ module RuboCop
|
||||
end
|
||||
|
||||
def rewrite_with_modifier(node, parent, new_source)
|
||||
indent = ' ' * indent_width
|
||||
indent = ' ' * configured_indentation_width
|
||||
padding = "\n#{indent + leading_spaces(node)}"
|
||||
new_source.gsub!(/\n/, padding)
|
||||
|
||||
@ -144,10 +145,6 @@ module RuboCop
|
||||
node.source_range.source_line[/\A\s*/]
|
||||
end
|
||||
|
||||
def indent_width
|
||||
@config.for_cop('Layout/IndentationWidth')['Width'] || 2
|
||||
end
|
||||
|
||||
def max_key_value_pairs
|
||||
Integer(cop_config['MaxKeyValuePairs'] || 2)
|
||||
end
|
||||
@ -6,19 +6,19 @@ module RuboCop
|
||||
# Identifies unnecessary use of a regex where `String#include?` would suffice.
|
||||
#
|
||||
# @safety
|
||||
# This cop's offenses are not safe to autocorrect if a receiver is nil.
|
||||
# This cop's offenses are not safe to autocorrect if a receiver is nil or a Symbol.
|
||||
#
|
||||
# @example
|
||||
# # bad
|
||||
# 'abc'.match?(/ab/)
|
||||
# /ab/.match?('abc')
|
||||
# 'abc' =~ /ab/
|
||||
# /ab/ =~ 'abc'
|
||||
# 'abc'.match(/ab/)
|
||||
# /ab/.match('abc')
|
||||
# str.match?(/ab/)
|
||||
# /ab/.match?(str)
|
||||
# str =~ /ab/
|
||||
# /ab/ =~ str
|
||||
# str.match(/ab/)
|
||||
# /ab/.match(str)
|
||||
#
|
||||
# # good
|
||||
# 'abc'.include?('ab')
|
||||
# str.include?('ab')
|
||||
class StringInclude < Base
|
||||
extend AutoCorrector
|
||||
|
||||
@ -27,7 +27,7 @@ module RuboCop
|
||||
|
||||
def_node_matcher :redundant_regex?, <<~PATTERN
|
||||
{(send $!nil? {:match :=~ :!~ :match?} (regexp (str $#literal?) (regopt)))
|
||||
(send (regexp (str $#literal?) (regopt)) {:match :match?} $str)
|
||||
(send (regexp (str $#literal?) (regopt)) {:match :match?} $_)
|
||||
(match-with-lvasgn (regexp (str $#literal?) (regopt)) $_)}
|
||||
PATTERN
|
||||
|
||||
@ -4,7 +4,7 @@ module RuboCop
|
||||
module Performance
|
||||
# This module holds the RuboCop Performance version information.
|
||||
module Version
|
||||
STRING = '1.15.2'
|
||||
STRING = '1.16.0'
|
||||
|
||||
def self.document_version
|
||||
STRING.match('\d+\.\d+').to_s
|
||||
Loading…
x
Reference in New Issue
Block a user