You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixesrubocop#9928.
This PR fixes an infinite loop error and a false auto-correction behavior for `Layout/EndAlignment`
when using operator methods and `EnforcedStyleAlignWith: variable`.
This infinite loop error is due to an offense being registered but not auto-corrected.
`EnforcedStyleAlignWith: variable` enforces alignment to variable,
it should be auto-corrected to be aligned to variable even when operator method is used.
Fixesrubocop#9928.
This PR fixes an infinite loop error and a false auto-correction behavior for `Layout/EndAlignment`
when using operator methods and `EnforcedStyleAlignWith: variable`.
This infinite loop error is due to an offense being registered but not auto-corrected.
`EnforcedStyleAlignWith: variable` enforces alignment to variable,
it should be auto-corrected to be aligned to variable even when operator method is used.
Expected behavior
I expect Rubocop to autocorrect my code (or at least not crash while trying to do so).
Actual behavior
When running Layout/EndAlignment's autocorrection (with
EnforcedStyleAlignWith: variable
on that cop), Rubocop raises an infinite loop error.Steps to reproduce the problem
Given
.rubocop.yml
:And a file
test.rb
:When I run
rubocop --only Layout/EndAlignment --debug -a test.rb
I get:RuboCop version
The text was updated successfully, but these errors were encountered: