class RuboCop::Cop::Layout::MultilineMethodCallBraceLayout
b)
foo(a,
# good
b)
a,
foo(
# good
)
b
a,
foo(
# bad
)
b
foo(a,
# bad
@example EnforcedStyle: same_line
)
b
a,
foo(
# good
)
b
foo(a,
# good
b)
foo(a,
# bad
b)
a,
foo(
# bad
@example EnforcedStyle: new_line
)
b
a,
foo(
# good
b)
foo(a,
# good
b)
a,
foo(
# bad
)
b
foo(a,
# bad
@example EnforcedStyle: symmetrical (default)
line as the last argument of the call.
The closing brace of a multi-line method call must be on the same
When using the ‘same_line` style:
after the last argument of the call.
The closing brace of a multi-line method call must be on the line
When using the `new_line` style:
below the last argument of the call.
argument of the call, then the closing brace should be on the line
If an method call’s opening brace is on the line above the first
line as the last argument of the call.
argument of the call, then the closing brace should be on the same
If a method call’s opening brace is on the same line as the first
When using the ‘symmetrical` (default) style:
on the same line as the last method argument, or a new line.
Checks that the closing brace in a method call is either
def children(node)
def children(node) node.arguments end
def ignored_literal?(node)
def ignored_literal?(node) single_line_ignoring_receiver?(node) || super end
def on_send(node)
def on_send(node) check_brace_layout(node) end
def single_line_ignoring_receiver?(node)
def single_line_ignoring_receiver?(node) return false unless node.loc.begin && node.loc.end node.loc.begin.line == node.loc.end.line end