Closed andrew-selvia closed 1 year ago
please take a look at the minBreaks
parameter: https://scalameta.org/scalafmt/docs/configuration.html#newlinestoplevelstatementblanklines
Thanks @kitbellew!
For anyone who stumbles upon this, here's the solution:
newlines.topLevelStatementBlankLines = [{
blanks = -1
minBreaks = 0
}]
runner.dialect = scala3
version = 3.7.14
Configuration (required)
Command-line parameters (required)
No special parameters; just calling
scalafmt
as installed via Coursier:Steps
Given code like this:
Problem
Scalafmt formats code like this:
Expectation
I would like the formatted output to look like this:
Workaround
I've found that by adding a second import statement:
the code is formatted as expected: