Skip to content

Idempotency Failure: Comment Inside Parentheses Misplaced #938

@nicholasdower

Description

@nicholasdower

Originally reported in #915

Commit: 95210d7

Input

→ View on rubyfmt.run

(
  (
    # b
    c
  ) || d
)

def a
  (
    # b
    c || d
  ).e
end

Output

→ View on rubyfmt.run

(# b
(c) ||
  d)

def a
    # b
(c || d)
    .e
end

Second Output

# b
((c) ||
  d)

def a
  # b
  (c || d)
    .e
end

Expected behavior

The output should be stable.

Found in: strong_migrations 2.8.0 (lib/strong_migrations/adapters/postgresql_adapter.rb)
Found in: mini_portile2 2.8.9 (lib/mini_portile2/mini_portile.rb)
Found in: sequel 5.105.0 (lib/sequel/exceptions.rb)
Found in: sequel 5.105.0 (lib/sequel/model/exceptions.rb)
Found in: sequel 5.105.0 (lib/sequel/plugins/pg_auto_constraint_validations.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