-
Notifications
You must be signed in to change notification settings - Fork 284
Closed
Description
After updating from 3.7.17 to 3.8.0, the test code below now gets an additional newline in "example 1". It seems to be caused by newlines.topLevelBodyIfMinStatements = [before]
, but that wasn't the case in 3.7.x
Is this is a regression or is it by design?
Configuration (required)
version = 3.8.0
runner.dialect = Scala213Source3
maxColumn = 120
indentOperator.preset = akka-http
importSelectors = singleLine
trailingCommas = preserve
newlines.topLevelBodyIfMinStatements = [before]
rewrite {
rules = [SortModifiers, Imports, PreferCurlyFors, AvoidInfix]
sortModifiers.order = ["private", "protected", "implicit", "final", "sealed", "abstract", "override", "lazy"]
imports.sort = scalastyle
}
continuationIndent {
defnSite = 2
extendSite = 2
callSite = 2
}
align {
arrowEnumeratorGenerator = false
ifWhileOpenParen = false
openParenCallSite = false
openParenDefnSite = false
tokens = ["%", "%%"]
}
Command-line parameters (required)
When I run scalafmt via CLI like this: scalafmt
Steps
Given code like this:
class DummyTest extends AnyWordSpecLike {
private class Scope {
// dummy for example 1
}
"Test" should {
"example 1" in new Scope {
val x = 1
x shouldBe 1
}
"example 2" in {
val x = 1
x shouldBe 1
}
}
}
Problem
Scalafmt formats code like this:
class DummyTest extends AnyWordSpecLike {
private class Scope {
// dummy for example 1
}
"Test" should {
"example 1, not ok" in new Scope {
val x = 1
x shouldBe 1
}
"example 2, ok" in {
val x = 1
x shouldBe 1
}
}
}
Metadata
Metadata
Assignees
Labels
No labels