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 auto-correct alignment of Style/ParallelAssignment #2107

Merged

Conversation

rrosenblum
Copy link
Contributor

The auto correct was not properly accounting for the space offset of nested assignment.

I found this while writing auto correct functionality for Style/RescueModifier (pull request coming shortly). I am going to try to find a more generic way to come up with space offset and indentation for corrections that span multiple lines.

@rrosenblum rrosenblum force-pushed the parallel_assignment_autocorrect_alignment branch from 4ba7d7d to 7f81ef1 Compare August 5, 2015 23:52
@@ -48,6 +48,7 @@
* [#2023](https://github.com/bbatsov/rubocop/issues/2023): Avoid auto-correction corruption in `IndentationWidth`. ([@jonas054][])
* [#2080](https://github.com/bbatsov/rubocop/issues/2080): Properly parse code in `Performance/Count` when calling `select..count` in a class that extends an enumerable. ([@rrosenblum][])
* [#2093](https://github.com/bbatsov/rubocop/issues/2093): Fix bug in `Style/OneLineConditional` which should not raise an offense with an 'if/then/end' statement. ([@sliuu][])
* [#2107](https://github.com/bbatsov/rubocop/pull/2107): Fix auto-correct of `Style/ParallelAssignment` for nested expressions. ([@rrosenblum][])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be bumped to the master section of the changelog. (I released 0.33 yesterday)

@rrosenblum rrosenblum force-pushed the parallel_assignment_autocorrect_alignment branch from 7f81ef1 to 13dfd9a Compare August 6, 2015 13:06
@rrosenblum
Copy link
Contributor Author

Always happy to have a new version of RuboCop released. I wish there was a better way to handle the changelog when this happens.

The code has been rebased.

bbatsov added a commit that referenced this pull request Aug 6, 2015
…ect_alignment

Fix auto-correct alignment of Style/ParallelAssignment
@bbatsov bbatsov merged commit bf63c3e into rubocop:master Aug 6, 2015
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 6, 2015

👍 Looks good! Thanks!

@rrosenblum rrosenblum deleted the parallel_assignment_autocorrect_alignment branch August 6, 2015 20:39
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.

2 participants