forked from rubocop/rubocop
-
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 SymbolProc autocorrect with multiple offenses
When there were multiple offenses for the SymbolProc cop (e.g. `coll.map { |s| s.upcase }.map { |s| s.downcase }`) the cop would raise an error: `Parser::Source::Rewriter detected clobbering`. Digging into relevant commits I found some inspiration from @jonas054 (rubocop#569). This commit changes the autocorrect for the `SymbolProc` cop to be a little more precise in determining what to correct. There's a new spec that I wrote that fails on master and passes on this branch.
- Loading branch information
Showing
3 changed files
with
15 additions
and
4 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
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