Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SymbolProc autocorrect with multiple offenses #1456

Merged
merged 1 commit into from
Nov 23, 2014

Conversation

jeffcarbs
Copy link
Contributor

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 (#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.

@jeffcarbs jeffcarbs force-pushed the fix-multiple-symbol-proc branch 2 times, most recently from 443dace to dfd70cc Compare November 23, 2014 04:34
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.
@jeffcarbs jeffcarbs force-pushed the fix-multiple-symbol-proc branch from dfd70cc to ed95a43 Compare November 23, 2014 04:42
@jonas054
Copy link
Collaborator

👍 Looks good!

bbatsov added a commit that referenced this pull request Nov 23, 2014
Fix SymbolProc autocorrect with multiple offenses
@bbatsov bbatsov merged commit df7415c into rubocop:master Nov 23, 2014
@bbatsov
Copy link
Collaborator

bbatsov commented Nov 23, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants