Skip to content

Commit

Permalink
scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Podsiadlo committed Mar 24, 2022
1 parent 7136719 commit ba79d88
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 34 deletions.
4 changes: 2 additions & 2 deletions backend/src/main/scala/bloop/reporter/Reporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ abstract class Reporter(
}
}

protected val phasesAtFile: TrieMap[File,String] = TrieMap.empty[File, String]
protected val filesToPhaseStack: TrieMap[File,List[String]] = TrieMap.empty[File, List[String]]
protected val phasesAtFile: TrieMap[File, String] = TrieMap.empty[File, String]
protected val filesToPhaseStack: TrieMap[File, List[String]] = TrieMap.empty[File, List[String]]

// Adapted from https://github.com/scala/scala/blob/2.12.x/src/compiler/scala/tools/nsc/reporters/AbstractReporter.scala#L68-L88
private def deduplicate(problem: xsbti.Problem): Boolean = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ final class BloopAnalysisCallback(
}
}

def classDependency(onClassName: String, sourceClassName: String, context: DependencyContext): Unit = {
def classDependency(
onClassName: String,
sourceClassName: String,
context: DependencyContext
): Unit = {
if (onClassName != sourceClassName)
add(intSrcDeps, sourceClassName, InternalDependency.of(sourceClassName, onClassName, context))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ final class ConcurrentAnalysisCallback(
}
}

def classDependency(onClassName: String, sourceClassName: String, context: DependencyContext): Unit = {
def classDependency(
onClassName: String,
sourceClassName: String,
context: DependencyContext
): Unit = {
if (onClassName != sourceClassName)
add(intSrcDeps, sourceClassName, InternalDependency.of(sourceClassName, onClassName, context))
}
Expand Down
2 changes: 0 additions & 2 deletions bloopgun/src/main/scala/bloop/bloopgun/Defaults.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package bloop.bloopgun



object Defaults {
val Version = "0.9.3"
val Host = "127.0.0.1"
Expand Down
3 changes: 2 additions & 1 deletion config/src/main/scala/bloop/config/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ object Config {
)
)

val DefaultFrameworks: List[TestFramework] = List(JUnit, ScalaTest, ScalaCheck, Specs2, utest, munit)
val DefaultFrameworks: List[TestFramework] =
List(JUnit, ScalaTest, ScalaCheck, Specs2, utest, munit)
}

case class TestArgument(args: List[String], framework: Option[TestFramework])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LoggingEventHandler(logger: Logger) extends BloopTestSuiteEventHandler {
protected var suitesDuration = 0L
protected var suitesPassed = 0
protected var suitesAborted = 0
protected val testsFailedBySuite: mutable.SortedMap[SuiteName,Map[TestName,FailureMessage]] =
protected val testsFailedBySuite: mutable.SortedMap[SuiteName, Map[TestName, FailureMessage]] =
mutable.SortedMap.empty[SuiteName, Map[TestName, FailureMessage]]
protected var suitesTotal = 0

Expand Down
6 changes: 4 additions & 2 deletions frontend/src/test/scala/bloop/ForkerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ class ForkerSpec {
|}""".stripMargin
}

val dependencies: Map[String,Set[String]] = Map.empty[String, Set[String]]
val runnableProject: Map[String,Map[String,String]] = Map(TestUtil.RootProject -> Map("A.scala" -> ArtificialSources.`A.scala`))
val dependencies: Map[String, Set[String]] = Map.empty[String, Set[String]]
val runnableProject: Map[String, Map[String, String]] = Map(
TestUtil.RootProject -> Map("A.scala" -> ArtificialSources.`A.scala`)
)

private def run(
cwd: AbsolutePath,
Expand Down
38 changes: 19 additions & 19 deletions frontend/src/test/scala/bloop/RunSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,28 @@ class RunSpec extends BloopHelpers {

private object ArtificialSources {
val RunnableClass0: String = s"""package $packageName
|object $mainClassName0 {
| def main(args: Array[String]): Unit = {
| println(s"$mainClassName0: $${args.mkString(", ")}")
| }
|}""".stripMargin
|object $mainClassName0 {
| def main(args: Array[String]): Unit = {
| println(s"$mainClassName0: $${args.mkString(", ")}")
| }
|}""".stripMargin
val RunnableClass1: String = s"""package $packageName
|object $mainClassName1 {
| def main(args: Array[String]): Unit = {
| println(s"$mainClassName1: $${args.mkString(", ")}")
| }
|}""".stripMargin
|object $mainClassName1 {
| def main(args: Array[String]): Unit = {
| println(s"$mainClassName1: $${args.mkString(", ")}")
| }
|}""".stripMargin
val NotRunnable: String = s"""package $packageName
|object NotRunnable {
| def foo(): Int = 42
|}""".stripMargin
|object NotRunnable {
| def foo(): Int = 42
|}""".stripMargin
val InheritedRunnable: String = s"""package $packageName
|class BaseRunnable {
| def main(args: Array[String]): Unit = {
| println(s"$mainClassName2: $${args.mkString(", ")}")
| }
|}
|object $mainClassName2 extends BaseRunnable""".stripMargin
|class BaseRunnable {
| def main(args: Array[String]): Unit = {
| println(s"$mainClassName2: $${args.mkString(", ")}")
| }
|}
|object $mainClassName2 extends BaseRunnable""".stripMargin
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ object ScalaNativeKeys {
import sbt.{settingKey, taskKey}
val nativeClang: TaskKey[File] = taskKey[File]("Location of the clang compiler.")
val nativeClangPP: TaskKey[File] = taskKey[File]("Location of the clang++ compiler.")
val nativeLinkStubs: SettingKey[Boolean] = settingKey[Boolean]("Whether to link `@stub` methods, or ignore them.")
val nativeLinkStubs: SettingKey[Boolean] =
settingKey[Boolean]("Whether to link `@stub` methods, or ignore them.")
val nativeLink: TaskKey[File] = taskKey[File]("Generates native binary without running it.")
val nativeMode: SettingKey[String] = settingKey[String]("Compilation mode, either \"debug\" or \"release\".")
val nativeGC: SettingKey[String] = settingKey[String]("GC choice, either \"none\", \"boehm\" or \"immix\".")
val nativeMode: SettingKey[String] =
settingKey[String]("Compilation mode, either \"debug\" or \"release\".")
val nativeGC: SettingKey[String] =
settingKey[String]("GC choice, either \"none\", \"boehm\" or \"immix\".")

val nativeCompileOptions: TaskKey[Seq[String]] =
taskKey[Seq[String]]("Additional options are passed to clang during compilation.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class LauncherBaseSuite(
) extends BaseSuite {
val defaultConfig: ServerConfig = ServerConfig(port = Some(bloopServerPort))

val oldEnv: ju.Map[String,String] = System.getenv()
val oldEnv: ju.Map[String, String] = System.getenv()
val oldCwd: AbsolutePath = AbsolutePath(System.getProperty("user.dir"))
val oldHomeDir: AbsolutePath = AbsolutePath(System.getProperty("user.home"))
val oldIvyHome: Option[String] = Option(System.getProperty("ivy.home"))
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34")

0 comments on commit ba79d88

Please sign in to comment.