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

New line added before //format: off in v3.8.3 on each run of formatter #4368

Open
goawash opened this issue Sep 30, 2024 · 0 comments
Open

Comments

@goawash
Copy link

goawash commented Sep 30, 2024

Configuration (required)

preset = IntelliJ
version = 3.8.3
runner.dialect = scala3

rewrite.rules = [
  PreferCurlyFors, RedundantParens, Imports
]

rewrite.imports.expand = true

Command-line parameters (required)

When I run scalafmt via CLI like this: scalafmtAll or run format command in IntelliJ Idea

Steps

Given code like this:

import scala.concurrent.Future

// format: off
/** Something
 */
// format: on
class Test {}

Problem

After updating to scalafmt 3.8.3, we started to observe strange behavior: when you have at least one import and then // format: off, each run of scalafmtAll command adds a new line before // format: off. I tried to add another import statement instead of scaladoc block - but it still added a new line.

Expectation

No adding a new line after each run of formatting.

Workaround

Remove // format: off before scaladoc block, but we would like to still have it formatted in our way.

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

No branches or pull requests

1 participant