Commit f1d0289 1 parent f4faa6b commit f1d0289 Copy full SHA for f1d0289
File tree 10 files changed +40
-28
lines changed
scalafmt-core/shared/src/main/scala/org/scalafmt/internal
scalafmt-tests/shared/src/test
10 files changed +40
-28
lines changed Original file line number Diff line number Diff line change @@ -2003,12 +2003,10 @@ object SplitsAfterLeftParen extends Splits {
2003
2003
else alignIndents,
2004
2004
))
2005
2005
}
2006
- def withCond (t : Tree .WithCond ) =
2007
- if (isTokenHeadOrBefore(left, t)) None else impl(isEnclosedInBraces(t.cond))
2008
2006
leftOwner match { // If/For/While/For with (
2009
2007
case t : Term .EnumeratorsBlock if getHeadOpt(t).contains(ft) => impl(false )
2010
- case t : Term . If => withCond(t)
2011
- case t : Term . While => withCond(t )
2008
+ case t : Tree . WithCond if ! isTokenHeadOrBefore(left, t) =>
2009
+ impl(isEnclosedInBraces(t.cond) )
2012
2010
case _ => None
2013
2011
}
2014
2012
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ abstract class CommunityIntellijScalaSuite(name: String)
13
13
class CommunityIntellijScala_2024_2_Suite
14
14
extends CommunityIntellijScalaSuite (" intellij-scala-2024.2" ) {
15
15
16
- override protected def totalStatesVisited : Option [Int ] = Some (59399907 )
16
+ override protected def totalStatesVisited : Option [Int ] = Some (59404572 )
17
17
18
18
override protected def builds = Seq {
19
19
getBuild(
@@ -54,7 +54,7 @@ class CommunityIntellijScala_2024_2_Suite
54
54
class CommunityIntellijScala_2024_3_Suite
55
55
extends CommunityIntellijScalaSuite (" intellij-scala-2024.3" ) {
56
56
57
- override protected def totalStatesVisited : Option [Int ] = Some (59614646 )
57
+ override protected def totalStatesVisited : Option [Int ] = Some (59619311 )
58
58
59
59
override protected def builds = Seq {
60
60
getBuild(
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ abstract class CommunityScala2Suite(name: String)
9
9
10
10
class CommunityScala2_12Suite extends CommunityScala2Suite (" scala-2.12" ) {
11
11
12
- override protected def totalStatesVisited : Option [Int ] = Some (42553260 )
12
+ override protected def totalStatesVisited : Option [Int ] = Some (42553676 )
13
13
14
14
override protected def builds =
15
15
Seq (getBuild(" v2.12.20" , dialects.Scala212 , 1277 ))
@@ -18,7 +18,7 @@ class CommunityScala2_12Suite extends CommunityScala2Suite("scala-2.12") {
18
18
19
19
class CommunityScala2_13Suite extends CommunityScala2Suite (" scala-2.13" ) {
20
20
21
- override protected def totalStatesVisited : Option [Int ] = Some (53018051 )
21
+ override protected def totalStatesVisited : Option [Int ] = Some (53018427 )
22
22
23
23
override protected def builds =
24
24
Seq (getBuild(" v2.13.14" , dialects.Scala213 , 1287 ))
Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ abstract class CommunitySparkSuite(name: String)
9
9
10
10
class CommunitySpark3_4Suite extends CommunitySparkSuite (" spark-3.4" ) {
11
11
12
- override protected def totalStatesVisited : Option [Int ] = Some (85964934 )
12
+ override protected def totalStatesVisited : Option [Int ] = Some (85967060 )
13
13
14
14
override protected def builds = Seq (getBuild(" v3.4.1" , dialects.Scala213 , 2585 ))
15
15
16
16
}
17
17
18
18
class CommunitySpark3_5Suite extends CommunitySparkSuite (" spark-3.5" ) {
19
19
20
- override protected def totalStatesVisited : Option [Int ] = Some (90969442 )
20
+ override protected def totalStatesVisited : Option [Int ] = Some (90971586 )
21
21
22
22
override protected def builds = Seq (getBuild(" v3.5.3" , dialects.Scala213 , 2756 ))
23
23
Original file line number Diff line number Diff line change @@ -12093,7 +12093,9 @@ def foo = {
12093
12093
def foo = {
12094
12094
next.offset = begCharOffset
12095
12095
do putCharAndNext()
12096
- while (ch != CR && ch != LF && ch != FF && ch != SU)
12096
+ while (
12097
+ ch != CR && ch != LF && ch != FF && ch != SU
12098
+ )
12097
12099
}
12098
12100
<<< `do` starts a new statement, wide, danglingParentheses.ctrlSite
12099
12101
maxColumn = 60
Original file line number Diff line number Diff line change @@ -11319,8 +11319,10 @@ def foo = {
11319
11319
>>>
11320
11320
def foo = {
11321
11321
next.offset = begCharOffset
11322
- do putCharAndNext() while (ch != CR &&
11323
- ch != LF && ch != FF && ch != SU)
11322
+ do putCharAndNext() while (
11323
+ ch != CR && ch != LF && ch != FF &&
11324
+ ch != SU
11325
+ )
11324
11326
}
11325
11327
<<< `do` starts a new statement, wide, danglingParentheses.ctrlSite
11326
11328
maxColumn = 60
@@ -11334,8 +11336,9 @@ def foo = {
11334
11336
>>>
11335
11337
def foo = {
11336
11338
next.offset = begCharOffset
11337
- do putCharAndNext()
11338
- while (ch != CR && ch != LF && ch != FF && ch != SU)
11339
+ do putCharAndNext() while (
11340
+ ch != CR && ch != LF && ch != FF && ch != SU
11341
+ )
11339
11342
}
11340
11343
<<< `do` starts a new statement, narrow, !danglingParentheses.ctrlSite
11341
11344
danglingParentheses.ctrlSite = false
@@ -11348,8 +11351,9 @@ def foo = {
11348
11351
>>>
11349
11352
def foo = {
11350
11353
next.offset = begCharOffset
11351
- do putCharAndNext() while (ch != CR &&
11352
- ch != LF && ch != FF && ch != SU)
11354
+ do putCharAndNext()
11355
+ while (ch != CR && ch != LF &&
11356
+ ch != FF && ch != SU)
11353
11357
}
11354
11358
<<< `do` starts a new statement, wide, !danglingParentheses.ctrlSite
11355
11359
maxColumn = 60
Original file line number Diff line number Diff line change @@ -11865,7 +11865,9 @@ def foo = {
11865
11865
def foo = {
11866
11866
next.offset = begCharOffset
11867
11867
do putCharAndNext()
11868
- while (ch != CR && ch != LF && ch != FF && ch != SU)
11868
+ while (
11869
+ ch != CR && ch != LF && ch != FF && ch != SU
11870
+ )
11869
11871
}
11870
11872
<<< `do` starts a new statement, wide, danglingParentheses.ctrlSite
11871
11873
maxColumn = 60
Original file line number Diff line number Diff line change @@ -12350,8 +12350,9 @@ def foo = {
12350
12350
>>>
12351
12351
def foo = {
12352
12352
next.offset = begCharOffset
12353
- do putCharAndNext()
12354
- while (ch != CR && ch != LF && ch != FF && ch != SU)
12353
+ do putCharAndNext() while (
12354
+ ch != CR && ch != LF && ch != FF && ch != SU
12355
+ )
12355
12356
}
12356
12357
<<< `do` starts a new statement, narrow, !danglingParentheses.ctrlSite
12357
12358
danglingParentheses.ctrlSite = false
@@ -12364,10 +12365,9 @@ def foo = {
12364
12365
>>>
12365
12366
def foo = {
12366
12367
next.offset = begCharOffset
12367
- do putCharAndNext() while (
12368
- ch != CR && ch != LF && ch != FF &&
12369
- ch != SU
12370
- )
12368
+ do putCharAndNext()
12369
+ while (ch != CR && ch != LF &&
12370
+ ch != FF && ch != SU)
12371
12371
}
12372
12372
<<< `do` starts a new statement, wide, !danglingParentheses.ctrlSite
12373
12373
maxColumn = 60
Original file line number Diff line number Diff line change @@ -2480,9 +2480,15 @@ object a {
2480
2480
>>>
2481
2481
object a {
2482
2482
do foo
2483
- while (true)
2483
+ while (
2484
+ true
2485
+ )
2484
2486
do a + b
2485
- while (true)
2487
+ while (
2488
+ true
2489
+ )
2486
2490
do a + b
2487
- while (true)
2491
+ while (
2492
+ true
2493
+ )
2488
2494
}
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ class FormatTests extends FunSuite with CanRunTests with FormatAssertions {
148
148
val explored = Debug .explored.get()
149
149
logger.debug(s " Total explored: $explored" )
150
150
if (! onlyUnit && ! onlyManual)
151
- assertEquals(explored, 2551504 , " total explored" )
151
+ assertEquals(explored, 2552242 , " total explored" )
152
152
// TODO(olafur) don't block printing out test results.
153
153
TestPlatformCompat .executeAndWait(PlatformFileOps .writeFile(
154
154
FileOps .getPath(" target" , " index.html" ),
You can’t perform that action at this time.
0 commit comments