Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idempotence issue when trailingCommas is "always" and omitting braces #4058

Closed
finalchild opened this issue Jun 17, 2024 · 0 comments · Fixed by #4059
Closed

Idempotence issue when trailingCommas is "always" and omitting braces #4058

finalchild opened this issue Jun 17, 2024 · 0 comments · Fixed by #4059

Comments

@finalchild
Copy link

finalchild commented Jun 17, 2024

Configuration (required)

version = 3.8.2
runner.dialect = scala3
preset = default
rewrite.trailingCommas.style = "always"

Command-line parameters (required)

When I run scalafmt via CLI like this: scalafmt filename.scala

Steps

Given code like this:

f(
  if true then 0
  else
    ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
  ,
)

repeat running scalafmt

Problem

Scalafmt formats code like this:

f(
  if true then 0
  else
    ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg,
)

and run it again, rolls back to original

Expectation

Calls should be idempotent

Workaround

Not omitting braces

Notes

See also...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant