Skip to content

Commit

Permalink
Reformat with scalafmt 3.7.12
Browse files Browse the repository at this point in the history
Executed command: scalafmt --non-interactive
  • Loading branch information
scala-center-steward[bot] committed Aug 18, 2023
1 parent 57d490e commit d768a45
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ class DispatchActor(progressActor: ActorRef, statusActor: ActorRef)
}

private def logError[T](f: Future[T]) = {
f.recover { case e =>
log.error(e, "failed future")
}
f.recover { case e => log.error(e, "failed future") }
}

def receive: Receive = event.LoggingReceive(event.Logging.InfoLevel) {
Expand Down Expand Up @@ -344,9 +342,7 @@ class DispatchActor(progressActor: ActorRef, statusActor: ActorRef)
.map { _ =>
log.info(s"pinged ${s.ref} server")
}
.recover { case e =>
log.error(e, s"couldn't ping ${s} server")
}
.recover { case e => log.error(e, s"couldn't ping ${s} server") }
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ trait LoadBalancerTestUtils extends AnyFunSuite with TestUtils {

inner.toList
.sortBy { case (k, v) => (-v, k) }
.map { case (k, v) =>
s"$k($v)"
}
.map { case (k, v) => s"$k($v)" }
.mkString("Multiset(", ", ", s") {$size}")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,7 @@ case class ScastieState(
}

def setProgresses(progresses: List[SnippetProgress]): ScastieState = coalesceUpdates { self =>
progresses.foldLeft(self) { case (state, progress) =>
state.addProgress(progress)
}
progresses.foldLeft(self) { case (state, progress) => state.addProgress(progress) }
}

def setSnippetId(snippetId: SnippetId): ScastieState = copyAndSave(snippetId = Some(snippetId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ object ScaladexSearch {
.toSet

val search: List[(Project, String, Option[String], ScalaTarget)] = projects
.flatMap { case (project, target) =>
project.artifacts.map(artifact => (project, artifact, None, target))
}
.flatMap { case (project, target) => project.artifacts.map(artifact => (project, artifact, None, target)) }
.filter { projectAndArtifact =>
!selectedProjectsArtifacts.contains(projectAndArtifact)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ object Instrument {
case _: Term.EndMarker => false
case _ => true
}
.collect { case term: Term =>
instrumentOne(term, None, offset, isScalaJs)
}
.collect { case term: Term => instrumentOne(term, None, offset, isScalaJs) }
}.flatten

val instrumentedCode = Patch(source.tokens, instrumentedCodePatches)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ object Patch {
verifyPatches(patches)
// TODO(olafur) optimize, this is SUPER inefficient
patches
.foldLeft(input) { case (s, p) =>
p.runOn(s)
}
.foldLeft(input) { case (s, p) => p.runOn(s) }
.map(_.syntax)
.mkString("")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ class SbtProcess(
run.progressActor ! p
implicit val tm = Timeout(10.seconds)
(run.snippetActor ? p)
.recover { case e =>
log.error(e, s"error while saving progress $p")
}
.recover { case e => log.error(e, s"error while saving progress $p") }
}

private val sbtDir: Path = customSbtDir.getOrElse(Files.createTempDirectory("scastie"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,9 @@ object RuntimeErrorLogger {
// daaamn
Option(event.getThrown).orElse {
for {
e <- Option(event.getMessage).collect { case e: ObjectMessage =>
e
}
e <- Option(e.getParameter).collect { case e: ObjectEvent[_] =>
e
}
e <- Option(e.message).collect { case e: TraceEvent =>
e
}
e <- Option(event.getMessage).collect { case e: ObjectMessage => e }
e <- Option(e.getParameter).collect { case e: ObjectEvent[_] => e }
e <- Option(e.message).collect { case e: TraceEvent => e }
// since worksheet wraps the code in object we unwrap it to display clearer message
e <- Option(e.message).collect {
case e: ExceptionInInitializerError if e.getCause != null && e.getCause.getStackTrace.headOption.exists { e =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ object OldScastieConverter {
val sbtConfig = content.slice(start, start + blockEndPos - start)
val code = content.drop(blockEndPos + blockEnd.length)

val converterFn = sbtConfig.split("\n").foldLeft(Converter.nil) { case (converter, line) =>
convertLine(line)(converter)
}
val converterFn =
sbtConfig.split("\n").foldLeft(Converter.nil) { case (converter, line) => convertLine(line)(converter) }

converterFn(Inputs.default).copy(code = code.trim)
} else {
Expand Down

0 comments on commit d768a45

Please sign in to comment.