Skip to content

Commit

Permalink
Merge pull request #10213 from koic/fix_error_for_layout_block_alignm…
Browse files Browse the repository at this point in the history
…ent_using_ruby_31

Fix an error for `Layout/BlockAlignment` when using Ruby 3.1.0-dev
  • Loading branch information
koic committed Oct 26, 2021
2 parents 00d940a + 1c9abe9 commit e93f705
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rubocop/cop/layout/block_alignment.rb
Expand Up @@ -101,11 +101,11 @@ def start_for_block_node(block_node)
def block_end_align_target(node)
lineage = [node, *node.ancestors]

target = lineage.each_cons(2) do |current, parent|
break current if end_align_target?(current, parent)
lineage.each_cons(2) do |current, parent|
return current if end_align_target?(current, parent)
end

target || lineage.last
lineage.last
end

def end_align_target?(node, parent)
Expand Down

0 comments on commit e93f705

Please sign in to comment.