Skip to content

Commit ebb5971

Browse files
committed
run scalafmt
1 parent 661dddc commit ebb5971

File tree

28 files changed

+385
-202
lines changed

28 files changed

+385
-202
lines changed

bsp/src/mill/bsp/BspServerResult.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ object BspServerResult {
3131
upickle.default.macroRW
3232

3333
// GENERATED CODE BY ci/scripts/manual_mirror_gen.sc - DO NOT EDIT
34-
private type SingletonMirrorProxy[T <: AnyRef & Singleton] = Mirror.SingletonProxy { val value: T }
34+
private type SingletonMirrorProxy[T <: AnyRef & Singleton] =
35+
Mirror.SingletonProxy { val value: T }
3536
private def genSingletonMirror[T <: AnyRef & Singleton](ref: T): SingletonMirrorProxy[T] =
3637
new Mirror.SingletonProxy(ref).asInstanceOf[SingletonMirrorProxy[T]]
3738
private given Mirror_ReloadWorkspace: SingletonMirrorProxy[ReloadWorkspace.type] =

contrib/docker/src/mill/contrib/docker/DockerModule.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,10 @@ trait DockerModule { outer: JavaModule =>
182182
)
183183
.call(stdout = os.Inherit, stderr = os.Inherit)
184184
}
185-
log.info(s"Docker build completed ${if (result.exitCode == 0) "successfully"
186-
else "unsuccessfully"} with ${result.exitCode}")
185+
log.info(s"Docker build completed ${
186+
if (result.exitCode == 0) "successfully"
187+
else "unsuccessfully"
188+
} with ${result.exitCode}")
187189
tags()
188190
}
189191

idea/src/mill/idea/GenIdeaImpl.scala

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -772,14 +772,14 @@ case class GenIdeaImpl(
772772
<library name={name} type="Scala">
773773
<properties>
774774
{
775-
if (languageLevel.isDefined)
776-
<language-level>{languageLevel.get}</language-level>
777-
else {
778-
// Scala 3: I assume there is some missing implicit conversion from `()` to NodeSeq,
779-
// so use an explicit seq.
780-
NodeSeq.Empty
781-
}
782-
}
775+
if (languageLevel.isDefined)
776+
<language-level>{languageLevel.get}</language-level>
777+
else {
778+
// Scala 3: I assume there is some missing implicit conversion from `()` to NodeSeq,
779+
// so use an explicit seq.
780+
NodeSeq.Empty
781+
}
782+
}
783783
<compiler-classpath>
784784
{
785785
scalaCompilerClassPath.iterator.toSeq.sortBy(_.wrapped).map(p =>
@@ -788,14 +788,16 @@ case class GenIdeaImpl(
788788
}
789789
</compiler-classpath>
790790
{
791-
if (compilerBridgeJar.isDefined)
792-
<compiler-bridge-binary-jar>{relativeFileUrl(compilerBridgeJar.get)}</compiler-bridge-binary-jar>
793-
else {
794-
// Scala 3: I assume there is some missing implicit conversion from `()` to NodeSeq,
795-
// so use an explicit seq.
796-
NodeSeq.Empty
797-
}
798-
}
791+
if (compilerBridgeJar.isDefined)
792+
<compiler-bridge-binary-jar>{
793+
relativeFileUrl(compilerBridgeJar.get)
794+
}</compiler-bridge-binary-jar>
795+
else {
796+
// Scala 3: I assume there is some missing implicit conversion from `()` to NodeSeq,
797+
// so use an explicit seq.
798+
NodeSeq.Empty
799+
}
800+
}
799801
</properties>
800802
</library>
801803
</component>
@@ -812,16 +814,16 @@ case class GenIdeaImpl(
812814
<root url={relativeJarUrl(path)}/>
813815
</CLASSES>
814816
{
815-
if (sources.isDefined) {
816-
<SOURCES>
817+
if (sources.isDefined) {
818+
<SOURCES>
817819
<root url={relativeJarUrl(sources.get)}/>
818820
</SOURCES>
819-
} else {
820-
// Scala 3: I assume there is some missing implicit conversion from `()` to NodeSeq,
821-
// so use an explicit seq.
822-
NodeSeq.Empty
823-
}
824-
}
821+
} else {
822+
// Scala 3: I assume there is some missing implicit conversion from `()` to NodeSeq,
823+
// so use an explicit seq.
824+
NodeSeq.Empty
825+
}
826+
}
825827
</library>
826828
</component>
827829
}

integration/failure/root-module-compile-error/src/RootModuleCompileErrorTests.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ object RootModuleCompileErrorTests extends UtestIntegrationTestSuite {
1616
// For now these error messages still show generated/mangled code; not ideal, but it'll do
1717
assert(res.err.contains("""build.mill:7:50"""))
1818
assert(res.err.contains("""Not found: type UnknownRootModule"""))
19-
assert(res.err.contains("""abstract class package_ extends RootModule with UnknownRootModule {"""))
20-
assert(res.err.contains(""" ^^^^^^^^^^^^^^^^^"""))
19+
assert(res.err.contains(
20+
"""abstract class package_ extends RootModule with UnknownRootModule {"""
21+
))
22+
assert(
23+
res.err.contains(""" ^^^^^^^^^^^^^^^^^""")
24+
)
2125
}
2226

2327
locally {

integration/feature/plugin-classpath/src/MillPluginClasspathTest.scala

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import scala.concurrent.Future
77
import scala.concurrent.ExecutionContext
88
import java.util.concurrent.atomic.AtomicReference
99

10-
/**Trait that provides a `skip` method that can be used to skip a test, the test will pass.
10+
/**
11+
* Trait that provides a `skip` method that can be used to skip a test, the test will pass.
1112
* Used to assert that a test still compiles, and is intended to be re-enabled later,
1213
* but is temporarily prevented from running for a suitable reason.
1314
* At the end of a suite, print a summary of the number of skipped tests, and their names.
@@ -17,20 +18,26 @@ trait UTestIgnore(name: String) extends utest.TestSuite {
1718

1819
val skipList = AtomicReference(List.empty[String])
1920

20-
private final class SkipException(val name: String) extends Exception with scala.util.control.NoStackTrace
21+
private final class SkipException(val name: String) extends Exception
22+
with scala.util.control.NoStackTrace
2123

2224
def skip(op: => Any)(using path: utest.framework.TestPath): Nothing = {
2325
throw new SkipException(name + "." + path.value.mkString("."))
2426
}
2527

2628
private def red(str: String) = Console.RED + str + Console.RESET
2729

28-
override def utestWrap(path: Seq[String], runBody: => Future[Any])(implicit ec: ExecutionContext): Future[Any] = {
29-
super.utestWrap(path, runBody.recoverWith {
30-
case e: SkipException =>
31-
skipList.updateAndGet(e.name :: _)
32-
Future.successful(())
33-
})
30+
override def utestWrap(path: Seq[String], runBody: => Future[Any])(implicit
31+
ec: ExecutionContext
32+
): Future[Any] = {
33+
super.utestWrap(
34+
path,
35+
runBody.recoverWith {
36+
case e: SkipException =>
37+
skipList.updateAndGet(e.name :: _)
38+
Future.successful(())
39+
}
40+
)
3441
}
3542

3643
override def utestAfterAll(): Unit = {
@@ -46,7 +53,7 @@ trait UTestIgnore(name: String) extends utest.TestSuite {
4653
}
4754

4855
object MillPluginClasspathTest extends UtestIntegrationTestSuite
49-
with UTestIgnore("mill.integration.MillPluginClasspathTest") {
56+
with UTestIgnore("mill.integration.MillPluginClasspathTest") {
5057

5158
val embeddedModules: Seq[(String, String)] = Seq(
5259
("com.lihaoyi", "mill-main-client"),

integration/ide/gen-idea/src/GenIdeaUtils.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ object GenIdeaUtils {
2828
)
2929
}
3030
println(
31-
s"Checking ${expectedResourcePath.relativeTo(workspacePath)} ... ${if (check.isSuccess) "OK"
32-
else "FAILED"}"
31+
s"Checking ${expectedResourcePath.relativeTo(workspacePath)} ... ${
32+
if (check.isSuccess) "OK"
33+
else "FAILED"
34+
}"
3335
)
3436
check.get
3537
}

main/api/src/mill/api/JarManifest.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ object JarManifest {
7171

7272
final def fromProduct(p: scala.Product): JarManifest = {
7373
val _1: Map[String, String] = p.productElement(0).asInstanceOf[Map[String, String]]
74-
val _2: Map[String, Map[String, String]] = p.productElement(1).asInstanceOf[Map[String, Map[String, String]]]
74+
val _2: Map[String, Map[String, String]] =
75+
p.productElement(1).asInstanceOf[Map[String, Map[String, String]]]
7576

76-
JarManifest.apply(_1,_2)
77+
JarManifest.apply(_1, _2)
7778
}
7879
}
7980

main/api/src/mill/api/Retry.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ case class Retry(
3838
if (timeoutMillis == -1) t(retryCount)
3939
else {
4040
val result = Promise[T]
41-
val thread = new Thread({() =>
41+
val thread = new Thread({ () =>
4242
result.complete(scala.util.Try(t(retryCount)))
4343
}: Runnable)
4444
thread.start()

main/codesig/src/ResolvedCalls.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ object ResolvedCalls {
113113
val externalSamDefiners = externalSummary
114114
.directMethods
115115
.map { case (k, v) => (k, v.collect { case (sig, true) => sig }) }
116-
.collect { case (k, Seq[MethodSig](v)) => (k, v) } // Scala 3.5.0-RC6 - can not infer MethodSig here
116+
.collect { case (k, Seq[MethodSig](v)) =>
117+
(k, v)
118+
} // Scala 3.5.0-RC6 - can not infer MethodSig here
117119

118120
val allSamDefiners = localSamDefiners ++ externalSamDefiners
119121

main/codesig/src/SpanningForest.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ object SpanningForest {
3636
.groupMap(_._1)(_._2)
3737

3838
ResolvedCalls.breadthFirst(rootChangedNodeIndices) { index =>
39-
val nextIndices = downstreamGraphEdges.getOrElse(index, Array[Int]()) // needed to add explicit type for Scala 3.5.0-RC6
39+
val nextIndices =
40+
downstreamGraphEdges.getOrElse(
41+
index,
42+
Array[Int]()
43+
) // needed to add explicit type for Scala 3.5.0-RC6
4044
// We build up the spanningForest during a normal breadth first search,
4145
// using the `nodeMapping` to quickly find an vertice's tree node so we
4246
// can add children to it. We need to duplicate the `seen.contains` logic

0 commit comments

Comments
 (0)