Skip to content

Files

Latest commit

 

History

History
64 lines (48 loc) · 1.11 KB

Layout-MultilineMethodCallIndentation.md

File metadata and controls

64 lines (48 loc) · 1.11 KB

Pattern: Malformed indentation of multi-line method call

Issue: -

Description

This rule checks the indentation of the method name part in method calls that span more than one line.

Examples

# bad
while myvariable
.b
  # do something
end

# good, EnforcedStyle: aligned
while myvariable
      .b
  # do something
end

# good, EnforcedStyle: aligned
Thing.a
     .b
     .c

# good, EnforcedStyle:    indented,
        IndentationWidth: 2
while myvariable
  .b

  # do something
end

# good, EnforcedStyle:    indented_relative_to_receiver,
        IndentationWidth: 2
while myvariable
        .a
        .b

  # do something
end

# good, EnforcedStyle:    indented_relative_to_receiver,
        IndentationWidth: 2
myvariable = Thing
               .a
               .b
               .c

Default configuration

Attribute Value
EnforcedStyle aligned
SupportedStyles aligned, indented, indented_relative_to_receiver
IndentationWidth

Further Reading