Class: DatarocketsStyle::Cop::Layout::ArrayAlignmentExtended
- Inherits:
-
RuboCop::Cop::Base
- Object
- RuboCop::Cop::Base
- DatarocketsStyle::Cop::Layout::ArrayAlignmentExtended
- Extended by:
- RuboCop::Cop::AutoCorrector
- Includes:
- RuboCop::Cop::Alignment
- Defined in:
- lib/datarockets_style/cop/layout/array_alignment_extended.rb
Overview
Here we check if the elements of a multi-line array literal are aligned.
Constant Summary collapse
- ALIGN_PARAMS_MSG =
"Align the elements of an array literal if they span more than one line."- FIXED_INDENT_MSG =
"Use one level of indentation for elements " \ "following the first line of a multi-line array."
Instance Method Summary collapse
Instance Method Details
#autocorrect(corrector, node) ⇒ Object
51 52 53 |
# File 'lib/datarockets_style/cop/layout/array_alignment_extended.rb', line 51 def autocorrect(corrector, node) RuboCop::Cop::AlignmentCorrector.correct(corrector, processed_source, node, column_delta) end |
#on_array(node) ⇒ Object
45 46 47 48 49 |
# File 'lib/datarockets_style/cop/layout/array_alignment_extended.rb', line 45 def on_array(node) return if node.children.size < 2 check_alignment(node.children, base_column(node, node.children)) end |