Skip to content

Idempotency Failure: Comment Between Keyword and Condition on Next Line Is Misplaced #939

Description

@nicholasdower

Originally reported in #915

Commit: 95210d7

Input

→ View on rubyfmt.run

def foo
  return unless
    # comment
    bar ||
    baz
end

Output

→ View on rubyfmt.run

def foo
  unless   # comment
bar ||
      baz
    return
  end
end

Second Output

def foo
  # comment
  unless bar ||
      baz
    return
  end
end

Expected behavior

The output should be stable.

Found in: yard 0.9.44 (lib/yard/parser/ruby/legacy/statement_list.rb)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions