class RuboCop::Cop::Layout::IndentationConsistency
def base_column_for_normal_style(node)
indicate that the correct indentation is that of the first child that
Returns an integer representing the correct indentation, or nil to
def base_column_for_normal_style(node) first_child = node.children.first return unless first_child && bare_access_modifier?(first_child) # If, as is most common, the access modifier is indented deeper than # the module (`access_modifier_indent > module_indent`) then the # indentation of the access modifier determines the correct # indentation. # # Otherwise, in the rare event that the access modifier is outdented # to the level of the module (see `AccessModifierIndentation` cop) we # return nil so that `check_alignment` will derive the correct # indentation from the first child that is not an access modifier. access_modifier_indent = display_column(first_child.source_range) return access_modifier_indent unless node.parent module_indent = display_column(node.parent.source_range) access_modifier_indent if access_modifier_indent > module_indent end