diff --git a/changelog/fix_default_config_of_redundant_equality_comparison_block.md b/changelog/fix_default_config_of_redundant_equality_comparison_block.md new file mode 100644 index 0000000000..24b73ea118 --- /dev/null +++ b/changelog/fix_default_config_of_redundant_equality_comparison_block.md @@ -0,0 +1 @@ +* [#352](https://github.com/rubocop/rubocop-performance/pull/352): Fix the default config for `AllowRegexpMatch` option of `Performance/RedundantEqualityComparisonBlock`. ([@koic][]) diff --git a/config/default.yml b/config/default.yml index a345fb8dc6..6993c89521 100644 --- a/config/default.yml +++ b/config/default.yml @@ -226,7 +226,7 @@ Performance/RedundantEqualityComparisonBlock: Reference: 'https://github.com/rails/rails/pull/41363' Enabled: pending Safe: false - AllowRegexpMatch: false + AllowRegexpMatch: true VersionAdded: '1.10' Performance/RedundantMatch: diff --git a/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb b/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb index ff1771de6a..2600f5c969 100644 --- a/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb +++ b/lib/rubocop/cop/performance/redundant_equality_comparison_block.rb @@ -10,7 +10,7 @@ module Performance # behavior is appropriately overridden in subclass. For example, # `Range#===` returns `true` when argument is within the range. # - # This cop has `AllowRegexpMatch` option and it is false by default because + # This cop has `AllowRegexpMatch` option and it is true by default because # `regexp.match?('string')` often used in block changes to the opposite result: # # [source,ruby]