rubocops/cask/array_alphabetization: skip blank lines when sorting
This commit is contained in:
parent
726d65c0ab
commit
36cc201616
@ -37,6 +37,7 @@ module RuboCop
|
|||||||
def sort_array(source)
|
def sort_array(source)
|
||||||
# Combine each comment with the line(s) below so that they remain in the same relative location
|
# Combine each comment with the line(s) below so that they remain in the same relative location
|
||||||
combined_source = source.each_with_index.filter_map do |line, index|
|
combined_source = source.each_with_index.filter_map do |line, index|
|
||||||
|
next if line.blank?
|
||||||
next if line.strip.start_with?("#")
|
next if line.strip.start_with?("#")
|
||||||
|
|
||||||
next recursively_find_comments(source, index, line)
|
next recursively_find_comments(source, index, line)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user