Skip to content

Commit

Permalink
rubocops/cask/array_alphabetization: skip blank lines when sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
krehel committed Apr 17, 2024
1 parent 726d65c commit 36cc201
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Library/Homebrew/rubocops/cask/array_alphabetization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def on_send(node)
def sort_array(source)
# 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|
next if line.blank?
next if line.strip.start_with?("#")

next recursively_find_comments(source, index, line)
Expand Down

0 comments on commit 36cc201

Please sign in to comment.