-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Bug with parallel assignment auto-correct #1873
Comments
It should be. I totally missed this. |
Actually, I just came across https://github.com/JuanitoFatas/fast-ruby#parallel-assignment-vs-sequential-assignment-code - so I guess Performance makes sense too 😄. |
While this is true, the bigger value is the improved readability of the code, so I still think this should be a style cop. |
//cc @rrosenblum |
Agreed. |
Thank you for the bug report. I agree, this is a bug. I will start working on a fix for it soon. As for Performance vs Style, it falls into both categories. It was brought up as an old feature request and in talking about performance cops. When we are talking about the ability to assign variables in the millions per second, doubling the performance is negligible except in extreme cases. I agree that the bigger gain is readability, therefore making this better suited as a Style Cop. I will also go ahead and make this change. |
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a guard clause
… protected by a modifier statement
… protected by a modifier statement
…ed by a modifier statement
Good stuff @rrosenblum 👏 |
See #1831, the auto-correct function is broken with this edge case:
Both assignments should stay conditional.
As a side note, I don't get why this cop is in the Performance category - does it have any performance implications? Shouldn't it be in Style?
The text was updated successfully, but these errors were encountered: