class RuboCop::Cop::Layout::IndentAssignment
This cop checks the indentation of the first line of the right-hand-side of a multi-line assignment.
@example
# bad value = if foo 'bar' end # good value = if foo 'bar' end
The indentation of the remaining lines can be corrected with other cops such as `IndentationConsistency` and `EndAlignment`.
Constants
- MSG
Public Instance Methods
autocorrect(node)
click to toggle source
# File lib/rubocop/cop/layout/indent_assignment.rb, line 40 def autocorrect(node) AlignmentCorrector.correct(processed_source, node, column_delta) end
check_assignment(node, rhs)
click to toggle source
# File lib/rubocop/cop/layout/indent_assignment.rb, line 31 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