Pattern: Misaligned multi-line assignment
Issue: -
This rule checks whether the multi-line assignments have a newline after the assignment operator.
# bad (with EnforcedStyle set to new_line)
foo = if expression
'bar'
end
# good (with EnforcedStyle set to same_line)
foo = if expression
'bar'
end
# good (with EnforcedStyle set to new_line)
foo =
if expression
'bar'
end
# good (with EnforcedStyle set to new_line)
foo =
begin
compute
rescue => e
nil
end
Attribute | Value |
---|---|
SupportedTypes | block, case, class, if, kwbegin, module |
EnforcedStyle | new_line |
SupportedStyles | same_line, new_line |