diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 9bf4b0f209..a918116ff7 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -77,7 +77,7 @@ GEM rack (2.2.3) rainbow (3.0.0) rdiscount (2.2.0.2) - regexp_parser (2.0.3) + regexp_parser (2.1.1) rexml (3.2.4) ronn (0.7.3) hpricot (>= 0.8.2) @@ -119,7 +119,7 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.1) parser (>= 2.7.1.5) - rubocop-performance (1.9.2) + rubocop-performance (1.10.0) rubocop (>= 0.90.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rails (2.9.1) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index a514a073b7..5398a2feb6 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -165,7 +165,7 @@ module Cask odebug "Auditing stanzas which require an uninstall" return if cask.artifacts.none? { |k| k.is_a?(Artifact::Pkg) || k.is_a?(Artifact::Installer) } - return if cask.artifacts.any? { |k| k.is_a?(Artifact::Uninstall) } + return if cask.artifacts.any?(Artifact::Uninstall) add_error "installer and pkg stanzas require an uninstall stanza" end diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index b00e0aed3f..1ebd604576 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -474,7 +474,7 @@ module Homebrew "<#{type}>" end.compact - types << "" if @named_args_type.any? { |type| type.is_a? String } + types << "" if @named_args_type.any?(String) types.join("|") elsif SYMBOL_TO_USAGE_MAPPING.key? @named_args_type SYMBOL_TO_USAGE_MAPPING[@named_args_type] diff --git a/Library/Homebrew/dev-cmd/unbottled.rb b/Library/Homebrew/dev-cmd/unbottled.rb index 2c0f098f57..d25d46a06e 100644 --- a/Library/Homebrew/dev-cmd/unbottled.rb +++ b/Library/Homebrew/dev-cmd/unbottled.rb @@ -166,11 +166,11 @@ module Homebrew requirements = f.recursive_requirements if @bottle_tag.to_s.end_with?("_linux") - if requirements.any? { |r| r.is_a?(MacOSRequirement) } + if requirements.any?(MacOSRequirement) puts "#{Tty.bold}#{Tty.red}#{name}#{Tty.reset}: requires macOS" if any_named_args next end - elsif requirements.any? { |r| r.is_a?(LinuxRequirement) } + elsif requirements.any?(LinuxRequirement) puts "#{Tty.bold}#{Tty.red}#{name}#{Tty.reset}: requires Linux" if any_named_args next else diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 728c4e8189..206962ac74 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -1052,7 +1052,7 @@ class CVSDownloadStrategy < VCSDownloadStrategy end def split_url(in_url) - parts = in_url.split(/:/) + parts = in_url.split(":") mod = parts.pop url = parts.join(":") [mod, url] diff --git a/Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.0.3.rbi b/Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.1.1.rbi similarity index 98% rename from Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.0.3.rbi rename to Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.1.1.rbi index bb6f3dbb0f..2fa7ded968 100644 --- a/Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.0.3.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.1.1.rbi @@ -84,6 +84,10 @@ class Regexp::Expression::Backreference::Base < ::Regexp::Expression::Base def match_length; end def referenced_expression; end def referenced_expression=(_arg0); end + + private + + def initialize_copy(orig); end end class Regexp::Expression::Backreference::Name < ::Regexp::Expression::Backreference::Base @@ -198,7 +202,7 @@ class Regexp::Expression::Base private - def initialize_clone(orig); end + def initialize_copy(orig); end end class Regexp::Expression::CharacterSet < ::Regexp::Expression::Subexpression @@ -292,6 +296,10 @@ class Regexp::Expression::Conditional::Condition < ::Regexp::Expression::Base def reference; end def referenced_expression; end def referenced_expression=(_arg0); end + + private + + def initialize_copy(orig); end end class Regexp::Expression::Conditional::Expression < ::Regexp::Expression::Subexpression @@ -306,9 +314,13 @@ class Regexp::Expression::Conditional::Expression < ::Regexp::Expression::Subexp def referenced_expression; end def referenced_expression=(_arg0); end def to_s(format = T.unsafe(nil)); end + + private + + def initialize_copy(orig); end end -class Regexp::Expression::Conditional::TooManyBranches < ::StandardError +class Regexp::Expression::Conditional::TooManyBranches < ::Regexp::Parser::Error def initialize; end end @@ -431,12 +443,16 @@ class Regexp::Expression::Group::Named < ::Regexp::Expression::Group::Capture private - def initialize_clone(orig); end + def initialize_copy(orig); end end class Regexp::Expression::Group::Options < ::Regexp::Expression::Group::Base def option_changes; end def option_changes=(_arg0); end + + private + + def initialize_copy(orig); end end class Regexp::Expression::Group::Passive < ::Regexp::Expression::Group::Base @@ -486,7 +502,7 @@ class Regexp::Expression::Quantifier private - def initialize_clone(orig); end + def initialize_copy(orig); end end Regexp::Expression::Quantifier::MODES = T.let(T.unsafe(nil), Array) @@ -553,7 +569,7 @@ class Regexp::Expression::Subexpression < ::Regexp::Expression::Base private - def initialize_clone(orig); end + def initialize_copy(orig); end end module Regexp::Expression::UnicodeProperty @@ -867,7 +883,6 @@ end class Regexp::Parser include(::Regexp::Expression) - include(::Regexp::Syntax) include(::Regexp::Expression::UnicodeProperty) def parse(input, syntax = T.unsafe(nil), options: T.unsafe(nil), &block); end @@ -898,6 +913,7 @@ class Regexp::Parser def intersection(token); end def interval(target_node, token); end def keep(token); end + def literal(token); end def meta(token); end def negate_set; end def nest(exp); end @@ -933,11 +949,16 @@ end Regexp::Parser::ENC_FLAGS = T.let(T.unsafe(nil), Array) +class Regexp::Parser::Error < ::StandardError +end + Regexp::Parser::MOD_FLAGS = T.let(T.unsafe(nil), Array) -class Regexp::Parser::ParserError < ::StandardError +class Regexp::Parser::ParserError < ::Regexp::Parser::Error end +Regexp::Parser::UPTokens = Regexp::Syntax::Token::UnicodeProperty + class Regexp::Parser::UnknownTokenError < ::Regexp::Parser::ParserError def initialize(type, token); end end @@ -1005,20 +1026,18 @@ class Regexp::Scanner::InvalidSequenceError < ::Regexp::Scanner::ValidationError def initialize(what = T.unsafe(nil), where = T.unsafe(nil)); end end -Regexp::Scanner::PROP_MAPS_DIR = T.let(T.unsafe(nil), String) - class Regexp::Scanner::PrematureEndError < ::Regexp::Scanner::ScannerError def initialize(where = T.unsafe(nil)); end end -class Regexp::Scanner::ScannerError < ::StandardError +class Regexp::Scanner::ScannerError < ::Regexp::Parser::Error end class Regexp::Scanner::UnknownUnicodePropertyError < ::Regexp::Scanner::ValidationError def initialize(name); end end -class Regexp::Scanner::ValidationError < ::StandardError +class Regexp::Scanner::ValidationError < ::Regexp::Parser::Error def initialize(reason); end end @@ -1088,7 +1107,7 @@ class Regexp::Syntax::NotImplementedError < ::Regexp::Syntax::SyntaxError def initialize(syntax, type, token); end end -class Regexp::Syntax::SyntaxError < ::StandardError +class Regexp::Syntax::SyntaxError < ::Regexp::Parser::Error end module Regexp::Syntax::Token diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.9.2.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.10.0.rbi similarity index 95% rename from Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.9.2.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.10.0.rbi index 98883cd1fa..6c2e47ea87 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.9.2.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.10.0.rbi @@ -238,7 +238,7 @@ class RuboCop::Cop::Performance::ConstantRegexp < ::RuboCop::Cop::Base private def include_interpolated_const?(node); end - def within_const_assignment?(node); end + def within_allowed_assignment?(node); end end RuboCop::Cop::Performance::ConstantRegexp::MSG = T.let(T.unsafe(nil), String) @@ -482,6 +482,25 @@ RuboCop::Cop::Performance::RedundantBlockCall::SPACE = T.let(T.unsafe(nil), Stri RuboCop::Cop::Performance::RedundantBlockCall::YIELD = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Performance::RedundantEqualityComparisonBlock < ::RuboCop::Cop::Base + extend(::RuboCop::Cop::AutoCorrector) + extend(::RuboCop::Cop::TargetRubyVersion) + + def on_block(node); end + + private + + def new_argument(block_argument, block_body); end + def offense_range(node); end + def use_equality_comparison_block?(block_body); end +end + +RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::COMPARISON_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::TARGET_METHODS = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Performance::RedundantMatch < ::RuboCop::Cop::Base extend(::RuboCop::Cop::AutoCorrector) @@ -561,6 +580,27 @@ end RuboCop::Cop::Performance::RedundantSortBlock::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Performance::RedundantSplitRegexpArgument < ::RuboCop::Cop::Base + extend(::RuboCop::Cop::AutoCorrector) + + def on_send(node); end + def split_call_with_regexp?(param0 = T.unsafe(nil)); end + + private + + def autocorrect(corrector, node); end + def determinist_regexp?(first_argument); end + def replacement(node); end +end + +RuboCop::Cop::Performance::RedundantSplitRegexpArgument::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Performance::RedundantSplitRegexpArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Performance::RedundantSplitRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Performance::RedundantSplitRegexpArgument::STR_SPECIAL_CHARS = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Performance::RedundantStringChars < ::RuboCop::Cop::Base include(::RuboCop::Cop::RangeHelp) extend(::RuboCop::Cop::AutoCorrector) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index ccd93b58e1..d6057b3231 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -63,7 +63,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/pry-0.14.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rack-2.2.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-14/2.6.0-static/rdiscount-2.2.0.2" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rdiscount-2.2.0.2/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/regexp_parser-2.0.3/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/regexp_parser-2.1.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rexml-3.2.4/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ronn-0.7.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-support-3.10.2/lib" @@ -82,7 +82,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-1.4.1/lib $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.0.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.10.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.9.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.10.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.9.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.2.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.5.1/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/config/default.yml b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/config/default.yml similarity index 93% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/config/default.yml rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/config/default.yml index dfb20d66d7..17f3e7c249 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/config/default.yml +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/config/default.yml @@ -10,7 +10,7 @@ Performance/AncestorsInclude: Performance/ArraySemiInfiniteRangeSlice: Description: '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. - # Refer https://github.com/rubocop-hq/rubocop-performance/pull/175#issuecomment-731892717 + # Refer https://github.com/rubocop/rubocop-performance/pull/175#issuecomment-731892717 Enabled: false # Unsafe for string slices because strings do not have `#take` and `#drop` methods. Safe: false @@ -80,6 +80,7 @@ Performance/ConstantRegexp: Description: 'Finds regular expressions with dynamic components that are all constants.' Enabled: pending VersionAdded: '1.9' + VersionChanged: '1.10' Performance/Count: Description: >- @@ -136,11 +137,10 @@ Performance/EndWith: # object. Switching these methods has to be done with knowledge of the types # of the variables which rubocop doesn't have. SafeAutoCorrect: false - AutoCorrect: false Enabled: true SafeMultiline: true VersionAdded: '0.36' - VersionChanged: '1.6' + VersionChanged: '1.10' Performance/FixedSize: Description: 'Do not compute the size of statically sized objects except in constants.' @@ -200,6 +200,15 @@ Performance/RedundantBlockCall: Enabled: true VersionAdded: '0.36' +Performance/RedundantEqualityComparisonBlock: + Description: >- + Checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`, + or `Enumerable#none?` are compared with `===` or similar methods in block. + Reference: 'https://github.com/rails/rails/pull/41363' + Enabled: pending + Safe: false + VersionAdded: '1.10' + Performance/RedundantMatch: Description: >- Use `=~` instead of `String#match` or `Regexp#match` in a context where the @@ -220,6 +229,11 @@ Performance/RedundantSortBlock: Enabled: 'pending' VersionAdded: '1.7' +Performance/RedundantSplitRegexpArgument: + Description: 'This cop identifies places where `split` argument can be replaced from a deterministic regexp to a string.' + Enabled: pending + VersionAdded: '1.10' + Performance/RedundantStringChars: Description: 'Checks for redundant `String#chars`.' Enabled: 'pending' @@ -270,11 +284,10 @@ Performance/StartWith: # object. Switching these methods has to be done with knowledge of the types # of the variables which rubocop doesn't have. SafeAutoCorrect: false - AutoCorrect: false Enabled: true SafeMultiline: true VersionAdded: '0.36' - VersionChanged: '1.6' + VersionChanged: '1.10' Performance/StringInclude: Description: 'Use `String#include?` instead of a regex match with literal-only pattern.' @@ -304,7 +317,7 @@ Performance/TimesMap: Enabled: true VersionAdded: '0.36' VersionChanged: '0.50' - SafeAutoCorrect: false # see https://github.com/rubocop-hq/rubocop/issues/4658 + SafeAutoCorrect: false # see https://github.com/rubocop/rubocop/issues/4658 Performance/UnfreezeString: Description: 'Use unary plus to get an unfrozen string literal.' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop-performance.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop-performance.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop-performance.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop-performance.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/mixin/regexp_metacharacter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/mixin/regexp_metacharacter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/mixin/regexp_metacharacter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/mixin/regexp_metacharacter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/mixin/sort_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/mixin/sort_block.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/mixin/sort_block.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/mixin/sort_block.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/ancestors_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/ancestors_include.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/ancestors_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/ancestors_include.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb index 61250a3596..bb0b39ee91 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb @@ -6,7 +6,7 @@ module RuboCop # This cop 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-hq/rubocop-performance/pull/175#issuecomment-731892717 + # Refer https://github.com/rubocop/rubocop-performance/pull/175#issuecomment-731892717 # This cop is also unsafe for string slices because strings do not have `#take` and `#drop` methods. # # @example diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/big_decimal_with_numeric_argument.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/big_decimal_with_numeric_argument.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/big_decimal_with_numeric_argument.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/big_decimal_with_numeric_argument.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/bind_call.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/bind_call.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/bind_call.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/bind_call.rb index 001209171f..0e97597ba2 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/bind_call.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/bind_call.rb @@ -33,7 +33,7 @@ module RuboCop def_node_matcher :bind_with_call_method?, <<~PATTERN (send $(send - (send nil? _) :bind + _ :bind $(...)) :call $...) PATTERN @@ -64,7 +64,7 @@ module RuboCop def correction_range(receiver, node) location_of_bind = receiver.loc.selector.begin_pos - location_of_call = node.loc.end.end_pos + location_of_call = node.source_range.end.end_pos range_between(location_of_bind, location_of_call) end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/block_given_with_explicit_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/block_given_with_explicit_block.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/block_given_with_explicit_block.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/block_given_with_explicit_block.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/caller.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/caller.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/caller.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/caller.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/case_when_splat.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/case_when_splat.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/case_when_splat.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/case_when_splat.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/casecmp.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/casecmp.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/casecmp.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/casecmp.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/chain_array_allocation.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/chain_array_allocation.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/chain_array_allocation.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/chain_array_allocation.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/collection_literal_in_loop.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/collection_literal_in_loop.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/collection_literal_in_loop.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/collection_literal_in_loop.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/compare_with_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/compare_with_block.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/compare_with_block.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/compare_with_block.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/constant_regexp.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/constant_regexp.rb similarity index 76% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/constant_regexp.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/constant_regexp.rb index 09e5c0d81f..dcb55dd0fd 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/constant_regexp.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/constant_regexp.rb @@ -6,9 +6,9 @@ module RuboCop # This cop 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 - # or add an `/o` option to perform `#{}` interpolation only once and reuse that - # Regexp object. + # a regular expression. It is more efficient to extract it into a constant, + # memoize it, or add an `/o` option to perform `#{}` interpolation only once and + # reuse that Regexp object. # # @example # @@ -28,13 +28,18 @@ module RuboCop # pattern.scan(TOKEN).reject { |token| token.match?(/\A#{SEPARATORS}\Z/o) } # end # + # # good + # def separators + # @separators ||= /\A#{SEPARATORS}\Z/ + # end + # class ConstantRegexp < Base extend AutoCorrector - MSG = 'Extract this regexp into a constant or append an `/o` option to its options.' + MSG = 'Extract this regexp into a constant, memoize it, or append an `/o` option to its options.' def on_regexp(node) - return if within_const_assignment?(node) || + return if within_allowed_assignment?(node) || !include_interpolated_const?(node) || node.single_interpolation? @@ -45,8 +50,8 @@ module RuboCop private - def within_const_assignment?(node) - node.each_ancestor(:casgn).any? + def within_allowed_assignment?(node) + node.each_ancestor(:casgn, :or_asgn).any? end def_node_matcher :regexp_escape?, <<~PATTERN diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/count.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/count.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/count.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/count.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/delete_prefix.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/delete_prefix.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/delete_prefix.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/delete_prefix.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/delete_suffix.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/delete_suffix.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/delete_suffix.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/delete_suffix.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/detect.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/detect.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/detect.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/detect.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/double_start_end_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/double_start_end_with.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/double_start_end_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/double_start_end_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/end_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/end_with.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/end_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/end_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/fixed_size.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/fixed_size.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/fixed_size.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/fixed_size.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/flat_map.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/flat_map.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/flat_map.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/flat_map.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/inefficient_hash_search.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/inefficient_hash_search.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/inefficient_hash_search.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/inefficient_hash_search.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/io_readlines.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/io_readlines.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/io_readlines.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/io_readlines.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/method_object_as_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/method_object_as_block.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/method_object_as_block.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/method_object_as_block.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/open_struct.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/open_struct.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/open_struct.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/open_struct.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/range_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/range_include.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/range_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/range_include.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_block_call.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_block_call.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_block_call.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_block_call.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb new file mode 100644 index 0000000000..a3c7613c87 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Performance + # This cop 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 + # behavior is appropriately overridden in subclass. For example, + # `Range#===` returns `true` when argument is within the range. + # Therefore, It is marked as unsafe by default because `===` and `==` + # do not always behave the same. + # + # @example + # # bad + # items.all? { |item| pattern === item } + # items.all? { |item| item == other } + # items.all? { |item| item.is_a?(Klass) } + # items.all? { |item| item.kind_of?(Klass) } + # + # # good + # items.all?(pattern) + # + class RedundantEqualityComparisonBlock < Base + extend AutoCorrector + extend TargetRubyVersion + + minimum_target_ruby_version 2.5 + + MSG = 'Use `%s` instead of block.' + + TARGET_METHODS = %i[all? any? one? none?].freeze + COMPARISON_METHODS = %i[== === is_a? kind_of?].freeze + + def on_block(node) + return unless TARGET_METHODS.include?(node.method_name) + + block_argument = node.arguments.first + block_body = node.body + return unless use_equality_comparison_block?(block_body) + return unless (new_argument = new_argument(block_argument, block_body)) + + range = offense_range(node) + prefer = "#{node.method_name}(#{new_argument})" + + add_offense(range, message: format(MSG, prefer: prefer)) do |corrector| + corrector.replace(range, prefer) + end + end + + private + + def use_equality_comparison_block?(block_body) + block_body.send_type? && COMPARISON_METHODS.include?(block_body.method_name) + end + + def new_argument(block_argument, block_body) + if block_argument.source == block_body.receiver.source + block_body.first_argument.source + elsif block_argument.source == block_body.first_argument.source + block_body.receiver.source + end + end + + def offense_range(node) + node.send_node.loc.selector.join(node.source_range.end) + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_match.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_match.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_match.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_match.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_merge.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_merge.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_merge.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_merge.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_sort_block.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_sort_block.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_sort_block.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_sort_block.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_split_regexp_argument.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_split_regexp_argument.rb new file mode 100644 index 0000000000..e6a77a1df4 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_split_regexp_argument.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module RuboCop + module Cop + module Performance + # This cop identifies places where `split` argument can be replaced from + # a deterministic regexp to a string. + # + # @example + # # bad + # 'a,b,c'.split(/,/) + # + # # good + # 'a,b,c'.split(',') + class RedundantSplitRegexpArgument < Base + extend AutoCorrector + + MSG = 'Use string as argument instead of regexp.' + RESTRICT_ON_SEND = %i[split].freeze + DETERMINISTIC_REGEX = /\A(?:#{LITERAL_REGEX})+\Z/.freeze + STR_SPECIAL_CHARS = %w[\n \" \' \\\\ \t \b \f \r].freeze + + def_node_matcher :split_call_with_regexp?, <<~PATTERN + {(send !nil? :split {regexp})} + PATTERN + + def on_send(node) + return unless split_call_with_regexp?(node) + return unless determinist_regexp?(node.first_argument) + + add_offense(node.first_argument) do |corrector| + autocorrect(corrector, node) + end + end + + private + + def determinist_regexp?(first_argument) + DETERMINISTIC_REGEX.match?(first_argument.source) + end + + def autocorrect(corrector, node) + new_argument = replacement(node) + + corrector.replace(node.first_argument, "\"#{new_argument}\"") + end + + def replacement(node) + regexp_content = node.first_argument.content + stack = [] + chars = regexp_content.chars.each_with_object([]) do |char, strings| + if stack.empty? && char == '\\' + stack.push(char) + else + strings << "#{stack.pop}#{char}" + end + end + chars.map do |char| + char = char.dup + char.delete!('\\') unless STR_SPECIAL_CHARS.include?(char) + char + end.join + end + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_string_chars.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_string_chars.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/redundant_string_chars.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/redundant_string_chars.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/regexp_match.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/regexp_match.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/regexp_match.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/regexp_match.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/reverse_each.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/reverse_each.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/reverse_each.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/reverse_each.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/reverse_first.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/reverse_first.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/reverse_first.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/reverse_first.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/size.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/size.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/size.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/size.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/sort_reverse.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/sort_reverse.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/sort_reverse.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/sort_reverse.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/squeeze.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/squeeze.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/squeeze.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/squeeze.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/start_with.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/start_with.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/start_with.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/start_with.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/string_include.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/string_include.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/string_include.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/string_include.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/string_replacement.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/string_replacement.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/string_replacement.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/string_replacement.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/sum.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/sum.rb similarity index 96% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/sum.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/sum.rb index 211b17425c..df336773b3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/sum.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/sum.rb @@ -150,7 +150,9 @@ module RuboCop replacement = build_good_method(init, block_pass) corrector.remove(sum_range) - corrector.replace(map_range, ".#{replacement}") + + dot = '.' if map.receiver + corrector.replace(map_range, "#{dot}#{replacement}") end def sum_method_range(node) @@ -228,7 +230,11 @@ module RuboCop end def method_call_with_args_range(node) - node.receiver.source_range.end.join(node.source_range.end) + if (receiver = node.receiver) + receiver.source_range.end.join(node.source_range.end) + else + node.source_range + end end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/times_map.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/times_map.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/times_map.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/times_map.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/unfreeze_string.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/unfreeze_string.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/unfreeze_string.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/unfreeze_string.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/uri_default_parser.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/uri_default_parser.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance/uri_default_parser.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance/uri_default_parser.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance_cops.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance_cops.rb similarity index 94% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance_cops.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance_cops.rb index 9a37fac7ed..41ca77a3c3 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/cop/performance_cops.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/cop/performance_cops.rb @@ -28,9 +28,11 @@ require_relative 'performance/open_struct' require_relative 'performance/range_include' require_relative 'performance/io_readlines' require_relative 'performance/redundant_block_call' +require_relative 'performance/redundant_equality_comparison_block' require_relative 'performance/redundant_match' require_relative 'performance/redundant_merge' require_relative 'performance/redundant_sort_block' +require_relative 'performance/redundant_split_regexp_argument' require_relative 'performance/redundant_string_chars' require_relative 'performance/regexp_match' require_relative 'performance/reverse_each' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/performance.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/performance.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/performance.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/performance.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/performance/inject.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/performance/inject.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/performance/inject.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/performance/inject.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/performance/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/performance/version.rb similarity index 91% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/performance/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/performance/version.rb index 2f4f2209a9..c67ef22b54 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.9.2/lib/rubocop/performance/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-performance-1.10.0/lib/rubocop/performance/version.rb @@ -4,7 +4,7 @@ module RuboCop module Performance # This module holds the RuboCop Performance version information. module Version - STRING = '1.9.2' + STRING = '1.10.0' def self.document_version STRING.match('\d+\.\d+').to_s