forked from rubocop/rubocop-performance
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an incorrect auto-correct for `Performance/RedundantSplitRegexpAr…
…gument` Follow rubocop#190. This PR fixes the following incorrect auto-correct for `Performance/RedundantSplitRegexpArgument` when using consecutive special string chars. ```console % cat example.rb "foo\nbar\nbaz\n".split(/\n\n/) % bundle exec rubocop example.rb --only Performance/RedundantSplitRegexpArgument -a Inspecting 1 file C Offenses: example.rb:1:25: C: [Corrected] Performance/RedundantSplitRegexpArgument: Use string as argument instead of regexp. "foo\nbar\nbaz\n".split(/\n\n/) ^^^^^^ 1 file inspected, 1 offense detected, 1 offense corrected ## Before ```console % cat example.rb "foo\nbar\nbaz\n".split("nn") ``` ## After ```console % cat example.rb "foo\nbar\nbaz\n".split("\n\n") ```
- Loading branch information
Showing
2 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters