class RuboCop::Cop::Layout::IndentAssignment
other cops such as ‘IndentationConsistency` and `EndAlignment`.
The indentation of the remaining lines can be corrected with
end
’bar’
if foo
value =
# good
end
’bar’
if foo
value =
# bad
@example
right-hand-side of a multi-line assignment.
This cop checks the indentation of the first line of the
def autocorrect(node)
def autocorrect(node) AlignmentCorrector.correct(processed_source, node, column_delta) end
def check_assignment(node, rhs)
def check_assignment(node, rhs) return unless rhs return unless node.loc.operator return if node.loc.operator.line == rhs.first_line base = display_column(node.source_range) check_alignment([rhs], base + configured_indentation_width) end