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
Resolvesrubocop#7778.
This PR resolves a false positive for `Layout/EndAlignment`
when a non-whitespace is used before the `end` keyword.
```console
% cat example.rb
if cond
else 'foo' end
% bundle exec rubocop -a --only Layout/EndAlignment
(snip)
Inspecting 1 file
W
Offenses:
example.rb:2:12: W: Layout/EndAlignment: end at 2, 11 is not aligned
with if at 1, 0.
else 'foo' end
^^^
1 file inspected, 1 offense detected
```
This PR changes to not offense it.
I think the responsibility will be clear if different (maybe new) cop like
`Layout/BlockEndNewline` cop handle the offense case.
So I think this role is preferably separated by `Layout/EndAlignment` cop.
Expected behavior
Given an oddly condensed case statement where the end is on the same line as the else RuboCop should be able to autocorrect the end onto its own line.
Actual behavior
The issue is identified, but doesn't autocorrect
Steps to reproduce the problem
Run RuboCop 0.80.1 against the code block above.
RuboCop version
The text was updated successfully, but these errors were encountered: