Skip to content

Commit

Permalink
Run scalafmt and scalafix
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg committed Dec 27, 2021
1 parent fd6808c commit ae8b86e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ val sharedSettings = List(
"-Wconf:cat=unused-privates&msg=never used:s",
"-Wconf:cat=unused-params&msg=never used:s",
//"-Werror", // not 2.12
"-Xfatal-warnings",
"-Xfatal-warnings"
)
case _ =>
List(
Expand Down
42 changes: 6 additions & 36 deletions munit/shared/src/main/scala/munit/MUnitRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
with Configurable {

def this(cls: Class[_ <: Suite]) =
this(MUnitRunner.ensureEligibleConstructor(cls), () => cls.getDeclaredConstructor().newInstance())
this(
MUnitRunner.ensureEligibleConstructor(cls),
() => cls.getDeclaredConstructor().newInstance()
)

val suite: Suite = newInstance()

Expand Down Expand Up @@ -166,12 +169,7 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
loop(futures, mutable.ListBuffer.empty)
}

private def munitTimeout(): Option[Duration] = {
suite match {
case funSuite: FunSuite => Some(funSuite.munitTimeout)
case _ => None
}
}


private def runAll(notifier: RunNotifier): Future[Unit] = {
if (PlatformCompat.isIgnoreSuite(cls)) {
Expand Down Expand Up @@ -365,35 +363,7 @@ class MUnitRunner(val cls: Class[_ <: Suite], newInstance: () => Suite)
val sync: Try[Unit],
val async: List[Future[Any]]
)
private def foreachUnsafe(
thunks: Iterable[() => Any]
): ForeachUnsafeResult = {
val errors = mutable.ListBuffer.empty[Throwable]
val async = mutable.ListBuffer.empty[Future[Any]]
thunks.foreach { thunk =>
try {
thunk() match {
case f: Future[_] =>
async += f
case _ =>
}
} catch {
case ex if NonFatal(ex) =>
errors += ex
}
}
errors.toList match {
case head :: tail =>
tail.foreach { e =>
if (e ne head) {
head.addSuppressed(e)
}
}
new ForeachUnsafeResult(scala.util.Failure(head), Nil)
case _ =>
new ForeachUnsafeResult(scala.util.Success(()), Nil)
}
}


private def runHiddenTest(
notifier: RunNotifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Diffs {
def create(obtained: String, expected: String): Diff =
new Diff(obtained, expected)

@deprecated("", since="")
@deprecated("", since = "")
def assertNoDiff(
obtained: String,
expected: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ trait Equalizer[T] {
object Equalizer {
def default[T]: Equalizer[T] = new Equalizer[T] {
override def equals(original: T, revised: T): Boolean = {
original == revised //original.equals(revised)
original == revised //original.equals(revised)
}
}
}

0 comments on commit ae8b86e

Please sign in to comment.