Skip to content

Files

Latest commit

 

History

History
48 lines (36 loc) · 1007 Bytes

Layout-MultilineAssignmentLayout.md

File metadata and controls

48 lines (36 loc) · 1007 Bytes

Pattern: Misaligned multi-line assignment

Issue: -

Description

This rule checks whether the multi-line assignments have a newline after the assignment operator.

Examples

# 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

Default configuration

Attribute Value
SupportedTypes block, case, class, if, kwbegin, module
EnforcedStyle new_line
SupportedStyles same_line, new_line

Further Reading