Sha256: f4aebb0190fa1d8fd1da005a54927fcf7fa3ea1116405cf914fd5cdbbd4ca224
Contents?: true
Size: 863 Bytes
Versions: 9
Compression:
Stored size: 863 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Layout # Here we check if the elements of a multi-line array literal are # aligned. # # @example # # bad # a = [1, 2, 3, # 4, 5, 6] # array = ['run', # 'forrest', # 'run'] # # # good # a = [1, 2, 3, # 4, 5, 6] # a = ['run', # 'forrest', # 'run'] class ArrayAlignment < Cop include Alignment MSG = 'Align the elements of an array literal if they span more ' \ 'than one line.' def on_array(node) check_alignment(node.children) end def autocorrect(node) AlignmentCorrector.correct(processed_source, node, column_delta) end end end end end
Version data entries
9 entries across 8 versions & 3 rubygems