-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Infinite loop caused by Layout/ArgumentAlignment -> Layout/HashAlignment #10671
Comments
The following modifications seem to prevent this from occurring. # Before
Layout/HashAlignment:
EnforcedHashRocketStyle:
- separator
EnforcedColonStyle:
- separator
# After
Layout/HashAlignment:
EnforcedHashRocketStyle: separator
EnforcedColonStyle: separator In the Before state, the comparison is always false because the comparison is made here between Array and string.
|
I think the essential solution to this problem is to give For example, run rubocop with the following Style/EmptyMethod:
EnforcedStyle:
- expanded Then I get a validation error as follows
|
|
…Alignment` Fixes rubocop#10671. This PR fixes an incorrect autocorrect for `EnforcedStyle: with_first_argument` of `Layout/ArgumentAlignment` and `EnforcedColonStyle: separator` of `Layout/HashAlignment`. `EnforcedColonStyle` can return an array value because `Layout/HashAlignment` cop has `AllowMultipleStyles` config.
Oh, I was not aware of |
No problem. The setting you show work as a workaround 👍
|
…out_argument_alignment [Fix #10671] Fix an incorrect autocorrect for `Layout/ArgumentAlignment`
Expected behavior
I expected rubocop not to crash.
Actual behavior
Rubocop crashed on an infinite loop caused by Layout/ArgumentAlignment -> Layout/HashAlignment:
Some of the broken area of code in question:
The contents of the rubocop.yml file:
RuboCop version
The text was updated successfully, but these errors were encountered: