class RuboCop::Cop::Layout::MultilineArrayBraceLayout
:b ]
[ :a,
# good
:b ]
:a,
[
# good
]
:b
:a,
[
# bad
]
:b
[ :a,
# bad
@example EnforcedStyle: same_line
]
:b
:a,
[
# good
]
:b
[ :a,
# good
:b ]
[ :a,
# bad
:b ]
:a,
[
# bad
@example EnforcedStyle: new_line
]
:b
:a,
[
# good
:b ]
[ :a,
# good
:b ]
:a,
[
# bad
]
:b
[ :a,
# bad
@example EnforcedStyle: symmetrical (default)
line as the last element of the array.
The closing brace of a multi-line array literal must be on the same
When using the ‘same_line` style:
after the last element of the array.
The closing brace of a multi-line array literal must be on the line
When using the `new_line` style:
the last element of the array.
of the array, then the closing brace should be on the line below
If an array’s opening brace is on the line above the first element
the last element of the array.
of the array, then the closing brace should be on the same line as
If an array’s opening brace is on the same line as the first element
When using the ‘symmetrical` (default) style:
on the same line as the last array element, or a new line.
This cop checks that the closing brace in an array literal is either
def autocorrect(node)
def autocorrect(node) MultilineLiteralBraceCorrector.correct(processed_source, node) end
def on_array(node)
def on_array(node) check_brace_layout(node) end