Merge pull request #11669 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-performance-1.11.4

build(deps): bump rubocop-performance from 1.11.3 to 1.11.4 in /Library/Homebrew
This commit is contained in:
Nanda H Krishna 2021-07-08 00:12:07 +05:30 committed by GitHub
commit d5aa9f8c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 127 additions and 219 deletions

View File

@ -123,7 +123,7 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0) unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.7.0) rubocop-ast (1.7.0)
parser (>= 3.0.1.1) parser (>= 3.0.1.1)
rubocop-performance (1.11.3) rubocop-performance (1.11.4)
rubocop (>= 1.7.0, < 2.0) rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0) rubocop-ast (>= 0.4.0)
rubocop-rails (2.11.2) rubocop-rails (2.11.2)

View File

@ -4,18 +4,13 @@
# typed: true # typed: true
module RuboCop module RuboCop; end
end module RuboCop::Cop; end
module RuboCop::Cop::Performance; end
module RuboCop::Cop
end
module RuboCop::Cop::Performance
end
class RuboCop::Cop::Performance::AncestorsInclude < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::AncestorsInclude < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def ancestors_include_candidate?(param0 = T.unsafe(nil)); end def ancestors_include_candidate?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -26,13 +21,12 @@ class RuboCop::Cop::Performance::AncestorsInclude < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::AncestorsInclude::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::AncestorsInclude::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::AncestorsInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::AncestorsInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
extend(::RuboCop::Cop::TargetRubyVersion) extend ::RuboCop::Cop::TargetRubyVersion
def endless_range?(param0 = T.unsafe(nil)); end def endless_range?(param0 = T.unsafe(nil)); end
def endless_range_slice?(param0 = T.unsafe(nil)); end def endless_range_slice?(param0 = T.unsafe(nil)); end
@ -44,13 +38,11 @@ class RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice < ::RuboCop::Cop::B
end end
RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice::SLICE_METHODS = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice::SLICE_METHODS = T.let(T.unsafe(nil), Set)
class RuboCop::Cop::Performance::BigDecimalWithNumericArgument < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::BigDecimalWithNumericArgument < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def big_decimal_with_numeric_argument?(param0 = T.unsafe(nil)); end def big_decimal_with_numeric_argument?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -61,13 +53,12 @@ class RuboCop::Cop::Performance::BigDecimalWithNumericArgument < ::RuboCop::Cop:
end end
RuboCop::Cop::Performance::BigDecimalWithNumericArgument::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::BigDecimalWithNumericArgument::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::BigDecimalWithNumericArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::BigDecimalWithNumericArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::BindCall < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::BindCall < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
extend(::RuboCop::Cop::TargetRubyVersion) extend ::RuboCop::Cop::TargetRubyVersion
def bind_with_call_method?(param0 = T.unsafe(nil)); end def bind_with_call_method?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -80,22 +71,20 @@ class RuboCop::Cop::Performance::BindCall < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::BindCall::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::BindCall::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::BindCall::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::BindCall::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::BlockGivenWithExplicitBlock < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::BlockGivenWithExplicitBlock < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def reassigns_block_arg?(param0 = T.unsafe(nil), param1); end def reassigns_block_arg?(param0 = T.unsafe(nil), param1); end
end end
RuboCop::Cop::Performance::BlockGivenWithExplicitBlock::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::BlockGivenWithExplicitBlock::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::BlockGivenWithExplicitBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::BlockGivenWithExplicitBlock::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::Caller < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::Caller < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def caller_with_scope_method?(param0 = T.unsafe(nil)); end def caller_with_scope_method?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -107,13 +96,12 @@ class RuboCop::Cop::Performance::Caller < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::Caller::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Caller::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Caller::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::Caller::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::CaseWhenSplat < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::CaseWhenSplat < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment) include ::RuboCop::Cop::Alignment
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_case(case_node); end def on_case(case_node); end
@ -135,11 +123,10 @@ class RuboCop::Cop::Performance::CaseWhenSplat < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::CaseWhenSplat::ARRAY_MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::CaseWhenSplat::ARRAY_MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::CaseWhenSplat::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::CaseWhenSplat::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::Casecmp < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::Casecmp < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def downcase_downcase(param0 = T.unsafe(nil)); end def downcase_downcase(param0 = T.unsafe(nil)); end
def downcase_eq(param0 = T.unsafe(nil)); end def downcase_eq(param0 = T.unsafe(nil)); end
@ -154,28 +141,21 @@ class RuboCop::Cop::Performance::Casecmp < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::Casecmp::CASE_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::Casecmp::CASE_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::Casecmp::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Casecmp::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Casecmp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::Casecmp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::ChainArrayAllocation < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::ChainArrayAllocation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
def chain_array_allocation?(param0 = T.unsafe(nil)); end def chain_array_allocation?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
end end
RuboCop::Cop::Performance::ChainArrayAllocation::ALWAYS_RETURNS_NEW_ARRAY = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::ChainArrayAllocation::ALWAYS_RETURNS_NEW_ARRAY = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::ChainArrayAllocation::HAS_MUTATION_ALTERNATIVE = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::ChainArrayAllocation::HAS_MUTATION_ALTERNATIVE = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::ChainArrayAllocation::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::ChainArrayAllocation::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::ChainArrayAllocation::RETURNS_NEW_ARRAY = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::ChainArrayAllocation::RETURNS_NEW_ARRAY = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::ChainArrayAllocation::RETURNS_NEW_ARRAY_WHEN_NO_BLOCK = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::ChainArrayAllocation::RETURNS_NEW_ARRAY_WHEN_NO_BLOCK = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::ChainArrayAllocation::RETURN_NEW_ARRAY_WHEN_ARGS = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::ChainArrayAllocation::RETURN_NEW_ARRAY_WHEN_ARGS = T.let(T.unsafe(nil), Set)
class RuboCop::Cop::Performance::CollectionLiteralInLoop < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::CollectionLiteralInLoop < ::RuboCop::Cop::Base
@ -197,24 +177,17 @@ class RuboCop::Cop::Performance::CollectionLiteralInLoop < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::CollectionLiteralInLoop::ARRAY_METHODS = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::CollectionLiteralInLoop::ARRAY_METHODS = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::CollectionLiteralInLoop::ENUMERABLE_METHOD_NAMES = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::CollectionLiteralInLoop::ENUMERABLE_METHOD_NAMES = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::CollectionLiteralInLoop::HASH_METHODS = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::CollectionLiteralInLoop::HASH_METHODS = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::CollectionLiteralInLoop::LOOP_TYPES = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::CollectionLiteralInLoop::LOOP_TYPES = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::CollectionLiteralInLoop::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::CollectionLiteralInLoop::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::CollectionLiteralInLoop::NONMUTATING_ARRAY_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::CollectionLiteralInLoop::NONMUTATING_ARRAY_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::CollectionLiteralInLoop::NONMUTATING_HASH_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::CollectionLiteralInLoop::NONMUTATING_HASH_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::CollectionLiteralInLoop::POST_CONDITION_LOOP_TYPES = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::CollectionLiteralInLoop::POST_CONDITION_LOOP_TYPES = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::CompareWithBlock < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::CompareWithBlock < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def compare?(param0 = T.unsafe(nil)); end def compare?(param0 = T.unsafe(nil)); end
def on_block(node); end def on_block(node); end
@ -230,7 +203,7 @@ end
RuboCop::Cop::Performance::CompareWithBlock::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::CompareWithBlock::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::ConstantRegexp < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::ConstantRegexp < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_regexp(node); end def on_regexp(node); end
def regexp_escape?(param0 = T.unsafe(nil)); end def regexp_escape?(param0 = T.unsafe(nil)); end
@ -244,8 +217,8 @@ end
RuboCop::Cop::Performance::ConstantRegexp::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::ConstantRegexp::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::Count < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::Count < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def count_candidate?(param0 = T.unsafe(nil)); end def count_candidate?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -258,41 +231,36 @@ class RuboCop::Cop::Performance::Count < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::Count::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Count::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Count::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::Count::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::DeletePrefix < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::DeletePrefix < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RegexpMetacharacter) include ::RuboCop::Cop::RegexpMetacharacter
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
extend(::RuboCop::Cop::TargetRubyVersion) extend ::RuboCop::Cop::TargetRubyVersion
def delete_prefix_candidate?(param0 = T.unsafe(nil)); end def delete_prefix_candidate?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
end end
RuboCop::Cop::Performance::DeletePrefix::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::DeletePrefix::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::DeletePrefix::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash) RuboCop::Cop::Performance::DeletePrefix::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash)
RuboCop::Cop::Performance::DeletePrefix::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::DeletePrefix::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::DeleteSuffix < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::DeleteSuffix < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RegexpMetacharacter) include ::RuboCop::Cop::RegexpMetacharacter
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
extend(::RuboCop::Cop::TargetRubyVersion) extend ::RuboCop::Cop::TargetRubyVersion
def delete_suffix_candidate?(param0 = T.unsafe(nil)); end def delete_suffix_candidate?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
end end
RuboCop::Cop::Performance::DeleteSuffix::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::DeleteSuffix::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::DeleteSuffix::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash) RuboCop::Cop::Performance::DeleteSuffix::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash)
RuboCop::Cop::Performance::DeleteSuffix::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::DeleteSuffix::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::Detect < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::Detect < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def detect_candidate?(param0 = T.unsafe(nil)); end def detect_candidate?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -309,19 +277,14 @@ class RuboCop::Cop::Performance::Detect < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::Detect::CANDIDATE_METHODS = T.let(T.unsafe(nil), Set) RuboCop::Cop::Performance::Detect::CANDIDATE_METHODS = T.let(T.unsafe(nil), Set)
RuboCop::Cop::Performance::Detect::INDEX_MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Detect::INDEX_MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Detect::INDEX_REVERSE_MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Detect::INDEX_REVERSE_MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Detect::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Detect::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Detect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::Detect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::Detect::REVERSE_MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Detect::REVERSE_MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::DoubleStartEndWith < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::DoubleStartEndWith < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def check_with_active_support_aliases(param0 = T.unsafe(nil)); end def check_with_active_support_aliases(param0 = T.unsafe(nil)); end
def on_or(node); end def on_or(node); end
@ -339,8 +302,8 @@ end
RuboCop::Cop::Performance::DoubleStartEndWith::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::DoubleStartEndWith::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::EndWith < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::EndWith < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RegexpMetacharacter) include ::RuboCop::Cop::RegexpMetacharacter
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_match_with_lvasgn(node); end def on_match_with_lvasgn(node); end
def on_send(node); end def on_send(node); end
@ -348,7 +311,6 @@ class RuboCop::Cop::Performance::EndWith < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::EndWith::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::EndWith::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::EndWith::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::EndWith::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::FixedSize < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::FixedSize < ::RuboCop::Cop::Base
@ -366,12 +328,11 @@ class RuboCop::Cop::Performance::FixedSize < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::FixedSize::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::FixedSize::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::FixedSize::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::FixedSize::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::FlatMap < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::FlatMap < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def flat_map_candidate?(param0 = T.unsafe(nil)); end def flat_map_candidate?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -385,13 +346,11 @@ class RuboCop::Cop::Performance::FlatMap < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::FlatMap::FLATTEN_MULTIPLE_LEVELS = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::FlatMap::FLATTEN_MULTIPLE_LEVELS = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::FlatMap::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::FlatMap::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::FlatMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::FlatMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::InefficientHashSearch < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::InefficientHashSearch < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def inefficient_include?(param0 = T.unsafe(nil)); end def inefficient_include?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -409,8 +368,8 @@ end
RuboCop::Cop::Performance::InefficientHashSearch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::InefficientHashSearch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::IoReadlines < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::IoReadlines < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def readlines_on_class?(param0 = T.unsafe(nil)); end def readlines_on_class?(param0 = T.unsafe(nil)); end
@ -427,25 +386,23 @@ class RuboCop::Cop::Performance::IoReadlines < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::IoReadlines::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::IoReadlines::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::IoReadlines::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::IoReadlines::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::MapCompact < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::MapCompact < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
extend(::RuboCop::Cop::TargetRubyVersion) extend ::RuboCop::Cop::TargetRubyVersion
def map_compact(param0 = T.unsafe(nil)); end def map_compact(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
private private
def compact_method_range(compact_node); end
def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method); end def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method); end
def remove_compact_method(corrector, compact_node); end
end end
RuboCop::Cop::Performance::MapCompact::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::MapCompact::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::MapCompact::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::MapCompact::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::MethodObjectAsBlock < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::MethodObjectAsBlock < ::RuboCop::Cop::Base
@ -461,22 +418,20 @@ class RuboCop::Cop::Performance::OpenStruct < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::OpenStruct::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::OpenStruct::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::OpenStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::OpenStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::RangeInclude < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RangeInclude < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def range_include(param0 = T.unsafe(nil)); end def range_include(param0 = T.unsafe(nil)); end
end end
RuboCop::Cop::Performance::RangeInclude::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RangeInclude::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RangeInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::RangeInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::RedundantBlockCall < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RedundantBlockCall < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def blockarg_assigned?(param0, param1); end def blockarg_assigned?(param0, param1); end
def blockarg_calls(param0, param1); end def blockarg_calls(param0, param1); end
@ -492,18 +447,14 @@ class RuboCop::Cop::Performance::RedundantBlockCall < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::RedundantBlockCall::CLOSE_PAREN = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantBlockCall::CLOSE_PAREN = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantBlockCall::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantBlockCall::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantBlockCall::OPEN_PAREN = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantBlockCall::OPEN_PAREN = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantBlockCall::SPACE = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantBlockCall::SPACE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantBlockCall::YIELD = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantBlockCall::YIELD = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::RedundantEqualityComparisonBlock < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RedundantEqualityComparisonBlock < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
extend(::RuboCop::Cop::TargetRubyVersion) extend ::RuboCop::Cop::TargetRubyVersion
def on_block(node); end def on_block(node); end
@ -517,15 +468,12 @@ class RuboCop::Cop::Performance::RedundantEqualityComparisonBlock < ::RuboCop::C
end end
RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::COMPARISON_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::COMPARISON_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::IS_A_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::IS_A_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::TARGET_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::TARGET_METHODS = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::RedundantMatch < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RedundantMatch < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def match_call?(param0 = T.unsafe(nil)); end def match_call?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -537,11 +485,10 @@ class RuboCop::Cop::Performance::RedundantMatch < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::RedundantMatch::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantMatch::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::RedundantMatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::RedundantMerge < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RedundantMerge < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def modifier_flow_control?(param0 = T.unsafe(nil)); end def modifier_flow_control?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -567,7 +514,7 @@ end
RuboCop::Cop::Performance::RedundantMerge::AREF_ASGN = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantMerge::AREF_ASGN = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::RedundantMerge::EachWithObjectInspector class RuboCop::Cop::Performance::RedundantMerge::EachWithObjectInspector
extend(::RuboCop::AST::NodePattern::Macros) extend ::RuboCop::AST::NodePattern::Macros
def initialize(node, receiver); end def initialize(node, receiver); end
@ -584,15 +531,13 @@ class RuboCop::Cop::Performance::RedundantMerge::EachWithObjectInspector
end end
RuboCop::Cop::Performance::RedundantMerge::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantMerge::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantMerge::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::RedundantMerge::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::RedundantMerge::WITH_MODIFIER_CORRECTION = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantMerge::WITH_MODIFIER_CORRECTION = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::RedundantSortBlock < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RedundantSortBlock < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
include(::RuboCop::Cop::SortBlock) include ::RuboCop::Cop::SortBlock
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_block(node); end def on_block(node); end
@ -604,7 +549,7 @@ end
RuboCop::Cop::Performance::RedundantSortBlock::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantSortBlock::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::RedundantSplitRegexpArgument < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RedundantSplitRegexpArgument < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def split_call_with_regexp?(param0 = T.unsafe(nil)); end def split_call_with_regexp?(param0 = T.unsafe(nil)); end
@ -616,16 +561,13 @@ class RuboCop::Cop::Performance::RedundantSplitRegexpArgument < ::RuboCop::Cop::
end end
RuboCop::Cop::Performance::RedundantSplitRegexpArgument::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp) 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::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantSplitRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) 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) RuboCop::Cop::Performance::RedundantSplitRegexpArgument::STR_SPECIAL_CHARS = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::RedundantStringChars < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RedundantStringChars < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def redundant_chars_call?(param0 = T.unsafe(nil)); end def redundant_chars_call?(param0 = T.unsafe(nil)); end
@ -641,11 +583,10 @@ class RuboCop::Cop::Performance::RedundantStringChars < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::RedundantStringChars::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantStringChars::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RedundantStringChars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::RedundantStringChars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::RegexpMatch < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::RegexpMatch < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def last_matches(param0); end def last_matches(param0); end
def match_method?(param0 = T.unsafe(nil)); end def match_method?(param0 = T.unsafe(nil)); end
@ -678,14 +619,12 @@ class RuboCop::Cop::Performance::RegexpMatch < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::RegexpMatch::MATCH_NODE_PATTERN = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RegexpMatch::MATCH_NODE_PATTERN = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RegexpMatch::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RegexpMatch::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::RegexpMatch::TYPES_IMPLEMENTING_MATCH = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::RegexpMatch::TYPES_IMPLEMENTING_MATCH = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::ReverseEach < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::ReverseEach < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def reverse_each?(param0 = T.unsafe(nil)); end def reverse_each?(param0 = T.unsafe(nil)); end
@ -697,12 +636,11 @@ class RuboCop::Cop::Performance::ReverseEach < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::ReverseEach::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::ReverseEach::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::ReverseEach::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::ReverseEach::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::ReverseFirst < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::ReverseFirst < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def reverse_first_candidate?(param0 = T.unsafe(nil)); end def reverse_first_candidate?(param0 = T.unsafe(nil)); end
@ -716,12 +654,11 @@ class RuboCop::Cop::Performance::ReverseFirst < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::ReverseFirst::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::ReverseFirst::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::ReverseFirst::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::ReverseFirst::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::SelectMap < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::SelectMap < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::TargetRubyVersion) extend ::RuboCop::Cop::TargetRubyVersion
def bad_method?(param0 = T.unsafe(nil)); end def bad_method?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -733,11 +670,10 @@ class RuboCop::Cop::Performance::SelectMap < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::SelectMap::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::SelectMap::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::SelectMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::SelectMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::Size < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::Size < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def array?(param0 = T.unsafe(nil)); end def array?(param0 = T.unsafe(nil)); end
def count?(param0 = T.unsafe(nil)); end def count?(param0 = T.unsafe(nil)); end
@ -746,13 +682,12 @@ class RuboCop::Cop::Performance::Size < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::Size::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Size::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Size::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::Size::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::SortReverse < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::SortReverse < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
include(::RuboCop::Cop::SortBlock) include ::RuboCop::Cop::SortBlock
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_block(node); end def on_block(node); end
@ -764,7 +699,7 @@ end
RuboCop::Cop::Performance::SortReverse::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::SortReverse::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::Squeeze < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::Squeeze < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def squeeze_candidate?(param0 = T.unsafe(nil)); end def squeeze_candidate?(param0 = T.unsafe(nil)); end
@ -775,14 +710,12 @@ class RuboCop::Cop::Performance::Squeeze < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::Squeeze::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Squeeze::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Squeeze::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash) RuboCop::Cop::Performance::Squeeze::PREFERRED_METHODS = T.let(T.unsafe(nil), Hash)
RuboCop::Cop::Performance::Squeeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::Squeeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::StartWith < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::StartWith < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RegexpMetacharacter) include ::RuboCop::Cop::RegexpMetacharacter
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_match_with_lvasgn(node); end def on_match_with_lvasgn(node); end
def on_send(node); end def on_send(node); end
@ -790,11 +723,10 @@ class RuboCop::Cop::Performance::StartWith < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::StartWith::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::StartWith::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::StartWith::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::StartWith::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::StringInclude < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::StringInclude < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_match_with_lvasgn(node); end def on_match_with_lvasgn(node); end
def on_send(node); end def on_send(node); end
@ -806,12 +738,11 @@ class RuboCop::Cop::Performance::StringInclude < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::StringInclude::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::StringInclude::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::StringInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::StringInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::StringReplacement < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::StringReplacement < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def string_replacement?(param0 = T.unsafe(nil)); end def string_replacement?(param0 = T.unsafe(nil)); end
@ -834,20 +765,15 @@ class RuboCop::Cop::Performance::StringReplacement < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::StringReplacement::BANG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::StringReplacement::BANG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::StringReplacement::DELETE = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::StringReplacement::DELETE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::StringReplacement::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp) RuboCop::Cop::Performance::StringReplacement::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp)
RuboCop::Cop::Performance::StringReplacement::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::StringReplacement::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::StringReplacement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::StringReplacement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Performance::StringReplacement::TR = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::StringReplacement::TR = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Performance::Sum < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::Sum < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def acc_plus_elem?(param0 = T.unsafe(nil), param1, param2); end def acc_plus_elem?(param0 = T.unsafe(nil), param1, param2); end
def elem_plus_acc?(param0 = T.unsafe(nil), param1, param2); end def elem_plus_acc?(param0 = T.unsafe(nil), param1, param2); end
@ -878,13 +804,11 @@ class RuboCop::Cop::Performance::Sum < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::Sum::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Sum::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Sum::MSG_IF_NO_INIT_VALUE = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::Sum::MSG_IF_NO_INIT_VALUE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::Sum::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::Sum::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::TimesMap < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::TimesMap < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_block(node); end def on_block(node); end
def on_send(node); end def on_send(node); end
@ -897,13 +821,11 @@ class RuboCop::Cop::Performance::TimesMap < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::TimesMap::MESSAGE = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::TimesMap::MESSAGE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::TimesMap::MESSAGE_ONLY_IF = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::TimesMap::MESSAGE_ONLY_IF = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::TimesMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::TimesMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::UnfreezeString < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::UnfreezeString < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def dup_string?(param0 = T.unsafe(nil)); end def dup_string?(param0 = T.unsafe(nil)); end
def on_send(node); end def on_send(node); end
@ -915,22 +837,19 @@ class RuboCop::Cop::Performance::UnfreezeString < ::RuboCop::Cop::Base
end end
RuboCop::Cop::Performance::UnfreezeString::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::UnfreezeString::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::UnfreezeString::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::UnfreezeString::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Performance::UriDefaultParser < ::RuboCop::Cop::Base class RuboCop::Cop::Performance::UriDefaultParser < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector) extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end def on_send(node); end
def uri_parser_new?(param0 = T.unsafe(nil)); end def uri_parser_new?(param0 = T.unsafe(nil)); end
end end
RuboCop::Cop::Performance::UriDefaultParser::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::UriDefaultParser::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::UriDefaultParser::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Performance::UriDefaultParser::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
module RuboCop::Cop::RegexpMetacharacter module RuboCop::Cop::RegexpMetacharacter
private private
def drop_end_metacharacter(regexp_string); end def drop_end_metacharacter(regexp_string); end
@ -945,8 +864,8 @@ module RuboCop::Cop::RegexpMetacharacter
end end
module RuboCop::Cop::SortBlock module RuboCop::Cop::SortBlock
include(::RuboCop::Cop::RangeHelp) include ::RuboCop::Cop::RangeHelp
extend(::RuboCop::AST::NodePattern::Macros) extend ::RuboCop::AST::NodePattern::Macros
def replaceable_body?(param0 = T.unsafe(nil), param1, param2); end def replaceable_body?(param0 = T.unsafe(nil), param1, param2); end
def sort_with_block?(param0 = T.unsafe(nil)); end def sort_with_block?(param0 = T.unsafe(nil)); end
@ -957,11 +876,9 @@ module RuboCop::Cop::SortBlock
end end
RuboCop::NodePattern = RuboCop::AST::NodePattern RuboCop::NodePattern = RuboCop::AST::NodePattern
module RuboCop::Performance; end
module RuboCop::Performance
end
RuboCop::Performance::CONFIG = T.let(T.unsafe(nil), Hash) RuboCop::Performance::CONFIG = T.let(T.unsafe(nil), Hash)
RuboCop::Performance::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname)
module RuboCop::Performance::Inject module RuboCop::Performance::Inject
class << self class << self
@ -969,6 +886,8 @@ module RuboCop::Performance::Inject
end end
end end
RuboCop::Performance::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname)
module RuboCop::Performance::Version module RuboCop::Performance::Version
class << self class << self
def document_version; end def document_version; end
@ -976,7 +895,5 @@ module RuboCop::Performance::Version
end end
RuboCop::Performance::Version::STRING = T.let(T.unsafe(nil), String) RuboCop::Performance::Version::STRING = T.let(T.unsafe(nil), String)
RuboCop::ProcessedSource = RuboCop::AST::ProcessedSource RuboCop::ProcessedSource = RuboCop::AST::ProcessedSource
RuboCop::Token = RuboCop::AST::Token RuboCop::Token = RuboCop::AST::Token

View File

@ -82,7 +82,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-1.7.0/lib
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11.0/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/unicode-display_width-2.0.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.17.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.17.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.11.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.11.4/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.11.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.11.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.4.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.4.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.2/lib"

View File

@ -96,14 +96,18 @@ Performance/Count:
Performance/DeletePrefix: Performance/DeletePrefix:
Description: 'Use `delete_prefix` instead of `gsub`.' Description: 'Use `delete_prefix` instead of `gsub`.'
Enabled: true Enabled: true
Safe: false
SafeMultiline: true SafeMultiline: true
VersionAdded: '1.6' VersionAdded: '1.6'
VersionChanged: '1.11'
Performance/DeleteSuffix: Performance/DeleteSuffix:
Description: 'Use `delete_suffix` instead of `gsub`.' Description: 'Use `delete_suffix` instead of `gsub`.'
Enabled: true Enabled: true
Safe: false
SafeMultiline: true SafeMultiline: true
VersionAdded: '1.6' VersionAdded: '1.6'
VersionChanged: '1.11'
Performance/Detect: Performance/Detect:
Description: >- Description: >-

View File

@ -11,11 +11,11 @@ module RuboCop
# #
# @example # @example
# # bad # # bad
# # array[..2] # array[..2]
# # array[...2] # array[...2]
# # array[2..] # array[2..]
# # array[2...] # array[2...]
# # array.slice(..2) # array.slice(..2)
# #
# # good # # good
# array.take(3) # array.take(3)

View File

@ -58,10 +58,8 @@ module RuboCop
include RangeHelp include RangeHelp
extend AutoCorrector extend AutoCorrector
MSG = 'Reordering `when` conditions with a splat to the end ' \ MSG = 'Reordering `when` conditions with a splat to the end of the `when` branches can improve performance.'
'of the `when` branches can improve performance.' ARRAY_MSG = 'Pass the contents of array literals directly to `when` conditions.'
ARRAY_MSG = 'Pass the contents of array literals ' \
'directly to `when` conditions.'
def on_case(case_node) def on_case(case_node)
when_conditions = case_node.when_branches.flat_map(&:conditions) when_conditions = case_node.when_branches.flat_map(&:conditions)
@ -134,13 +132,11 @@ module RuboCop
end end
def new_condition_with_then(node, new_condition) def new_condition_with_then(node, new_condition)
"\n#{indent_for(node)}when " \ "\n#{indent_for(node)}when #{new_condition} then #{node.body.source}"
"#{new_condition} then #{node.body.source}"
end end
def new_branch_without_then(node, new_condition) def new_branch_without_then(node, new_condition)
"\n#{indent_for(node)}when #{new_condition}" \ "\n#{indent_for(node)}when #{new_condition}\n#{indent_for(node.body)}#{node.body.source}"
"\n#{indent_for(node.body)}#{node.body.source}"
end end
def indent_for(node) def indent_for(node)

View File

@ -33,7 +33,7 @@ module RuboCop
# #
class CollectionLiteralInLoop < Base 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.' 'It is better to extract it into a local variable or a constant.'
POST_CONDITION_LOOP_TYPES = %i[while_post until_post].freeze POST_CONDITION_LOOP_TYPES = %i[while_post until_post].freeze
LOOP_TYPES = (POST_CONDITION_LOOP_TYPES + %i[while until for]).freeze LOOP_TYPES = (POST_CONDITION_LOOP_TYPES + %i[while until for]).freeze

View File

@ -7,6 +7,7 @@ module RuboCop
# #
# This cop identifies places where `gsub(/\Aprefix/, '')` and `sub(/\Aprefix/, '')` # This cop identifies places where `gsub(/\Aprefix/, '')` and `sub(/\Aprefix/, '')`
# can be replaced by `delete_prefix('prefix')`. # can be replaced by `delete_prefix('prefix')`.
# It is marked as unsafe by default because `Pathname` has `sub` but not `delete_prefix`.
# #
# This cop has `SafeMultiline` configuration option that `true` by default because # This cop has `SafeMultiline` configuration option that `true` by default because
# `^prefix` is unsafe as it will behave incompatible with `delete_prefix` # `^prefix` is unsafe as it will behave incompatible with `delete_prefix`
@ -66,7 +67,7 @@ module RuboCop
def on_send(node) def on_send(node)
return unless (receiver, bad_method, regexp_str, replace_string = delete_prefix_candidate?(node)) return unless (receiver, bad_method, regexp_str, replace_string = delete_prefix_candidate?(node))
return unless replace_string.blank? return unless replace_string.empty?
good_method = PREFERRED_METHODS[bad_method] good_method = PREFERRED_METHODS[bad_method]

View File

@ -7,6 +7,7 @@ module RuboCop
# #
# This cop identifies places where `gsub(/suffix\z/, '')` and `sub(/suffix\z/, '')` # This cop identifies places where `gsub(/suffix\z/, '')` and `sub(/suffix\z/, '')`
# can be replaced by `delete_suffix('suffix')`. # can be replaced by `delete_suffix('suffix')`.
# It is marked as unsafe by default because `Pathname` has `sub` but not `delete_suffix`.
# #
# This cop has `SafeMultiline` configuration option that `true` by default because # This cop has `SafeMultiline` configuration option that `true` by default because
# `suffix$` is unsafe as it will behave incompatible with `delete_suffix?` # `suffix$` is unsafe as it will behave incompatible with `delete_suffix?`
@ -66,7 +67,7 @@ module RuboCop
def on_send(node) def on_send(node)
return unless (receiver, bad_method, regexp_str, replace_string = delete_suffix_candidate?(node)) return unless (receiver, bad_method, regexp_str, replace_string = delete_suffix_candidate?(node))
return unless replace_string.blank? return unless replace_string.empty?
good_method = PREFERRED_METHODS[bad_method] good_method = PREFERRED_METHODS[bad_method]

View File

@ -31,14 +31,10 @@ module RuboCop
CANDIDATE_METHODS = Set[:select, :find_all, :filter].freeze CANDIDATE_METHODS = Set[:select, :find_all, :filter].freeze
MSG = 'Use `%<prefer>s` instead of ' \ MSG = 'Use `%<prefer>s` instead of `%<first_method>s.%<second_method>s`.'
'`%<first_method>s.%<second_method>s`.' REVERSE_MSG = 'Use `reverse.%<prefer>s` instead of `%<first_method>s.%<second_method>s`.'
REVERSE_MSG = 'Use `reverse.%<prefer>s` instead of ' \ INDEX_MSG = 'Use `%<prefer>s` instead of `%<first_method>s[%<index>i]`.'
'`%<first_method>s.%<second_method>s`.' INDEX_REVERSE_MSG = 'Use `reverse.%<prefer>s` instead of `%<first_method>s[%<index>i]`.'
INDEX_MSG = 'Use `%<prefer>s` instead of ' \
'`%<first_method>s[%<index>i]`.'
INDEX_REVERSE_MSG = 'Use `reverse.%<prefer>s` instead of ' \
'`%<first_method>s[%<index>i]`.'
RESTRICT_ON_SEND = %i[first last []].freeze RESTRICT_ON_SEND = %i[first last []].freeze
def_node_matcher :detect_candidate?, <<~PATTERN def_node_matcher :detect_candidate?, <<~PATTERN

View File

@ -56,23 +56,24 @@ module RuboCop
add_offense(range) do |corrector| add_offense(range) do |corrector|
corrector.replace(map_node.loc.selector, 'filter_map') corrector.replace(map_node.loc.selector, 'filter_map')
corrector.remove(compact_loc.dot) remove_compact_method(corrector, node)
corrector.remove(compact_method_range(node))
end end
end end
private private
def compact_method_range(compact_node) def remove_compact_method(corrector, compact_node)
chained_method = compact_node.parent chained_method = compact_node.parent
compact_method_range = compact_node.loc.selector compact_method_range = compact_node.loc.selector
if compact_node.multiline? && chained_method&.loc.respond_to?(:selector) && if compact_node.multiline? && chained_method&.loc.respond_to?(:selector) &&
!invoke_method_after_map_compact_on_same_line?(compact_node, chained_method) !invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)
range_by_whole_lines(compact_method_range, include_final_newline: true) compact_method_range = range_by_whole_lines(compact_method_range, include_final_newline: true)
else else
compact_method_range corrector.remove(compact_node.loc.dot)
end end
corrector.remove(compact_method_range)
end end
def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method) def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method)

View File

@ -16,35 +16,35 @@ module RuboCop
# # bad # # bad
# str.chars.first # str.chars.first
# str.chars.first(2) # str.chars.first(2)
# str.chars.last
# str.chars.last(2)
# #
# # good # # good
# str[0] # str[0]
# str[0...2].chars # str[0...2].chars
# str[-1]
# str[-2..-1].chars
# #
# # bad # # bad
# str.chars.take(2) # str.chars.take(2)
# str.chars.drop(2)
# str.chars.length # str.chars.length
# str.chars.size # str.chars.size
# str.chars.empty? # str.chars.empty?
# #
# # good # # good
# str[0...2].chars # str[0...2].chars
# str[2..-1].chars
# str.length # str.length
# str.size # str.size
# str.empty? # str.empty?
# #
# # For example, if the receiver is a blank string, it will be incompatible.
# # If a negative value is specified for the receiver, `nil` is returned.
# str.chars.last # Incompatible with `str[-1]`.
# str.chars.last(2) # Incompatible with `str[-2..-1].chars`.
# str.chars.drop(2) # Incompatible with `str[2..-1].chars`.
#
class RedundantStringChars < Base class RedundantStringChars < Base
include RangeHelp include RangeHelp
extend AutoCorrector extend AutoCorrector
MSG = 'Use `%<good_method>s` instead of `%<bad_method>s`.' MSG = 'Use `%<good_method>s` instead of `%<bad_method>s`.'
RESTRICT_ON_SEND = %i[[] slice first last take drop length size empty?].freeze RESTRICT_ON_SEND = %i[[] slice first take length size empty?].freeze
def_node_matcher :redundant_chars_call?, <<~PATTERN def_node_matcher :redundant_chars_call?, <<~PATTERN
(send $(send _ :chars) $_ $...) (send $(send _ :chars) $_ $...)
@ -80,7 +80,6 @@ module RuboCop
format(MSG, good_method: good_method, bad_method: bad_method) format(MSG, good_method: good_method, bad_method: bad_method)
end end
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
def build_good_method(method, args) def build_good_method(method, args)
case method case method
when :[], :slice when :[], :slice
@ -91,21 +90,12 @@ module RuboCop
else else
'[0]' '[0]'
end end
when :last
if args.any?
"[-#{args.first.source}..-1].chars"
else
'[-1]'
end
when :take when :take
"[0...#{args.first.source}].chars" "[0...#{args.first.source}].chars"
when :drop
"[#{args.first.source}..-1].chars"
else else
".#{method}" ".#{method}"
end end
end end
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength
def build_bad_method(method, args) def build_bad_method(method, args)
case method case method

View File

@ -78,8 +78,7 @@ module RuboCop
# Constants are included in this list because it is unlikely that # Constants are included in this list because it is unlikely that
# someone will store `nil` as a constant and then use it for comparison # someone will store `nil` as a constant and then use it for comparison
TYPES_IMPLEMENTING_MATCH = %i[const regexp str sym].freeze TYPES_IMPLEMENTING_MATCH = %i[const regexp str sym].freeze
MSG = 'Use `match?` instead of `%<current>s` when `MatchData` ' \ MSG = 'Use `match?` instead of `%<current>s` when `MatchData` is not used.'
'is not used.'
def_node_matcher :match_method?, <<~PATTERN def_node_matcher :match_method?, <<~PATTERN
{ {

View File

@ -45,7 +45,10 @@ module RuboCop
return unless dup_string?(node) || string_new?(node) return unless dup_string?(node) || string_new?(node)
add_offense(node) do |corrector| add_offense(node) do |corrector|
corrector.replace(node, "+#{string_value(node)}") string_value = "+#{string_value(node)}"
string_value = "(#{string_value})" if node.parent&.send_type?
corrector.replace(node, string_value)
end end
end end

View File

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