-
-
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
Problem with "Indent when as deep as case" #653
Comments
This is intentional and enforced for all similar expressions. You can change the code into:
|
Shouldn't both syntaxes be accepted? |
Perhaps. But definitely not at the same time. |
@jonas054 Would you like to tackle this? |
Yes. I've seen 4 styles that people use: they indent CaseIndentation:
# Valid values are: case, end
IndentWhenRelativeTo: case
IndentOneStep: false 1 (default): output = case variable
when 'value1'
'output1'
else
'output2'
end 2: output = case variable
when 'value1'
'output1'
else
'output2'
end 3: output = case variable
when 'value1'
'output1'
else
'output2'
end 4: output = case variable
when 'value1'
'output1'
else
'output2'
end |
I have a case statement where the return value is assigned to a variable. I'm getting an "Indent when as deep as case" warning. This is the code:
The syntax Rubocop accepts is:
The text was updated successfully, but these errors were encountered: