Skip to content

Commit

Permalink
Unmark AutoCorrect: false from Performance/StringInclude
Browse files Browse the repository at this point in the history
This `AutoCorrect: false` looks like it was set when there was no way
to safe autocorrect by `SafeAutocorrect: false`.

Test code for the autocorrection exists. So it can be enabled by default.
However, it is still unsafe because `SafeAutocorrect: false`.
  • Loading branch information
koic committed Oct 10, 2021
1 parent 51d23b2 commit 991a414
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
@@ -0,0 +1 @@
* [#263](https://github.com/rubocop/rubocop-performance/pull/263): Unmark `AutoCorrect: false` from `Performance/StringInclude`. ([@koic][])
2 changes: 1 addition & 1 deletion config/default.yml
Expand Up @@ -309,9 +309,9 @@ Performance/StartWith:
Performance/StringInclude:
Description: 'Use `String#include?` instead of a regex match with literal-only pattern.'
Enabled: 'pending'
AutoCorrect: false
SafeAutoCorrect: false
VersionAdded: '1.7'
VersionChanged: '1.12'

Performance/StringReplacement:
Description: >-
Expand Down
12 changes: 1 addition & 11 deletions docs/modules/ROOT/pages/cops_performance.adoc
Expand Up @@ -1848,7 +1848,7 @@ for receiver is multiline string.
| Yes
| Yes (Unsafe)
| 1.7
| -
| 1.12
|===

This cop identifies unnecessary use of a regex where
Expand All @@ -1872,16 +1872,6 @@ This cop's offenses are not safe to auto-correct if a receiver is nil.
'abc'.include?('ab')
----

=== Configurable attributes

|===
| Name | Default value | Configurable values

| AutoCorrect
| `false`
| Boolean
|===

== Performance/StringReplacement

|===
Expand Down

0 comments on commit 991a414

Please sign in to comment.