Skip to content

Commit

Permalink
FormatOps: implement binPack.parentCtor=ForceBreak
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 15, 2024
1 parent 8866b47 commit 2b2818f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@ class FormatOps(
)
}
else if (!isFirstCtor) Seq(Split(Space, 0), Split(Newline, 1))
else if (style.binPack.parentConstructors eq BinPack.ParentCtors.ForceBreak)
Seq(Split(nlMod, 0, policy = nlPolicy(false)).withIndent(indent))
else {
val parentCtors = style.binPack.parentConstructors
val nlOnelineTag = parentCtors match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ binPack.parentConstructors = ForceBreak
===
class SomeClass(a: Int, b: Double, c: String) extends SomeBaseClass with SomeTrait
>>>
class SomeClass(a: Int, b: Double, c: String) extends SomeBaseClass with SomeTrait
class SomeClass(a: Int, b: Double, c: String)
extends SomeBaseClass
with SomeTrait
<<< #4542 ForceBreak narrow multi-line
maxColumn = 40
binPack.parentConstructors = ForceBreak
Expand Down Expand Up @@ -336,4 +338,6 @@ class SomeClass(a: Int, b: Double, c: String)
extends SomeBaseClass
with SomeTrait
>>>
class SomeClass(a: Int, b: Double, c: String) extends SomeBaseClass with SomeTrait
class SomeClass(a: Int, b: Double, c: String)
extends SomeBaseClass
with SomeTrait
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class FormatTests extends FunSuite with CanRunTests with FormatAssertions {
val explored = Debug.explored.get()
logger.debug(s"Total explored: $explored")
if (!onlyUnit && !onlyManual)
assertEquals(explored, 1117354, "total explored")
assertEquals(explored, 1117350, "total explored")
val results = debugResults.result()
// TODO(olafur) don't block printing out test results.
// I don't want to deal with scalaz's Tasks :'(
Expand Down

0 comments on commit 2b2818f

Please sign in to comment.