Skip to content

Commit 96addd7

Browse files
committed
reformat
1 parent c2aa0e0 commit 96addd7

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

scalajslib/src/mill/scalajslib/worker/ScalaJSWorker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private[scalajslib] class ScalaJSWorker extends AutoCloseable {
162162
moduleSplitStyle: api.ModuleSplitStyle,
163163
outputPatterns: api.OutputPatterns,
164164
minify: Boolean,
165-
esModuleMap : Map[String, String]
165+
esModuleMap: Map[String, String]
166166
)(implicit ctx: Ctx.Home): Result[api.Report] = {
167167
bridge(toolsClasspath).link(
168168
runClasspath = runClasspath.iterator.map(_.path.toNIO).toSeq,

scalajslib/test/src/mill/scalajslib/RemapEsModuleTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object EsModuleRemapTests extends TestSuite {
2020
override def scalaJSSourceMap = false
2121
override def moduleKind = ModuleKind.ESModule
2222

23-
override def esModuleRemap: Target[Map[String,String]] = Map(
23+
override def esModuleRemap: Target[Map[String, String]] = Map(
2424
"@stdlib/linspace" -> remapTo
2525
)
2626
}

scalajslib/worker/1/src/mill/scalajslib/worker/ScalaJSWorkerImpl.scala

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -209,32 +209,31 @@ class ScalaJSWorkerImpl extends ScalaJSWorkerApi {
209209
irFiles = if (esModuleMap.isEmpty) {
210210
irFiles0
211211
} else {
212-
val remapFct = esModuleMap.toSeq.foldLeft((in: String) => in){ case(fct, (s1, s2)) =>
213-
val fct2 : (String => String) = (in => in.replace(s1, s2))
214-
(in => fct(fct2(in)))
215-
}
216-
irFiles0.map{ImportMappedIRFile.fromIRFile(_)(remapFct)
212+
val remapFct = esModuleMap.toSeq.foldLeft((in: String) => in) { case (fct, (s1, s2)) =>
213+
val fct2: (String => String) = (in => in.replace(s1, s2))
214+
(in => fct(fct2(in)))
217215
}
216+
irFiles0.map { ImportMappedIRFile.fromIRFile(_)(remapFct) }
218217
}
219218
report <-
220219
if (useLegacy) {
221-
// This uses the legacy linker interface, which is deprecated. The compiler will warn us about it, but the warnings are intentional in a legacy block. Suppress them.
220+
// This uses the legacy linker interface, which is deprecated. The compiler will warn us about it, but the warnings are intentional in a legacy block. Suppress them.
222221
val jsFileName = "out.js"
223222
val jsFile = new File(dest, jsFileName).toPath()
224-
@annotation.nowarn
225-
var linkerOutput = LinkerOutput(PathOutputFile(jsFile))
223+
@annotation.nowarn
224+
var linkerOutput = LinkerOutput(PathOutputFile(jsFile))
226225
.withJSFileURI(java.net.URI.create(jsFile.getFileName.toString))
227-
226+
228227
val sourceMapNameOpt = Option.when(sourceMap)(s"${jsFile.getFileName}.map")
229-
sourceMapNameOpt.foreach { sourceMapName =>
228+
sourceMapNameOpt.foreach { sourceMapName =>
230229
val sourceMapFile = jsFile.resolveSibling(sourceMapName)
231-
@annotation.nowarn
230+
@annotation.nowarn
232231
val outFct = PathOutputFile(sourceMapFile)
233232
linkerOutput = linkerOutput
234-
.withSourceMap( outFct )
233+
.withSourceMap(outFct)
235234
.withSourceMapURI(java.net.URI.create(sourceMapFile.getFileName.toString))
236-
}
237-
@annotation.nowarn
235+
}
236+
@annotation.nowarn
238237
val report = linker.link(irFiles, moduleInitializers, linkerOutput, logger).map {
239238
file =>
240239
Report(
@@ -290,7 +289,7 @@ class ScalaJSWorkerImpl extends ScalaJSWorkerApi {
290289
else runConfig0
291290
.withInheritErr(false)
292291
.withInheritOut(false)
293-
.withOnOutputStream {
292+
.withOnOutputStream {
294293
case (Some(processOut), Some(processErr)) =>
295294
val sources = Seq(
296295
(processOut, System.out, "spawnSubprocess.stdout", false, () => true),

0 commit comments

Comments
 (0)