Skip to content

Commit

Permalink
Fix AllowRegexpMatch of `Performance/RedundantEqualityComparisonBlo…
Browse files Browse the repository at this point in the history
…ck` by default

This PR fixes `AllowRegexpMatch` of `Performance/RedundantEqualityComparisonBlock` by default.

Default value is true as documented example below:
https://docs.rubocop.org/rubocop-performance/cops_performance.html#performanceredundantequalitycomparisonblock
  • Loading branch information
koic committed Apr 9, 2023
1 parent c6abfdd commit 91b35ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#352](https://github.com/rubocop/rubocop-performance/pull/352): Fix the default config for `AllowRegexpMatch` option of `Performance/RedundantEqualityComparisonBlock`. ([@koic][])
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 91b35ba

Please sign in to comment.