diff --git a/internal/util-collection/src/main/scala/sbt/internal/util/Dag.scala b/internal/util-collection/src/main/scala/sbt/internal/util/Dag.scala index 3a6e1d414..5cad287da 100644 --- a/internal/util-collection/src/main/scala/sbt/internal/util/Dag.scala +++ b/internal/util-collection/src/main/scala/sbt/internal/util/Dag.scala @@ -56,9 +56,8 @@ object Dag { finished; } final class Cyclic(val value: Any, val all: List[Any], val complete: Boolean) - extends Exception("Cyclic reference involving " + - (if (complete) all.mkString("\n ", "\n ", "") else value) - ) { + extends Exception("Cyclic reference involving " + + (if (complete) all.mkString("\n ", "\n ", "") else value)) { def this(value: Any) = this(value, value :: Nil, false) override def toString = getMessage def ::(a: Any): Cyclic = diff --git a/internal/util-collection/src/test/scala/SettingsExample.scala b/internal/util-collection/src/test/scala/SettingsExample.scala index f7b2f2cf0..5dd408282 100644 --- a/internal/util-collection/src/test/scala/SettingsExample.scala +++ b/internal/util-collection/src/test/scala/SettingsExample.scala @@ -49,7 +49,8 @@ object SettingsUsage { val mySettings: Seq[Setting[_]] = Seq( setting(a3, value(3)), setting(b4, map(a4)(_ * 3)), - update(a5)(_ + 1)) + update(a5)(_ + 1) + ) // "compiles" and applies the settings. // This can be split into multiple steps to access intermediate results if desired. diff --git a/internal/util-collection/src/test/scala/SettingsTest.scala b/internal/util-collection/src/test/scala/SettingsTest.scala index 8b77dba16..85a3760ee 100644 --- a/internal/util-collection/src/test/scala/SettingsTest.scala +++ b/internal/util-collection/src/test/scala/SettingsTest.scala @@ -55,7 +55,8 @@ object SettingsTest extends Properties("settings") { List(scoped0, scoped1) <- chk :: scopedKeys sliding 2 nextInit = if (scoped0 == chk) chk else (scoped0 zipWith chk) { (p, _) => p + 1 } - } yield derive(setting(scoped1, nextInit))).toSeq + } yield derive(setting(scoped1, nextInit)) + ).toSeq { // Note: This causes a cycle refernec error, quite frequently. @@ -95,7 +96,8 @@ object SettingsTest extends Properties("settings") { setting(b, value(6)), derive(setting(b, a)), setting(a, value(5)), - setting(b, value(8))) + setting(b, value(8)) + ) val ev = evaluate(settings) checkKey(a, Some(5), ev) && checkKey(b, Some(8), ev) } @@ -104,7 +106,8 @@ object SettingsTest extends Properties("settings") { setting(a, value(3)), setting(b, value(6)), derive(setting(b, a)), - setting(a, value(5))) + setting(a, value(5)) + ) val ev = evaluate(settings) checkKey(a, Some(5), ev) && checkKey(b, Some(5), ev) } diff --git a/internal/util-complete/src/main/scala/sbt/internal/util/complete/HistoryCommands.scala b/internal/util-complete/src/main/scala/sbt/internal/util/complete/HistoryCommands.scala index f74d4e448..350a36610 100644 --- a/internal/util-complete/src/main/scala/sbt/internal/util/complete/HistoryCommands.scala +++ b/internal/util-complete/src/main/scala/sbt/internal/util/complete/HistoryCommands.scala @@ -34,7 +34,8 @@ object HistoryCommands { Nth -> ("Execute the command with index n, as shown by the " + ListFull + " command"), Previous -> "Execute the nth command before this one", StartsWithString -> "Execute the most recent command starting with 'string'", - ContainsString -> "Execute the most recent command containing 'string'") + ContainsString -> "Execute the most recent command containing 'string'" + ) def helpString = "History commands:\n " + (descriptions.map { case (c, d) => c + " " + d }).mkString("\n ") def printHelp(): Unit = println(helpString) @@ -46,8 +47,7 @@ object HistoryCommands { val MaxLines = 500 lazy val num = token(NatBasic, "") lazy val last = Last ^^^ { execute(_.!!) } - lazy val list = ListCommands ~> (num ?? Int.MaxValue) map { show => - (h: History) => { printHistory(h, MaxLines, show); Some(Nil) } + lazy val list = ListCommands ~> (num ?? Int.MaxValue) map { show => (h: History) => { printHistory(h, MaxLines, show); Some(Nil) } } lazy val execStr = flag('?') ~ token(any.+.string, "") map { case (contains, str) => diff --git a/internal/util-complete/src/main/scala/sbt/internal/util/complete/Parser.scala b/internal/util-complete/src/main/scala/sbt/internal/util/complete/Parser.scala index a41c0d7d2..a6d5474aa 100644 --- a/internal/util-complete/src/main/scala/sbt/internal/util/complete/Parser.scala +++ b/internal/util-complete/src/main/scala/sbt/internal/util/complete/Parser.scala @@ -426,11 +426,10 @@ trait ParserMain { case _ => val ci = i + 1 if (ci >= s.length) - a.resultEmpty.toEither.left.map { msgs0 => - () => - val msgs = msgs0() - val nonEmpty = if (msgs.isEmpty) "Unexpected end of input" :: Nil else msgs - (nonEmpty, ci) + a.resultEmpty.toEither.left.map { msgs0 => () => + val msgs = msgs0() + val nonEmpty = if (msgs.isEmpty) "Unexpected end of input" :: Nil else msgs + (nonEmpty, ci) } else loop(ci, a derive s(ci)) diff --git a/internal/util-complete/src/main/scala/sbt/internal/util/complete/TypeString.scala b/internal/util-complete/src/main/scala/sbt/internal/util/complete/TypeString.scala index 9a308a2bf..e96dbad4f 100644 --- a/internal/util-complete/src/main/scala/sbt/internal/util/complete/TypeString.scala +++ b/internal/util-complete/src/main/scala/sbt/internal/util/complete/TypeString.scala @@ -62,7 +62,8 @@ private[sbt] object TypeString { val TypeMap = Map( "java.io.File" -> "File", "java.net.URL" -> "URL", - "java.net.URI" -> "URI") + "java.net.URI" -> "URI" + ) /** * A Parser that extracts basic structure from the string representation of a type from Manifest.toString. diff --git a/internal/util-complete/src/test/scala/sbt/complete/ParserWithExamplesTest.scala b/internal/util-complete/src/test/scala/sbt/complete/ParserWithExamplesTest.scala index 684cbe403..17891be4f 100644 --- a/internal/util-complete/src/test/scala/sbt/complete/ParserWithExamplesTest.scala +++ b/internal/util-complete/src/test/scala/sbt/complete/ParserWithExamplesTest.scala @@ -18,7 +18,8 @@ class ParserWithExamplesTest extends UnitSpec { val _ = new ParserWithValidExamples { val validCompletions = Completions(Set( suggestion("blue"), - suggestion("red"))) + suggestion("red") + )) parserWithExamples.completions(0) shouldEqual validCompletions } } @@ -27,7 +28,8 @@ class ParserWithExamplesTest extends UnitSpec { "produce only valid examples that start with the character of the derivation" in { val _ = new ParserWithValidExamples { val derivedCompletions = Completions(Set( - suggestion("lue"))) + suggestion("lue") + )) parserWithExamples.derive('b').completions(0) shouldEqual derivedCompletions } } @@ -45,7 +47,8 @@ class ParserWithExamplesTest extends UnitSpec { val _ = new parserWithAllExamples { val derivedCompletions = Completions(Set( suggestion("lue"), - suggestion("lock"))) + suggestion("lock") + )) parserWithExamples.derive('b').completions(0) shouldEqual derivedCompletions } } @@ -56,9 +59,11 @@ class ParserWithExamplesTest extends UnitSpec { class parserWithAllExamples extends ParserExample(removeInvalidExamples = false) - case class ParserExample(examples: Iterable[String] = Set("blue", "yellow", "greeen", "block", "red"), + case class ParserExample( + examples: Iterable[String] = Set("blue", "yellow", "greeen", "block", "red"), maxNumberOfExamples: Int = 25, - removeInvalidExamples: Boolean) { + removeInvalidExamples: Boolean + ) { import DefaultParsers._ @@ -67,7 +72,8 @@ class ParserWithExamplesTest extends UnitSpec { colorParser, FixedSetExamples(examples), maxNumberOfExamples, - removeInvalidExamples) + removeInvalidExamples + ) } case class GrowableSourceOfExamples() extends Iterable[String] { diff --git a/internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala b/internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala index 795423c54..0e15fadf2 100644 --- a/internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala +++ b/internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala @@ -103,7 +103,8 @@ object Logic { checkAcyclic(clauses) problem.toLeft( - reduce0(clauses, initialFacts, Matched.empty)) + reduce0(clauses, initialFacts, Matched.empty) + ) } /** diff --git a/internal/util-logic/src/test/scala/sbt/logic/Test.scala b/internal/util-logic/src/test/scala/sbt/logic/Test.scala index 59b40c34b..91ded0e69 100644 --- a/internal/util-logic/src/test/scala/sbt/logic/Test.scala +++ b/internal/util-logic/src/test/scala/sbt/logic/Test.scala @@ -20,7 +20,8 @@ object LogicTest extends Properties("Logic") { case Right(res) => false case Left(err: Logic.CyclicNegation) => true case Left(err) => sys.error(s"Expected cyclic error, got: $err") - }) + } + ) def expect(result: Either[LogicException, Matched], expected: Set[Atom]) = result match { case Left(err) => false