diff --git a/balancer/src/main/scala/com.olegych.scastie.balancer/DispatchActor.scala b/balancer/src/main/scala/com.olegych.scastie.balancer/DispatchActor.scala index 80520cd63..afc88f440 100644 --- a/balancer/src/main/scala/com.olegych.scastie.balancer/DispatchActor.scala +++ b/balancer/src/main/scala/com.olegych.scastie.balancer/DispatchActor.scala @@ -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) { @@ -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") } } }) } diff --git a/balancer/src/test/scala/com.olegych.scastie.balancer/LoadBalancerTestUtils.scala b/balancer/src/test/scala/com.olegych.scastie.balancer/LoadBalancerTestUtils.scala index a4953d8a2..903d96430 100644 --- a/balancer/src/test/scala/com.olegych.scastie.balancer/LoadBalancerTestUtils.scala +++ b/balancer/src/test/scala/com.olegych.scastie.balancer/LoadBalancerTestUtils.scala @@ -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}") } diff --git a/client/src/main/scala/com.olegych.scastie.client/ScastieState.scala b/client/src/main/scala/com.olegych.scastie.client/ScastieState.scala index 481a27bae..08bdfcf68 100644 --- a/client/src/main/scala/com.olegych.scastie.client/ScastieState.scala +++ b/client/src/main/scala/com.olegych.scastie.client/ScastieState.scala @@ -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)) diff --git a/client/src/main/scala/com.olegych.scastie.client/components/ScaladexSearch.scala b/client/src/main/scala/com.olegych.scastie.client/components/ScaladexSearch.scala index a914c31e9..6a5a9dfd9 100644 --- a/client/src/main/scala/com.olegych.scastie.client/components/ScaladexSearch.scala +++ b/client/src/main/scala/com.olegych.scastie.client/components/ScaladexSearch.scala @@ -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) } diff --git a/instrumentation/src/main/scala/com.olegych.scastie.instrumentation/Instrument.scala b/instrumentation/src/main/scala/com.olegych.scastie.instrumentation/Instrument.scala index b1aa28780..a355a9622 100644 --- a/instrumentation/src/main/scala/com.olegych.scastie.instrumentation/Instrument.scala +++ b/instrumentation/src/main/scala/com.olegych.scastie.instrumentation/Instrument.scala @@ -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) diff --git a/instrumentation/src/main/scala/com.olegych.scastie.instrumentation/Patch.scala b/instrumentation/src/main/scala/com.olegych.scastie.instrumentation/Patch.scala index 192ae1c8e..a37e9c725 100644 --- a/instrumentation/src/main/scala/com.olegych.scastie.instrumentation/Patch.scala +++ b/instrumentation/src/main/scala/com.olegych.scastie.instrumentation/Patch.scala @@ -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("") } diff --git a/sbt-runner/src/main/scala/com.olegych.scastie.sbt/SbtProcess.scala b/sbt-runner/src/main/scala/com.olegych.scastie.sbt/SbtProcess.scala index a334cfa11..7f84e16b0 100644 --- a/sbt-runner/src/main/scala/com.olegych.scastie.sbt/SbtProcess.scala +++ b/sbt-runner/src/main/scala/com.olegych.scastie.sbt/SbtProcess.scala @@ -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")) diff --git a/sbt-scastie/src/main/scala/com.olegych.scastie.sbtscastie/RuntimeErrorLogger.scala b/sbt-scastie/src/main/scala/com.olegych.scastie.sbtscastie/RuntimeErrorLogger.scala index e8e0e0397..7f94b0976 100644 --- a/sbt-scastie/src/main/scala/com.olegych.scastie.sbtscastie/RuntimeErrorLogger.scala +++ b/sbt-scastie/src/main/scala/com.olegych.scastie.sbtscastie/RuntimeErrorLogger.scala @@ -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 => diff --git a/storage/src/main/scala/com.olegych.scastie.storage/OldScastieConverter.scala b/storage/src/main/scala/com.olegych.scastie.storage/OldScastieConverter.scala index 07ad40914..f9aa67ad8 100644 --- a/storage/src/main/scala/com.olegych.scastie.storage/OldScastieConverter.scala +++ b/storage/src/main/scala/com.olegych.scastie.storage/OldScastieConverter.scala @@ -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 {