Skip to content

Commit

Permalink
FormatOps: remove noSyntaxNL flag added in scalameta#4246
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Oct 12, 2024
1 parent 8f08ac2 commit d33dc2b
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ class FormatOps(
case _ => true
})
val opt = if (style.newlines.keep) miniSlbEnd else blast
Split(Space, 0).withSingleLineNoOptimal(miniSlbEnd, noSyntaxNL = true)
Split(Space, 0).withSingleLineNoOptimal(miniSlbEnd)
.andPolicy(spacePolicy)
.withOptimalToken(opt, killOnFail = slbLite, recurseOnly = slbLite)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ class CommunityIntellijScala_2024_3_Suite
"classic" -> TestStats.Style(expectedStatesVisited = 5134862),
"classicWithAlign" -> TestStats.Style(expectedStatesVisited = 5139218),
"classicWithRewrites" -> TestStats.Style(expectedStatesVisited = 5134172),
"fold" -> TestStats.Style(expectedStatesVisited = 7953020),
"keep" -> TestStats.Style(expectedStatesVisited = 4737913),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 4739065),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 4748954),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 5167360),
"fold" -> TestStats.Style(expectedStatesVisited = 7953354),
"keep" -> TestStats.Style(expectedStatesVisited = 4737912),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 4739064),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 4748953),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 5167359),
"unfold" -> TestStats.Style(expectedStatesVisited = 5611808),
),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class CommunityScala2_12Suite extends CommunityScala2Suite("scala-2.12") {
"classic" -> TestStats.Style(expectedStatesVisited = 3742070),
"classicWithAlign" -> TestStats.Style(expectedStatesVisited = 3743075),
"classicWithRewrites" -> TestStats.Style(expectedStatesVisited = 3782691),
"fold" -> TestStats.Style(expectedStatesVisited = 5833298),
"keep" -> TestStats.Style(expectedStatesVisited = 3511074),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 3511201),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 3557273),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 3976667),
"fold" -> TestStats.Style(expectedStatesVisited = 5833626),
"keep" -> TestStats.Style(expectedStatesVisited = 3511087),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 3511214),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 3557286),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 3976698),
"unfold" -> TestStats.Style(expectedStatesVisited = 4192369),
),
))
Expand All @@ -39,11 +39,11 @@ class CommunityScala2_13Suite extends CommunityScala2Suite("scala-2.13") {
"classic" -> TestStats.Style(expectedStatesVisited = 4633753),
"classicWithAlign" -> TestStats.Style(expectedStatesVisited = 4636193),
"classicWithRewrites" -> TestStats.Style(expectedStatesVisited = 4666475),
"fold" -> TestStats.Style(expectedStatesVisited = 7586042),
"keep" -> TestStats.Style(expectedStatesVisited = 4329252),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 4329386),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 4373731),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 4928298),
"fold" -> TestStats.Style(expectedStatesVisited = 7587352),
"keep" -> TestStats.Style(expectedStatesVisited = 4329334),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 4329468),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 4373813),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 4928380),
"unfold" -> TestStats.Style(expectedStatesVisited = 5125363),
),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class CommunityScala3_2Suite extends CommunityScala3Suite("scala-3.2") {
"classic" -> TestStats.Style(expectedStatesVisited = 3550612),
"classicWithAlign" -> TestStats.Style(expectedStatesVisited = 3552306),
"classicWithRewrites" -> TestStats.Style(expectedStatesVisited = 3558246),
"fold" -> TestStats.Style(expectedStatesVisited = 5817143),
"keep" -> TestStats.Style(expectedStatesVisited = 3148692),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 3148747),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 3079850),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 3631800),
"fold" -> TestStats.Style(expectedStatesVisited = 5819693),
"keep" -> TestStats.Style(expectedStatesVisited = 3148688),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 3148743),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 3079846),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 3631937),
"unfold" -> TestStats.Style(expectedStatesVisited = 3882869),
),
))
Expand All @@ -39,11 +39,11 @@ class CommunityScala3_3Suite extends CommunityScala3Suite("scala-3.3") {
"classic" -> TestStats.Style(expectedStatesVisited = 3829673),
"classicWithAlign" -> TestStats.Style(expectedStatesVisited = 3831499),
"classicWithRewrites" -> TestStats.Style(expectedStatesVisited = 3839204),
"fold" -> TestStats.Style(expectedStatesVisited = 6309907),
"keep" -> TestStats.Style(expectedStatesVisited = 3388129),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 3388188),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 3321872),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 3907628),
"fold" -> TestStats.Style(expectedStatesVisited = 6312703),
"keep" -> TestStats.Style(expectedStatesVisited = 3388236),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 3388295),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 3321955),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 3907876),
"unfold" -> TestStats.Style(expectedStatesVisited = 4201515),
),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class CommunitySpark3_4Suite extends CommunitySparkSuite("spark-3.4") {
"classic" -> TestStats.Style(expectedStatesVisited = 7822344),
"classicWithAlign" -> TestStats.Style(expectedStatesVisited = 7822643),
"classicWithRewrites" -> TestStats.Style(expectedStatesVisited = 7794473),
"fold" -> TestStats.Style(expectedStatesVisited = 12245865),
"keep" -> TestStats.Style(expectedStatesVisited = 6827133),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 6827259),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 6841859),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 7585082),
"fold" -> TestStats.Style(expectedStatesVisited = 12266193),
"keep" -> TestStats.Style(expectedStatesVisited = 6831767),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 6831893),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 6846933),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 7588413),
"unfold" -> TestStats.Style(expectedStatesVisited = 8654777),
),
))
Expand All @@ -39,11 +39,11 @@ class CommunitySpark3_5Suite extends CommunitySparkSuite("spark-3.5") {
"classic" -> TestStats.Style(expectedStatesVisited = 8277862),
"classicWithAlign" -> TestStats.Style(expectedStatesVisited = 8278013),
"classicWithRewrites" -> TestStats.Style(expectedStatesVisited = 8254489),
"fold" -> TestStats.Style(expectedStatesVisited = 12884283),
"keep" -> TestStats.Style(expectedStatesVisited = 7218789),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 7218811),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 7237620),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 8057079),
"fold" -> TestStats.Style(expectedStatesVisited = 12906117),
"keep" -> TestStats.Style(expectedStatesVisited = 7224007),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 7224029),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 7243278),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 8061099),
"unfold" -> TestStats.Style(expectedStatesVisited = 9159243),
),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9807,8 +9807,7 @@ val output = evaluated match {
}
>>>
val output = evaluated match {
case s: String =>
s"""|
case s: String => s"""|
|"$s"""".stripMargin
case x => x.toString
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,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, 1495182, "total explored")
assertEquals(explored, 1495532, "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 d33dc2b

Please sign in to comment.