-
-
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
Strange indentation error with if/else alignment #1691
Comments
Yeah, that’s a bit weird. The warning comes from the To fix it, you would either disable Lint/EndAlignment:
AlignWith: variable |
Wouldn't this disable indentation checking across the board? Ignoring stuff like: def foo
1 # 4 spaces
end
Like I said, we don't want to enforce if/else alignment rules. If we choose some_var =
if bar
"it's true!"
else
"it's not true"
end |
I think the |
Definitely. |
[Fix #1691] Handle var = <line break> in EndAlignment
In this case, the cop should enforce keyword alignment even if variable alignment is selected in configuration.
So is it not possible to allow both
and
with |
No. Allowing two styles is generally not something we like to do in RuboCop. It's either/or. |
Ruby code:
rubocop config:
Error message:
If I don't want to enforce if/else formats, how can I disable this without getting a warning?
The text was updated successfully, but these errors were encountered: