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
Layout/HashAlignment Autocorrect crashes for calls with arguments on next line after shorthand hash argument #10364
Labels
Comments
Thank you for the feedback. I cannot reproduce the error. Can you provide .rubocop.yml configuration? |
Sure
|
The error can be reproduced. Thank you for providing the configuration. |
Perfect! Good luck fixing the issue. |
koic
added a commit
to koic/rubocop
that referenced
this issue
Feb 1, 2022
Fixes rubocop#10364. This PR fixes an infinite loop error for `Layout/HashAlignment` when `EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArgumentAlignment`. The issue context is that the first keyword argument and the argument before it are on the same line.
8 tasks
bbatsov
pushed a commit
that referenced
this issue
Feb 3, 2022
Fixes #10364. This PR fixes an infinite loop error for `Layout/HashAlignment` when `EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArgumentAlignment`. The issue context is that the first keyword argument and the argument before it are on the same line.
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
Successfully autocorrect code with arguments following a hash shorthand argument that are on different lines.
Actual behavior
If I try to autocorrect a file that use a Ruby 3.1 hash shorthand with one or more hash parameters following it one the next line, an inifinite loop error is raised.
Steps to reproduce the problem
The following code causes the above failure:
Changing the argument on the second line to not be a shorthand value still has the same error:
Changing the code to a one-liner causes the error to disappear:
Changing the shorthand to a non-shorthand param also causes the error to disappear:
RuboCop version
The text was updated successfully, but these errors were encountered: