[2.0.x] ci: Scalafmt 3.11.1 (#9280)

Apply Scalafmt
This commit is contained in:
eugene yokota 2026-05-31 16:30:32 -04:00 committed by GitHub
parent f78a141dd5
commit ae1192109d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
165 changed files with 356 additions and 358 deletions

View File

@ -1,4 +1,4 @@
version = 3.8.3
version = 3.11.1
runner.dialect = scala3
maxColumn = 100

View File

@ -203,10 +203,10 @@ lazy val sbtRoot: Project = (project in file("."))
val dir = nativeInstallDirectory.?.value
val target = Def.spaceDelimited("").parsed.headOption match {
case Some(p) => file(p).toPath
case _ =>
case _ =>
dir match {
case Some(d) => d / "sbtn"
case _ =>
case _ =>
val msg = "Expected input parameter <path>: installNativeExecutable /usr/local/bin"
throw new IllegalStateException(msg)
}

View File

@ -4,7 +4,7 @@ package util
package appmacro
import java.io.File
import java.nio.file.{ Path as NioPath }
import java.nio.file.Path as NioPath
import scala.collection.mutable.ListBuffer
import scala.reflect.ClassTag
import scala.quoted.*
@ -203,7 +203,7 @@ trait Cont:
$applicativeExpr.pure[A1] { () => $body }
}
eitherTree match
case Left(_) => pure0[Effect[A]](inner(body).asExprOf[Effect[A]])
case Left(_) => pure0[Effect[A]](inner(body).asExprOf[Effect[A]])
case Right(_) =>
flatten(pure0[F[Effect[A]]](inner(body).asExprOf[F[Effect[A]]]))
@ -296,7 +296,7 @@ trait Cont:
s"qual (${qual}) not found in ${inputs.map(_.qual)}"
)
applyTuple(p0, br.inputTupleTypeRepr, idx)
}
}
val modifiedBody =
transformWrappers(body.asTerm.changeOwner(sym), substitute, sym).asExprOf[A1]
cacheConfigExprOpt match
@ -467,7 +467,7 @@ trait Cont:
// todo cache opt-out attribute
inputBuf += Input(TypeRepr.of[a], qual, replacement, freshName("q"))
oldTree
}
}
val exprWithConfig =
cacheConfigExprOpt.map(config => '{ $config; $expr }).getOrElse(expr)
val body = transformWrappers(exprWithConfig.asTerm, record, Symbol.spliceOwner)

View File

@ -101,7 +101,7 @@ trait ContextUtil[C <: Quotes & scala.Singleton](val valStart: Int):
case Some(annot) =>
annot.asExprOf[cacheLevel] match
case '{ cacheLevel(include = Array.empty[CacheLevelTag](using $_)) } => Nil
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
include.value.get.toList
case _ => sys.error(Printer.TreeStructure.show(annot) + " does not match")
case _ =>
@ -119,14 +119,14 @@ trait ContextUtil[C <: Quotes & scala.Singleton](val valStart: Int):
case Apply(TypeApply(_, _), List(t @ Ident(_))) =>
t.symbol.getAnnotation(cacheLevelSym) match
case Some(_) => cacheLevelsForSym(t.symbol)
case None =>
case None =>
t.symbol.getAnnotation(transientSym) match
case Some(_) => Nil
case _ => CacheLevelTag.all.toList
case u =>
u.symbol.getAnnotation(cacheLevelSym) match
case Some(_) => cacheLevelsForSym(u.symbol)
case None =>
case None =>
u.symbol.getAnnotation(transientSym) match
case Some(_) => Nil
case _ => CacheLevelTag.all.toList
@ -136,7 +136,7 @@ trait ContextUtil[C <: Quotes & scala.Singleton](val valStart: Int):
case Some(annot) if annot.symbol.owner.name == "cacheLevel" =>
annot.asExprOf[cacheLevel] match
case '{ cacheLevel(include = Array.empty[CacheLevelTag](using $_)) } => Nil
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
include.value.get
case _ => report.errorAndAbort(Printer.TreeStructure.show(annot) + " does not match")
case _ => CacheLevelTag.all.toList

View File

@ -23,7 +23,7 @@ object ConvertTestMacro:
(name: String, tpe: Type[a], qual: Term, replace: Term) =>
convert1.convert[Boolean](name, qual) transform { (tree: Term) =>
addTypeCon(tpe, tree, replace)
}
}
convert1.transformWrappers(expr.asTerm, substitute, Symbol.spliceOwner).asExprOf[Boolean]
class InputInitConvert[C <: Quotes & scala.Singleton](override val qctx: C)

View File

@ -9,7 +9,7 @@
package sbt.internal.util
import java.io.*
import java.util.{ List as JList }
import java.util.List as JList
import jline.console.ConsoleReader
import jline.console.history.{ FileHistory, MemoryHistory }
@ -210,7 +210,7 @@ abstract class JLine extends LineReader {
val lines0 = """\r?\n""".r.split(prompt)
lines0.length match {
case 0 | 1 => handleProgress(prompt)
case _ =>
case _ =>
val lines = lines0.toList map handleProgress
// Workaround for regression jline/jline2#205
reader.getOutput.write(lines.init.mkString("\n") + "\n")

View File

@ -9,7 +9,7 @@
package sbt.internal.util
package complete
import java.lang.Character.{ toLowerCase as lower }
import java.lang.Character.toLowerCase as lower
/** @author Paul Phillips */
object EditDistance {

View File

@ -230,7 +230,7 @@ object Parser extends ParserMain:
a.ifValid {
a.result match {
case Some(av) => success(f(av))
case None =>
case None =>
a match {
case m: MapParser[?, ?] => m.map(f)
case _ => new MapParser(a, f)
@ -311,7 +311,7 @@ object Parser extends ParserMain:
repeated match {
case _: Invalid if min == 0 => invalidButOptional
case i: Invalid => i
case _ =>
case _ =>
repeated.result match {
case Some(value) =>
success(revAcc reverse_::: value :: Nil) // revAcc should be Nil here
@ -510,7 +510,7 @@ trait ParserMain {
def loop(i: Int, a: Parser[T]): Either[() => (Seq[String], Int), T] =
a match {
case Invalid(f) => Left(() => (f.errors, i))
case _ =>
case _ =>
val ci = i + 1
if (ci >= s.length)
a.resultEmpty.toEither.left.map { msgs0 => () =>
@ -571,7 +571,7 @@ trait ParserMain {
if (a.valid) {
a.result match {
case Some(av) => success(av)
case None =>
case None =>
new ParserWithExamples(a, completions, maxNumberOfExamples, removeInvalidExamples)
}
} else a
@ -583,7 +583,7 @@ trait ParserMain {
): Parser[String] =
t match {
case i: Invalid => if (partial && seen.nonEmpty) success(seen.mkString) else i
case _ =>
case _ =>
if (t.result.isEmpty)
new MatchedString(t, seen, partial)
else
@ -1022,7 +1022,7 @@ private final class Repeat[T](
lazy val resultEmpty: Result[Seq[T]] = {
val partialAccumulatedOption =
partial match {
case None => (Value(accumulatedReverse): Result[List[T]])
case None => (Value(accumulatedReverse): Result[List[T]])
case Some(partialPattern) =>
partialPattern.resultEmpty.map(_ :: accumulatedReverse)
}

View File

@ -281,7 +281,7 @@ trait Parsers {
def impl(): Parser[String] = {
(open ~ (notDelim ~ close).?).flatMap {
case (l, Some((content, r))) => Parser.success(s"$l$content$r")
case (l, None) =>
case (l, None) =>
((notDelim ~ impl()).map { (leftPrefix, nestedBraces) =>
leftPrefix + nestedBraces
}.+ ~ notDelim ~ close).map { case ((nested, suffix), r) =>

View File

@ -8,7 +8,7 @@
package sbt.internal.util
import java.lang.{ Process as JProcess }
import java.lang.Process as JProcess
import java.util.concurrent.ConcurrentHashMap
import scala.sys.process.Process

View File

@ -85,7 +85,7 @@ object Util:
lazy val javaHome: Path =
sys.env.get("JAVA_HOME") match
case Some(home) => Paths.get(home)
case None =>
case None =>
if sys.props("java.home").endsWith("jre") then Paths.get(sys.props("java.home")).getParent()
else Paths.get(sys.props("java.home"))

View File

@ -514,7 +514,7 @@ trait Appender extends AutoCloseable {
contentType match {
case "sbt.internal.util.TraceEvent" => appendTraceEvent(oe.message.asInstanceOf[TraceEvent])
case "sbt.internal.util.ProgressEvent" =>
case _ =>
case _ =>
LogExchange.stringCodec[AnyRef](contentType) match {
case Some(codec) if contentType == "sbt.internal.util.SuccessEvent" =>
codec.showLines(oe.message.asInstanceOf[AnyRef]).toVector foreach { success(_) }

View File

@ -102,12 +102,12 @@ object EscHelpers {
var leftDigit = -1
while (i < bytes.length) {
bytes(i) match {
case 27 => state = esc
case 27 => state = esc
case b if (state == esc || state == csi) && b >= 48 && b < 58 =>
state = csi
digit += b
case '[' if state == esc => state = csi
case 8 =>
case 8 =>
state = 0
index = index - 1
case b if state == csi =>
@ -165,7 +165,7 @@ object EscHelpers {
state = csi
digit += b
case '[' if state == esc => state = csi
case 8 =>
case 8 =>
state = 0
index = math.max(index - 1, 0)
case b if state == csi =>
@ -208,21 +208,21 @@ object EscHelpers {
val digit = new ArrayBuffer[Byte]
var leftDigit = -1
bytes.foreach {
case 27 => state = esc
case 27 => state = esc
case b if (state == esc || state == csi) && b >= 48 && b < 58 =>
state = csi
digit += b
case '[' if state == esc => state = csi
case 8 =>
case 8 =>
state = 0
index = math.max(index - 1, 0)
case b if state == csi =>
leftDigit = Try(new String(digit.toArray).toInt).getOrElse(0)
state = 0
b.toChar match {
case 'h' => index = math.max(index - 1, 0)
case 'D' => index = math.max(index - leftDigit, 0)
case 'C' => index = math.min(limit, math.min(index + leftDigit, res.length - 1))
case 'h' => index = math.max(index - 1, 0)
case 'D' => index = math.max(index - leftDigit, 0)
case 'C' => index = math.min(limit, math.min(index + leftDigit, res.length - 1))
case 'K' | 'J' =>
if (leftDigit > 0) (0 until index).foreach(res(_) = 32)
else res(index) = 32
@ -232,7 +232,7 @@ object EscHelpers {
}
digit.clear()
case b if state == esc => state = 0
case b =>
case b =>
res(index) = b
index += 1
limit = math.max(limit, index)

View File

@ -50,7 +50,7 @@ private[sbt] object JLine3 {
var res = -2
while (i < 4 && res == -2) {
inputStream.read() match {
case -1 => res = -1
case -1 => res = -1
case byte =>
bytes(i) = byte.toByte
i += 1
@ -154,7 +154,7 @@ private[sbt] object JLine3 {
if (buffer.isEmpty) fillBuffer()
buffer.take match {
case i if i == -1 => -1
case i =>
case i =>
buf(0) = i.toChar
1
}

View File

@ -692,7 +692,7 @@ object Terminal {
override def read(b: Array[Byte]): Int = read(b, 0, b.length)
override def read(b: Array[Byte], off: Int, len: Int): Int = {
read() match {
case -1 => -1
case -1 => -1
case byte =>
b(off) = byte.toByte
1
@ -719,12 +719,12 @@ object Terminal {
override def run(): Unit = while (running.get) {
bootInputStreamHolder.get match {
case null =>
case is =>
case is =>
def readFrom(inputStream: InputStream) =
try {
if (running.get) {
inputStream.read match {
case -1 =>
case -1 =>
case `NO_BOOT_CLIENTS_CONNECTED` =>
if (!Terminal.hasConsole) {
result.put(-1)

View File

@ -62,7 +62,7 @@ private[util] class WindowsInputStream(term: org.jline.terminal.Terminal, in: In
*/
private def readConsoleInput(): Array[Byte] = {
WindowsSupport.readConsoleInput(1) match {
case null => Array.empty
case null => Array.empty
case events =>
val sb = new StringBuilder();
events.foreach { event =>

View File

@ -11,7 +11,7 @@ package sbt.util
import java.io.File
import java.util.Optional
import java.util.function.Supplier
import java.{ util as ju }
import java.util as ju
import xsbti.{
Action,
@ -32,7 +32,7 @@ object InterfaceUtil {
override def get: A = a
}
import java.util.function.{ Function as JavaFunction }
import java.util.function.Function as JavaFunction
def toJavaFunction[A1, R](f: A1 => R): JavaFunction[A1, R] =
(t: A1) => f(t)

View File

@ -8,7 +8,7 @@
package sbt.util
import xsbti.{ Logger as xLogger }
import xsbti.Logger as xLogger
import sys.process.ProcessLogger
import sbt.internal.util.{ BufferedLogger, FullLogger }

View File

@ -245,7 +245,7 @@ object Logic {
state: Matched
): Matched =
applyAll(clauses, factsToProcess) match {
case None => state // all of the remaining clauses failed on the new facts
case None => state // all of the remaining clauses failed on the new facts
case Some(applied) =>
val (proven, unprovenClauses) = findProven(applied)
val processedFacts = state.add(keepPositive(factsToProcess))
@ -397,7 +397,7 @@ object Logic {
else (And(newLits): Formula)
Some(newF) // 1.
}
case True => Some(True)
case True => Some(True)
case lit: Literal => // define in terms of And
substitute(And(Set(lit)), facts)
}

View File

@ -35,7 +35,7 @@ object LogicTest extends Properties("Logic") {
*/
def expect(result: Either[LogicException, Matched], expected: Set[Atom]) = result match {
case Left(_) => false
case Left(_) => false
case Right(res) =>
val actual = res.provenSet
if (actual != expected)

View File

@ -70,7 +70,7 @@ class FileCommands(baseDirectory: File) extends BasicStatementHandler {
val combined = globs(exprs1) match
case Nil => sys.error("unexpected Nil")
case g :: Nil => g
case g :: gs =>
case g :: gs =>
gs.foldLeft(g) { (acc, g) =>
acc || g
}
@ -164,7 +164,7 @@ class FileCommands(baseDirectory: File) extends BasicStatementHandler {
commandName -> {
case Nil => scriptError("No paths specified for " + commandName + " command.")
case path :: Nil => scriptError("No destination specified for " + commandName + " command.")
case paths =>
case paths =>
val mapped = fromStrings(paths)
val map = mapper(mapped.last)
IO.copy(mapped.init.pair(map))

View File

@ -10,7 +10,7 @@ package sbt
package internal
package scripted
import java.{ util as ju }
import java.util as ju
import java.net.URL
final class FilteredLoader(parent: ClassLoader) extends ClassLoader(parent) {

View File

@ -68,7 +68,7 @@ class TestScriptParser(handlers: Map[Char, StatementHandler]) extends RegexParse
): List[(StatementHandler, Statement)] = {
parseAll(statements(stripQuotes), script) match {
case Success(result, next) => result
case err: NoSuccess => {
case err: NoSuccess => {
val labelString = label.map("'" + _ + "' ").getOrElse("")
sys.error("Could not parse test script, " + labelString + err.toString)
}

View File

@ -10,7 +10,7 @@ private[librarymanagement] abstract class InlineConfigurationFunctions {
) =
if (explicitConfigurations.isEmpty) {
defaultConfiguration match {
case Some(Configurations.DefaultIvyConfiguration) => Configurations.Default :: Nil
case Some(Configurations.DefaultIvyConfiguration) => Configurations.Default :: Nil
case Some(Configurations.DefaultMavenConfiguration) =>
Configurations.defaultMavenConfigurations
case _ => Nil

View File

@ -125,9 +125,9 @@ private[librarymanagement] abstract class SemComparatorExtra {
// Identifiers consisting of only digits are compared numerically.
// Numeric identifiers always have lower precedence than non-numeric identifiers.
// Identifiers with letters are compared case-insensitive lexical order.
case (true, true) => implicitly[Ordering[Long]].compare(ts1head.toLong, ts2head.toLong)
case (false, true) => 1
case (true, false) => -1
case (true, true) => implicitly[Ordering[Long]].compare(ts1head.toLong, ts2head.toLong)
case (false, true) => 1
case (true, false) => -1
case (false, false) =>
ts1head.toLowerCase(Locale.ENGLISH).compareTo(ts2head.toLowerCase(Locale.ENGLISH))
}
@ -195,7 +195,7 @@ private[librarymanagement] abstract class SemComparatorFunctions {
case Some(">=") => Gte
case Some("=") => Eq
case None => Eq
case Some(_) =>
case Some(_) =>
throw new IllegalArgumentException(s"Invalid operator: $opStr")
}
SemComparator(

View File

@ -23,7 +23,7 @@ private[sbt] object VersionSchemes {
def validateScheme(value: String): Unit =
value match {
case EarlySemVer | SemVerSpec | PackVer | Strict | Always => ()
case "semver" =>
case "semver" =>
sys.error(
s"""'semver' is ambiguous.
|Based on the Semantic Versioning 2.0.0, 0.y.z updates are all initial development and thus

View File

@ -84,7 +84,7 @@ object CrossVersionUtil {
private[sbt] def binaryScala3Version(full: String): String = full match {
case ReleaseV(maj, _, _, _) => maj
case NonReleaseV_n(maj, min, patch, _) if min.toLong > 0 || patch.toLong > 0 => maj
case BinCompatV(maj, min, patch, stageOrNull, _) =>
case BinCompatV(maj, min, patch, stageOrNull, _) =>
val stage = if (stageOrNull != null) stageOrNull else ""
binaryScala3Version(s"$maj.$min.$patch$stage")
case _ => full
@ -118,7 +118,7 @@ object CrossVersionUtil {
def binaryScalaVersion(full: String): String =
full match {
// Handle dynamic Scala 3 version patterns like "3-latest.candidate"
case DynamicScala3V(maj) => maj
case DynamicScala3V(maj) => maj
case _ if full.startsWith("2.") =>
binaryVersionWithApi(full, TransitionScalaVersion)(
scalaApiVersion
@ -135,7 +135,7 @@ object CrossVersionUtil {
def earlyScalaVersion(full: String): String =
full match {
// Handle dynamic Scala 3 version patterns like "3-latest.candidate"
case DynamicScala3V(maj) => maj
case DynamicScala3V(maj) => maj
case _ if full.startsWith("2.") =>
partialVersion(full) match
case Some((major, minor)) => s"$major.$minor"

View File

@ -106,7 +106,7 @@ private[librarymanagement] abstract class ArtifactFunctions {
val cross = CrossVersion(module.crossVersion, scalaVersion.full, scalaVersion.binary)
val withPlatform = module.crossVersion match {
case _: Disabled => artifact.name
case _ =>
case _ =>
module.platformOpt match {
case Some(p) if p.nonEmpty && p != Platform.jvm => s"${artifact.name}_$p"
case _ => artifact.name

View File

@ -122,11 +122,11 @@ private[librarymanagement] abstract class CrossVersionFunctions {
binaryVersion: String
): Option[String => String] =
cross match {
case _: Disabled => None
case b: Binary => append(b.prefix + binaryVersion + b.suffix)
case c: Constant => append(c.value)
case _: Patch => append(patchFun(fullVersion))
case f: Full => append(f.prefix + fullVersion + f.suffix)
case _: Disabled => None
case b: Binary => append(b.prefix + binaryVersion + b.suffix)
case c: Constant => append(c.value)
case _: Patch => append(patchFun(fullVersion))
case f: Full => append(f.prefix + fullVersion + f.suffix)
case c: For3Use2_13 =>
val compat =
if (binaryVersion == "3" || binaryVersion.startsWith("3.0.0")) "2.13"

View File

@ -128,7 +128,7 @@ class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface
log
) match {
case Left(unresolvedWarning) => Left(unresolvedWarning)
case Right(updateReport) =>
case Right(updateReport) =>
val allFiles =
for {
conf <- updateReport.configurations

View File

@ -26,7 +26,7 @@ trait LibraryManagementSyntax
type InclusionRule = InclExclRule
final val InclusionRule = InclExclRule
import sbt.librarymanagement.{ Configurations as C }
import sbt.librarymanagement.Configurations as C
final val Compile = C.Compile
final val Test = C.Test
final val Runtime = C.Runtime

View File

@ -87,7 +87,7 @@ private[librarymanagement] abstract class ModuleIDExtra {
*/
def cross(v: CrossVersion): ModuleID =
withCrossVersion(CrossVersion.getPrefixSuffix(this.crossVersion) match {
case ("", "") => v
case ("", "") => v
case (prefix, suffix) =>
CrossVersion.getPrefixSuffix(v) match {
case ("", "") => CrossVersion.setPrefixSuffix(v, prefix, suffix)

View File

@ -417,7 +417,7 @@ private[librarymanagement] abstract class ResolverFunctions {
// Occurs inside File constructor when property or environment variable does not exist
case _: NullPointerException => None
// Occurs when File does not exist
case _: IOException => None
case _: IOException => None
case e: SAXParseException =>
System.err.println(s"WARNING: Problem parsing ${f().getAbsolutePath}, ${e.getMessage}");
None

View File

@ -4,7 +4,7 @@
package sbt.librarymanagement
import java.io.File
import java.{ util as ju }
import java.util as ju
private[librarymanagement] abstract class ConfigurationReportExtra {
def configuration: ConfigRef

View File

@ -375,7 +375,7 @@ class CoursierDependencyResolution(
case Some(lockData) =>
LockedArtifactsRun.fetchFromLockFile(lockData, cache0, verbosityLevel, log) match {
case Right(arts) => Right(arts)
case Left(err) =>
case Left(err) =>
if (verbosityLevel >= 1) {
log.warn(s"Failed to fetch from lock file: $err, falling back to normal fetch")
}

View File

@ -1,6 +1,6 @@
package lmcoursier
import coursier.ivy.IvyXml.{ mappings as ivyXmlMappings }
import coursier.ivy.IvyXml.mappings as ivyXmlMappings
import lmcoursier.definitions.{
Classifier,
Configuration,

View File

@ -1,6 +1,6 @@
package lmcoursier
import coursier.ivy.IvyXml.{ mappings as initialIvyXmlMappings }
import coursier.ivy.IvyXml.mappings as initialIvyXmlMappings
import lmcoursier.definitions.{ Configuration, Module, ModuleName, Organization }
import sbt.librarymanagement.{ CrossVersion, InclExclRule, ModuleID }
import sbt.util.Logger
@ -57,7 +57,7 @@ object Inputs {
toAdd: List[Configuration]
): LazyList[(Configuration, Seq[Configuration])] =
toAdd match {
case Nil => LazyList.empty
case Nil => LazyList.empty
case config :: rest =>
val extends0 = map.getOrElse(config, Nil)
val missingExtends = extends0.filterNot(done)

View File

@ -118,8 +118,7 @@ object Resolvers {
case r: URLRepository if patternMatchGuard(r.patterns) =>
parseMavenCompatResolver(log, ivyProperties, authentication, r.patterns, classLoaders)
case raw: RawRepository
if raw.name == "inter-project" => // sbt.RawRepository.equals just compares names anyway
case raw: RawRepository if raw.name == "inter-project" => // sbt.RawRepository.equals just compares names anyway
None
// Pattern Match resolver-type-specific RawRepositories

View File

@ -239,7 +239,7 @@ private[internal] object SbtUpdateReport {
def lookupProject(mv: coursier.core.Resolution.ModuleVersion): Option[Project] =
res.projectCache.get(mv) match {
case Some((_, p)) => Some(p)
case _ =>
case _ =>
interProjectDependencies.find(p => mv == (p.module, p.version))
}

View File

@ -67,7 +67,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
val module = depRes.moduleDescriptor(desc)
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
case Left(x) => throw x.resolveException
case Left(x) => throw x.resolveException
case Right(x) =>
x.allModules.collect {
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
@ -87,7 +87,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
val module = depRes.moduleDescriptor(desc)
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
case Left(x) => throw x.resolveException
case Left(x) => throw x.resolveException
case Right(x) =>
x.allModules.collect {
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
@ -108,7 +108,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
val module = depRes.moduleDescriptor(desc)
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
case Left(x) => throw x.resolveException
case Left(x) => throw x.resolveException
case Right(x) =>
x.allModules.collect {
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
@ -130,7 +130,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
val module = depRes.moduleDescriptor(desc)
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
case Left(x) => throw x.resolveException
case Left(x) => throw x.resolveException
case Right(x) =>
x.allModules.collect {
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
@ -154,7 +154,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
val module = depRes.moduleDescriptor(desc)
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
case Left(x) => throw x.resolveException
case Left(x) => throw x.resolveException
case Right(x) =>
x.allModules.collect {
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>

View File

@ -53,7 +53,7 @@ final class ResolutionSpec extends AnyPropSpec with Matchers {
private def unresolvedWarningLines(module: ModuleDescriptor): Seq[String] =
lmEngine.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), log) match {
case Left(uw) => uw.lines
case Left(uw) => uw.lines
case Right(report) =>
fail(s"Expected resolution to fail, but it succeeded with report: $report")
}

View File

@ -43,7 +43,7 @@ class ComponentManager(
def notFound = invalid("Could not find required component '" + id + "'")
def createAndCache =
ifMissing match {
case IfMissing.Fail => notFound
case IfMissing.Fail => notFound
case d: IfMissing.Define =>
d()
if (d.cache) cache(id)
@ -65,7 +65,7 @@ class ComponentManager(
def file(id: String)(ifMissing: IfMissing): File =
files(id)(ifMissing).toList match {
case x :: Nil => x
case xs =>
case xs =>
invalid("Expected single file for component '" + id + "', found: " + xs.mkString(", "))
}
private def invalid(msg: String) = throw new InvalidComponent(msg)

View File

@ -24,12 +24,12 @@ import org.apache.ivy.plugins.resolver.{
SshResolver,
URLResolver
}
import org.apache.ivy.plugins.repository.url.{ URLRepository as URLRepo }
import org.apache.ivy.plugins.repository.url.URLRepository as URLRepo
import org.apache.ivy.plugins.repository.file.{ FileResource, FileRepository as FileRepo }
import java.io.{ File, IOException }
import java.util.Date
import org.apache.ivy.core.module.descriptor.{ Artifact as IArtifact }
import org.apache.ivy.core.module.descriptor.Artifact as IArtifact
import org.apache.ivy.core.module.id.ModuleRevisionId
import org.apache.ivy.core.module.descriptor.DefaultArtifact
import org.apache.ivy.core.report.DownloadReport

View File

@ -139,8 +139,7 @@ object CustomPomParser {
(Option(extraInfo.get(TransformedHashKey))
.orElse(Option(extraInfo.get(oldTransformedHashKey))) match
case Some(MyHash) => true
case _ => false
)
case _ => false)
}
private def defaultTransformImpl(
@ -315,8 +314,7 @@ object CustomPomParser {
addExtra(dd, dependencyExtra)
}
val withVersionRangeMod: Seq[DependencyDescriptor] =
if (LMSysProp.modifyVersionRange) withExtra map { stripVersionRange }
else withExtra
if (LMSysProp.modifyVersionRange) withExtra map { stripVersionRange } else withExtra
val unique = IvySbt.mergeDuplicateDefinitions(withVersionRangeMod)
unique foreach dmd.addDependency

View File

@ -674,7 +674,7 @@ private[sbt] object IvySbt {
settings.setDefaultRepositoryCacheManager(manager)
}
def toIvyConfiguration(configuration: Configuration) = {
import org.apache.ivy.core.module.descriptor.{ Configuration as IvyConfig }
import org.apache.ivy.core.module.descriptor.Configuration as IvyConfig
import IvyConfig.Visibility.*
import configuration.*
new IvyConfig(
@ -758,7 +758,7 @@ private[sbt] object IvySbt {
(m: ModuleID) =>
m.crossVersion match
case _: Disabled => m
case _ =>
case _ =>
(platform, m.platformOpt) match
case (Some(p), None) => addSuffix(m, p)
case (_, Some(p)) => addSuffix(m, p)
@ -812,8 +812,7 @@ private[sbt] object IvySbt {
}
private[sbt] def javaMap(m: Map[String, String], unqualify: Boolean = false) = {
import scala.jdk.CollectionConverters.*
val map = if (unqualify) m map { (k, v) => (k.stripPrefix("e:"), v) }
else m
val map = if (unqualify) m map { (k, v) => (k.stripPrefix("e:"), v) } else m
if (map.isEmpty) null else map.asJava
}

View File

@ -18,7 +18,7 @@ import org.apache.ivy.core.module.descriptor.{
}
import org.apache.ivy.core.resolve.ResolveOptions
import org.apache.ivy.plugins.resolver.{ BasicResolver, DependencyResolver }
import org.apache.ivy.util.filter.{ Filter as IvyFilter }
import org.apache.ivy.util.filter.Filter as IvyFilter
import sbt.io.{ IO, PathFinder }
import sbt.util.Logger
import sbt.librarymanagement.{ ModuleDescriptorConfiguration as InlineConfiguration, * }
@ -149,7 +149,7 @@ object IvyActions {
case Some(overrideRev) =>
def updateAttrs(metadata: scala.xml.MetaData): scala.xml.MetaData = {
metadata match {
case scala.xml.Null => scala.xml.Null
case scala.xml.Null => scala.xml.Null
case attr if attr.key == "rev" =>
new scala.xml.UnprefixedAttribute(
"rev",

View File

@ -4,7 +4,7 @@ package internal.librarymanagement
import java.io.File
import sbt.librarymanagement.IvyPaths
import sbt.io.syntax.*
import xsbti.{ Logger as XLogger }
import xsbti.Logger as XLogger
import sbt.util.Logger
/**

View File

@ -4,7 +4,7 @@
package sbt.internal.librarymanagement
import java.io.File
import java.{ util as ju }
import java.util as ju
import collection.mutable
import collection.immutable.ArraySeq
import org.apache.ivy.core.{ module, report, resolve }
@ -12,7 +12,7 @@ import module.descriptor.{ Artifact as IvyArtifact, License as IvyLicense }
import module.id.{ ModuleRevisionId, ModuleId as IvyModuleId }
import report.{ ArtifactDownloadReport, ConfigurationResolveReport, ResolveReport }
import resolve.{ IvyNode, IvyNodeCallers }
import IvyNodeCallers.{ Caller as IvyCaller }
import IvyNodeCallers.Caller as IvyCaller
import ivyint.SbtDefaultDependencyDescriptor
import sbt.librarymanagement.*, syntax.*

View File

@ -238,7 +238,7 @@ class MakePom(val log: Logger) {
module.getAllArtifacts match {
case Array() => "pom"
case Array(x) => x.getType
case xs =>
case xs =>
val types = xs.map(_.getType).toList.filterNot(IgnoreTypes)
types match {
case Nil => Artifact.PomType

View File

@ -28,7 +28,7 @@ object IvyCredentials {
def allDirect(sc: Seq[Credentials]): Seq[Credentials.DirectCredentials] = sc map toDirect
def toDirect(c: Credentials): Credentials.DirectCredentials = c match {
case dc: Credentials.DirectCredentials => dc
case fc: Credentials.FileCredentials =>
case fc: Credentials.FileCredentials =>
loadCredentials(fc.path) match {
case Left(err) => sys.error(err)
case Right(dc) => dc

View File

@ -24,7 +24,7 @@ import core.module.descriptor.{
import core.module.descriptor.{ OverrideDependencyDescriptorMediator, DependencyArtifactDescriptor }
import core.IvyPatternHelper
import org.apache.ivy.util.{ Message, MessageLogger }
import org.apache.ivy.plugins.latest.{ ArtifactInfo as IvyArtifactInfo }
import org.apache.ivy.plugins.latest.ArtifactInfo as IvyArtifactInfo
import org.apache.ivy.plugins.matcher.{ MapMatcher, PatternMatcher }
import annotation.tailrec
import scala.concurrent.duration.*
@ -295,10 +295,10 @@ private[sbt] class CachedResolutionResolveCache {
}
(conflictCache get ((cf0, cf1))) match {
case Some((surviving, evicted, mgr)) => reconstructReports(surviving, evicted, mgr)
case _ =>
case _ =>
(conflictCache get ((cf1, cf0))) match {
case Some((surviving, evicted, mgr)) => reconstructReports(surviving, evicted, mgr)
case _ =>
case _ =>
val (surviving, evicted, mgr) = f
if (conflictCache.size > maxConflictCacheSize) {
conflictCache.remove(conflictCache.head._1)
@ -629,7 +629,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
allModules0.to(mutable.Map)
@tailrec def breakLoops(loops: List[List[(String, String)]]): Unit =
loops match {
case Nil => ()
case Nil => ()
case loop :: rest =>
loop match {
case Nil =>
@ -717,7 +717,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
allModules: Map[(String, String), Vector[OrganizationArtifactReport]]
): List[OrganizationArtifactReport] =
cs match {
case Nil => Nil
case Nil => Nil
case (organization, name) :: rest =>
val reports = allModules((organization, name))
reports match {
@ -820,7 +820,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
val reports: Seq[((String, String), Vector[OrganizationArtifactReport])] =
reports0.toSeq flatMap {
case (k, _) if !(pairs.contains[(String, String)](k)) => Seq()
case ((organization, name), oars0) =>
case ((organization, name), oars0) =>
val oars = oars0 map { oar =>
val (affected, unaffected) = oar.modules partition { mr =>
val x = !mr.evicted && mr.problem.isEmpty && isTransitivelyEvicted(mr)
@ -940,7 +940,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
}
case _ =>
getSettings.getConflictManager(IvyModuleId.newInstance(organization, name)) match {
case ncm: NoConflictManager => (conflicts, Vector(), ncm.toString)
case ncm: NoConflictManager => (conflicts, Vector(), ncm.toString)
case _: StrictConflictManager =>
sys.error(
(s"conflict was found in $rootModuleConf:$organization:$name " + (conflicts map {

View File

@ -99,7 +99,7 @@ object ErrorMessageAuthenticator {
def doInstallIfIvy(original: Option[Authenticator]): Unit =
original match {
case Some(_: ErrorMessageAuthenticator) => // Ignore, we're already installed
case Some(ivy: IvyAuthenticator) =>
case Some(ivy: IvyAuthenticator) =>
installIntoIvy(ivy); ()
case original => doInstall(original)
}

View File

@ -11,7 +11,7 @@ import org.apache.ivy.core.{ IvyContext, LogOptions }
import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor
import org.apache.ivy.core.module.descriptor.DependencyDescriptor
import org.apache.ivy.core.module.descriptor.ModuleDescriptor
import org.apache.ivy.core.module.descriptor.{ Artifact as IArtifact }
import org.apache.ivy.core.module.descriptor.Artifact as IArtifact
import org.apache.ivy.core.resolve.{ ResolveData, ResolvedModuleRevision }
import org.apache.ivy.plugins.latest.LatestStrategy
import org.apache.ivy.plugins.repository.file.{ FileResource, FileRepository as IFileRepository }
@ -199,7 +199,7 @@ private[sbt] case class SbtChainResolver(
val chosenPublicationDate = Option(publicationDate).orElse(Option(descriptorDate))
chosenPublicationDate match {
case Some(date) => date.getTime
case None =>
case None =>
val id = rmr.getId
val resolvedResource = (resolver.findIvyFileRef(descriptor, data), rmr.getDescriptor)
resolvedResource match {

View File

@ -38,7 +38,7 @@ object PomExtraDependencyAttributes {
): Map[ModuleRevisionId, Map[String, String]] = {
import scala.jdk.CollectionConverters.*
(props.asScala get ExtraAttributesKey) match {
case None => Map.empty
case None => Map.empty
case Some(str) =>
def processDep(m: ModuleRevisionId) = (simplify(m), filterCustomExtra(m, include = true))
(for {
@ -68,7 +68,7 @@ object PomExtraDependencyAttributes {
*/
def getDependencyExtra(m: Map[String, String]): Map[ModuleRevisionId, Map[String, String]] =
(m get ExtraAttributesKey) match {
case None => Map.empty
case None => Map.empty
case Some(str) =>
def processDep(m: ModuleRevisionId) = (simplify(m), filterCustomExtra(m, include = true))
readDependencyExtra(str).map(processDep).toMap

View File

@ -1,7 +1,7 @@
package sbt.internal.librarymanagement
import java.io.File
import org.apache.ivy.core.module.descriptor.{ Artifact as IvyArtifact }
import org.apache.ivy.core.module.descriptor.Artifact as IvyArtifact
import org.apache.ivy.core.module.id.ModuleRevisionId
import org.apache.ivy.core.resolve.ResolveOptions
import sbt.internal.librarymanagement.ivy.InlineIvyConfiguration

View File

@ -32,7 +32,7 @@ object SftpRepoSpec extends BaseIvySpecification {
// log.setLevel(Level.Debug)
lmEngine().retrieve(module(org(repo)), scalaModuleInfo = None, currentTarget, log) match {
case Right(v) => log.debug(v.toString())
case Left(e) =>
case Left(e) =>
log.log(Level.Error, e.failedPaths.toString())
throw e.resolveException
}

View File

@ -165,7 +165,7 @@ object Pkg:
for option <- conf.options do
option match
case PackageOption.JarManifest(mergeManifest) => mergeManifests(manifest, mergeManifest)
case PackageOption.MainClass(mainClassName) =>
case PackageOption.MainClass(mainClassName) =>
main.put(Attributes.Name.MAIN_CLASS, mainClassName)
case PackageOption.ManifestAttributes(attributes*) => main.asScala ++= attributes
case PackageOption.FixedTimestamp(value) => ()

View File

@ -200,8 +200,8 @@ object Sync {
try {
readUncaught[F](store)(using infoFormat)
} catch {
case _: IOException => (Relation.empty[File, File], Map.empty[File, F])
case _: ZipException => (Relation.empty[File, File], Map.empty[File, F])
case _: IOException => (Relation.empty[File, File], Map.empty[File, F])
case _: ZipException => (Relation.empty[File, File], Map.empty[File, F])
case e: TranslatedException =>
e.getCause match {
case _: ZipException => (Relation.empty[File, File], Map.empty[File, F])

View File

@ -260,7 +260,7 @@ object Tests {
for (option <- config.options) {
option match {
case Filter(include) => testFilters += include; ()
case Filter(include) => testFilters += include; ()
case Filters(includes) =>
if (orderedFilters.nonEmpty) sys.error("Cannot define multiple ordered test filters.")
else orderedFilters = includes
@ -500,7 +500,7 @@ object Tests {
} else {
def sequence(tasks: List[Task[Output]], acc: List[Output]): Task[List[Output]] =
tasks match {
case Nil => task(acc.reverse)
case Nil => task(acc.reverse)
case hd :: tl =>
hd flatMap { out =>
sequence(tl, out :: acc)

View File

@ -61,8 +61,7 @@ object WorkerExchange:
) ++
(socketOpt match
case Some(s) => Seq("--tcp", s.getLocalPort().toString())
case _ => Nil
)
case _ => Nil)
val onStdoutLine: String => Unit = connectionType match
case WorkerConnection.Stdio => notifyListeners
case _ => (line) => scala.Console.out.println(line)

View File

@ -114,7 +114,7 @@ class SonaClient(reqTransform: Request => Request, uploadRequestTimeout: FiniteD
waitForDeploy(deploymentId, deploymentName, publishingType, attempt + 1, log)
case DeploymentState.PUBLISHED if publishingType == PublishingType.Automatic => ()
case DeploymentState.VALIDATED if publishingType == PublishingType.UserManaged => ()
case DeploymentState.VALIDATED =>
case DeploymentState.VALIDATED =>
Thread.sleep(sleepSec * 1000L)
waitForDeploy(deploymentId, deploymentName, publishingType, attempt + 1, log)
case _ =>

View File

@ -10,7 +10,7 @@ package sbt
import java.io.File
import java.nio.file.Path
import sbt.internal.inc.classpath.{ ClassLoaderCache as IncClassLoaderCache }
import sbt.internal.inc.classpath.ClassLoaderCache as IncClassLoaderCache
import sbt.internal.classpath.ClassLoaderCache
import sbt.internal.server.ServerHandler
import sbt.internal.util.AttributeKey

View File

@ -12,7 +12,7 @@ import sbt.internal.inc.ReflectUtilities
import sbt.internal.util.complete.{ DefaultParsers, EditDistance, Parser }
import sbt.internal.util.Types.const
import sbt.internal.util.{ AttributeKey, AttributeMap, Util }
import sbt.internal.util.Util.{ nilSeq }
import sbt.internal.util.Util.nilSeq
/**
* An operation that can be executed from the sbt console.
@ -185,7 +185,7 @@ object Command {
def process(command: String, state: State, onParseError: String => Unit): State = {
(if (command.contains(";")) parse(command, state.combinedParser)
else parse(command, state.nonMultiParser)) match {
case Right(s) => s() // apply command. command side effects happen here
case Right(s) => s() // apply command. command side effects happen here
case Left(errMsg) =>
state.log.error(errMsg)
onParseError(errMsg)
@ -279,7 +279,7 @@ object Help {
def message(h: Help, arg: Option[String]): String =
arg match {
case Some(x) => detail(x, h.detail)
case None =>
case None =>
val brief = aligned(" ", " ", h.brief).mkString("\n", "\n", "\n")
val more = h.more
if (more.isEmpty)

View File

@ -60,7 +60,7 @@ object CommandUtil {
def detail(selected: String, detailMap: Map[String, String]): String =
detailMap.get(selected) match {
case Some(exactDetail) => exactDetail
case None =>
case None =>
try {
val details = searchHelp(selected, detailMap)
if (details.isEmpty)

View File

@ -20,7 +20,7 @@ private[sbt] object ExceptionCategory {
@tailrec def apply(t: Throwable): ExceptionCategory = t match {
case _: AlreadyHandledException | _: UnprintableException => AlreadyHandled
case ite: InvocationTargetException =>
case ite: InvocationTargetException =>
val cause = ite.getCause
if (cause == null || cause == ite) new Full(ite) else apply(cause)
case _: MessageOnlyException => new MessageOnly(t.toString)

View File

@ -11,7 +11,7 @@ package sbt
import java.util.regex.Pattern
import scala.Console.{ BOLD, RESET }
import sbt.internal.util.{ Terminal as UTerminal }
import sbt.internal.util.Terminal as UTerminal
object Highlight {

View File

@ -13,7 +13,7 @@ import java.net.{ URL, URLClassLoader }
import java.util.concurrent.Callable
import sbt.internal.classpath.ClassLoaderCache
import sbt.internal.inc.classpath.{ ClassLoaderCache as IncClassLoaderCache }
import sbt.internal.inc.classpath.ClassLoaderCache as IncClassLoaderCache
import sbt.internal.util.complete.{ HistoryCommands, Parser }
import sbt.internal.util.*
import sbt.util.Logger
@ -270,7 +270,7 @@ object State {
f(cmd, s1)
}
s.remainingCommands match {
case Nil => exit(true)
case Nil => exit(true)
case x :: xs =>
(x.execId, x.source) match {
/*
@ -394,14 +394,14 @@ object State {
s.get(BasicKeys.extendedClassLoaderCache).foreach(_.close())
val cache = newClassLoaderCache
s.configuration.provider.scalaProvider.loader match {
case null => // This can happen in scripted
case null => // This can happen in scripted
case fullScalaLoader =>
val jars = s.configuration.provider.scalaProvider.jars
val (library, rest) = jars.partition(_.getName == "scala-library.jar")
library.toList match {
case l @ lj :: Nil =>
fullScalaLoader.getParent match {
case null => // This can happen for old launchers.
case null => // This can happen for old launchers.
case libraryLoader =>
cache.cachedCustomClassloader(l, () => new UncloseableURLLoader(l, libraryLoader))
fullScalaLoader match {

View File

@ -12,7 +12,7 @@ import java.io.File
import java.nio.file.FileSystems
import sbt.internal.LabeledFunctions.*
import sbt.internal.io.{ Source }
import sbt.internal.io.Source
import sbt.io.*
import scala.concurrent.duration.*
@ -64,7 +64,7 @@ object Watched:
FileSystems.getDefault.newWatchService()
case Some("closewatch") => closeWatch
case _ if Properties.isMac => closeWatch
case _ =>
case _ =>
FileSystems.getDefault.newWatchService()
}
}

View File

@ -91,7 +91,7 @@ abstract class CommandChannel {
case "debug" => setLevel(Level.Debug, "debug")
case "info" => setLevel(Level.Info, "info")
case "warn" => setLevel(Level.Warn, "warn")
case cmd =>
case cmd =>
if (cmd.nonEmpty) appendExec(cmd, None)
else false
}

View File

@ -200,7 +200,7 @@ private[sbt] class ClassLoaderCache(
private def get(key: Key, f: () => ClassLoader): ClassLoader = {
scalaProviderKey match {
case Some(k) if k == key => k.toClassLoader
case _ =>
case _ =>
def addLoader(): ClassLoader = {
val ref = mkReference(key, f())
val loader = ref.get
@ -211,7 +211,7 @@ private[sbt] class ClassLoaderCache(
lock.synchronized {
delegate.get(key) match {
case null => addLoader()
case ref =>
case ref =>
ref.get match {
case null => addLoader()
case l => l
@ -223,7 +223,7 @@ private[sbt] class ClassLoaderCache(
private def clear(lock: Object): Unit = {
delegate.asScala.foreach {
case (_, ClassLoaderReference(_, classLoader)) => close(classLoader)
case (_, r: Reference[ClassLoader]) =>
case (_, r: Reference[ClassLoader]) =>
r.get match {
case null =>
case classLoader => close(classLoader)

View File

@ -203,7 +203,7 @@ class NetworkClient(
else {
startInputThread()
stdinBytes.poll(5, TimeUnit.SECONDS) match {
case null => System.exit(0)
case null => System.exit(0)
case i if i == 9 =>
errorStream.println("\nStarting server...")
waitForServer(portfile, !promptCompleteUsers, startServer = true)
@ -299,7 +299,7 @@ class NetworkClient(
Option(inputThread.get).foreach(_.close())
Option(interactiveThread.get).foreach(_.interrupt)
}
case `readSystemIn` => startInputThread()
case `readSystemIn` => startInputThread()
case `cancelReadSystemIn` =>
inputThread.get match {
case null =>
@ -458,14 +458,14 @@ class NetworkClient(
try {
s.getInputStream.read match {
case -1 | 0 => readThreadAlive.set(false)
case 2 => // STX: start of text
case 2 => // STX: start of text
gotInputBack = true
case 5 => // ENQ: enquiry
term.enterRawMode(); startInputThread()
case 3 if gotInputBack => // ETX: end of text
readThreadAlive.set(false)
case i if gotInputBack => stdinBytes.offer(i)
case 10 => // CR
case 10 => // CR
buffer.append(10.toByte)
printStream.write(buffer.toArray[Byte])
buffer.clear()
@ -609,7 +609,7 @@ class NetworkClient(
}
def completeExec(execId: String, exitCode: Int) = {
pendingResults.remove(execId) match {
case null => ()
case null => ()
case (q, startTime, name) =>
val now = System.currentTimeMillis
val message = NetworkClient.elapsedString(startTime, now)
@ -634,7 +634,7 @@ class NetworkClient(
private val onCompletionResponse: PartialFunction[JsonRpcResponseMessage, Unit] = {
case msg if pendingCompletions.containsKey(msg.id) =>
pendingCompletions.remove(msg.id) match {
case null => ()
case null => ()
case completions =>
completions(msg.result match {
case Some(o: JObject) =>
@ -729,7 +729,7 @@ class NetworkClient(
}
case (`Shutdown`, Some(_)) => Vector.empty
case (msg, _) if msg.startsWith("build/") => Vector.empty
case ("sbt/exec", Some(json)) =>
case ("sbt/exec", Some(json)) =>
import sbt.protocol.codec.JsonProtocol.given
Converter.fromJson[ExecStatusEvent](json) match {
case Success(event) if event.status == "Queued" =>
@ -795,7 +795,7 @@ class NetworkClient(
private def clientSideRun(runInfo: RunInfo): Try[Unit] = {
runInfo.windowTitle.foreach(setWindowTitle)
def nativeRun(info: NativeRunInfo): Try[Unit] = {
import java.lang.{ ProcessBuilder as JProcessBuilder }
import java.lang.ProcessBuilder as JProcessBuilder
val option = ForkOptions(
javaHome = None,
outputStrategy = None, // TODO: Handle buffered output etc
@ -982,7 +982,7 @@ class NetworkClient(
val (rawPrefix, prefix, rawSuffix, suffix) = if (quoteCount > 0) {
query.lastIndexOf('"') match {
case -1 => (query, query, None, None) // shouldn't happen
case i =>
case i =>
val rawPrefix = query.substring(0, i)
val prefix = rawPrefix.replace("\"", "").replace("\\;", ";")
val rawSuffix = query.substring(i).replace("\\;", ";")
@ -1079,7 +1079,7 @@ class NetworkClient(
}
} catch {
case e: SocketException if command.toString.contains("exit") => running.set(false)
case e: IOException =>
case e: IOException =>
errorStream.println(s"Caught exception writing command to server: $e")
running.set(false)
}
@ -1117,7 +1117,7 @@ class NetworkClient(
if (mainThread != null && mainThread != Thread.currentThread) mainThread.interrupt
connectionHolder.get match {
case null =>
case c =>
case c =>
try sendExecCommand("exit")
finally c.shutdown()
}
@ -1317,7 +1317,7 @@ object NetworkClient {
case "--sbt-launch-jar" if i + 1 < sanitized.length =>
i += 1
launchJar = Option(sanitized(i).replace("%20", " "))
case "-bsp" | "--bsp" | "bsp" => bsp = true
case "-bsp" | "--bsp" | "bsp" => bsp = true
case "-no-server" | "--no-server" =>
System.setProperty("sbt.server.autostart", "false")
case a if a.startsWith("--autostart=") =>
@ -1330,7 +1330,7 @@ object NetworkClient {
case a if launcherEqPrefixes.exists(p => a.startsWith(p)) => ()
case a if a.startsWith("-J") => ()
case a if !a.startsWith("-") => commandArgs += a
case a @ SysProp(key, value) =>
case a @ SysProp(key, value) =>
System.setProperty(key, value)
sbtArguments += a
case a => sbtArguments += a

View File

@ -90,7 +90,7 @@ private[sbt] object Server {
addServerError(new ServerSocket(port, 50, InetAddress.getByName(host)))
}
} match {
case Failure(e) => p.failure(e)
case Failure(e) => p.failure(e)
case Success(serverSocket) =>
serverSocket.setSoTimeout(5000)
serverSocketHolder.getAndSet(serverSocket) match {
@ -132,7 +132,7 @@ private[sbt] object Server {
def tryClient(f: => Socket): Unit = {
if (portfile.exists) {
Try { f } match {
case Failure(_) => ()
case Failure(_) => ()
case Success(socket) =>
socket.close()
throw new AlreadyRunningException()

View File

@ -14,7 +14,7 @@ import sjsonnew.JsonFormat
import sbt.internal.protocol.*
import sbt.util.Logger
import sbt.protocol.{ CompletionParams as CP, SettingQuery as Q }
import sbt.internal.langserver.{ CancelRequestParams as CRP }
import sbt.internal.langserver.CancelRequestParams as CRP
/**
* ServerHandler allows plugins to extend sbt server.

View File

@ -19,7 +19,7 @@ import sbt.internal.CommandChannel
import sbt.internal.util.ConsoleAppender.{ ClearPromptLine, ClearScreenAfterCursor, DeleteLine }
import sbt.internal.util.Terminal.hasConsole
import sbt.internal.util.*
import sbt.internal.util.complete.{ Parser }
import sbt.internal.util.complete.Parser
import scala.annotation.tailrec
@ -109,7 +109,7 @@ private[sbt] object UITask {
case Some(NoShellPrompt) | None =>
s.get(colorShellPrompt) match {
case Some(pf) => pf(terminal.isColorEnabled, s)
case None =>
case None =>
def color(s: String): String = if (terminal.isColorEnabled) s"$s" else ""
s"${color(DeleteLine)}> ${color(ClearScreenAfterCursor)}"
}

View File

@ -45,7 +45,7 @@ private[sbt] class UserThread(val channel: CommandChannel) extends AutoCloseable
}
}
uiThread.getAndSet((task, thread)) match {
case null => thread.start()
case null => thread.start()
case (prevTask, prevThread) if prevTask.getClass != task.getClass =>
prevTask.close()
prevThread.joinFor(1.second)
@ -56,7 +56,7 @@ private[sbt] class UserThread(val channel: CommandChannel) extends AutoCloseable
uiThread.get match {
case null => submit()
case (prevTask, _) if prevTask.getClass == task.getClass =>
case (t, thread) =>
case (t, thread) =>
stopThreadImpl()
submit()
}
@ -66,7 +66,7 @@ private[sbt] class UserThread(val channel: CommandChannel) extends AutoCloseable
private[sbt] def stopThreadImpl(): Unit = uiThread.synchronized {
uiThread.getAndSet(null) match {
case null =>
case null =>
case (t, thread) =>
t.close()
thread.joinFor(1.second)

View File

@ -63,7 +63,7 @@ private[sbt] object ReadJsonFromInputStream {
consecutiveLineEndings += 1
case `carriageReturn` => onCarriageReturn = true
case -1 => running.set(false)
case c =>
case c =>
if (c == newline) getLine()
else {
if (index >= headerBuffer.length) expandHeaderBuffer()
@ -94,7 +94,7 @@ private[sbt] object ReadJsonFromInputStream {
running.set(false)
throw new ClosedChannelException
case `carriageReturn` => onCarriageReturn = true
case c =>
case c =>
onCarriageReturn = false
if (index >= headerBuffer.length) expandHeaderBuffer()
headerBuffer(index) = c.toByte

View File

@ -172,7 +172,7 @@ object Def extends BuildSyntax with Init with InitializeImplicits:
project: Reference,
trailingSlash: Boolean
): String = {
import Reference.{ display as displayRef }
import Reference.display as displayRef
@tailrec def loop(ref: Reference): String = ref match {
case ProjectRef(b, p) => if (b == current.build) loop(LocalProject(p)) else displayRef(ref)
case BuildRef(b) => if (b == current.build) loop(ThisBuild) else displayRef(ref)
@ -256,10 +256,9 @@ object Def extends BuildSyntax with Init with InitializeImplicits:
def toIParser[A1](p: Initialize[InputTask[A1]]): Initialize[State => Parser[Task[A1]]] =
p(_.parser)
import std.SettingMacro.{
// settingDynMacroImpl,
settingMacroImpl
}
import std.SettingMacro.
// settingDynMacroImpl,
settingMacroImpl
import std.*
import language.experimental.macros
@ -442,7 +441,7 @@ object Def extends BuildSyntax with Init with InitializeImplicits:
Def.stateKey.zipWith(in)((sTask, it) =>
sTask map { s =>
Parser.parse(arg, it.parser(s)) match
case Right(a) => Def.value[Task[A1]](a)
case Right(a) => Def.value[Task[A1]](a)
case Left(msg) =>
val indented = msg.linesIterator.map(" " + _).mkString("\n")
sys.error(s"Invalid programmatic input:\n$indented")

View File

@ -26,7 +26,7 @@ final class InputTask[A1] private (val parser: State => Parser[Task[A1]]):
def fullInput(in: String): InputTask[A1] =
InputTask[A1](s =>
Parser.parse(in, parser(s)) match {
case Right(v) => Parser.success(v)
case Right(v) => Parser.success(v)
case Left(msg) =>
val indented = msg.linesIterator.map(" " + _).mkString("\n")
Parser.failure(s"Invalid programmatic input:\n$indented")

View File

@ -215,7 +215,7 @@ object Plugins extends PluginsFunctions {
clauses,
(flattenConvert(requestedPlugins) ++ convertAll(alwaysEnabled)).toSet
) match {
case Left(problem) => throw AutoPluginException(problem)
case Left(problem) => throw AutoPluginException(problem)
case Right(results) =>
log.debug(s" :: deduced result: ${results}")
val selectedAtoms: List[Atom] = results.ordered
@ -346,7 +346,7 @@ ${listConflicts(conflicting)}""")
private[sbt] def overrideWith(current: Plugins, update: Plugins): Plugins = {
val opposite: Set[Basic] = flatten(update).map {
case Exclude(p) => p: Basic
case Exclude(p) => p: Basic
case p: AutoPlugin =>
Exclude(p): Basic
}.toSet
@ -356,7 +356,7 @@ ${listConflicts(conflicting)}""")
private[sbt] def remove(a: Plugins, del: Set[Basic]): Plugins = a match {
case b: Basic => if (del(b)) Empty else b
case Empty => Empty
case And(ns) =>
case And(ns) =>
val removed = ns.filterNot(del)
if (removed.isEmpty) Empty else And(removed)
}

View File

@ -8,7 +8,7 @@
package sbt
import scala.concurrent.{ Promise as XPromise }
import scala.concurrent.Promise as XPromise
final class PromiseWrap[A]:
private[sbt] val underlying: XPromise[A] = XPromise()

View File

@ -370,13 +370,13 @@ object Scope:
}
scope.project match {
case Zero | This => globalProjectDelegates(scope)
case Zero | This => globalProjectDelegates(scope)
case Select(proj) =>
val resolvedProj = resolve(proj)
val projAxes: Seq[ScopeAxis[ResolvedReference]] =
resolvedProj match {
case pr: ProjectRef => index.project(pr)
case br: BuildRef =>
case br: BuildRef =>
List(Select(br): ScopeAxis[ResolvedReference], Zero: ScopeAxis[ResolvedReference])
}
expandDelegateScopes(resolvedProj)(projAxes)

View File

@ -140,7 +140,7 @@ object InputTaskMacro:
.transform { (replacement: Term) =>
inputBuf.append((name, TypeRepr.of[a](using tpe), qual, replacement))
oldTree
}
}
def genCreateFree(body: Term) =
val init = expandTask[A1](true, body)
'{
@ -177,7 +177,7 @@ object InputTaskMacro:
}
val body = convert1.transformWrappers(expr.asTerm, record, Symbol.spliceOwner)
inputBuf.toList match
case Nil => genCreateFree(body)
case Nil => genCreateFree(body)
case (_, tpe, _, paramTree) :: Nil =>
tpe.asType match
case '[a] => genCreateDyn[a](paramTree, body)

View File

@ -28,7 +28,7 @@ class InitializeConvert[C <: Quotes & scala.Singleton](override val qctx: C, val
override def convert[A: Type](nme: String, in: Term): Converted =
nme match
case InputWrapper.WrapInitName => Converted.success(in)
case InputWrapper.WrapInitName => Converted.success(in)
case InputWrapper.WrapTaskName | InputWrapper.WrapInitTaskName =>
Converted.Failure(in.pos, "A setting cannot depend on a task")
case InputWrapper.WrapPreviousName =>

View File

@ -65,7 +65,7 @@ object TaskMacro:
val cached = ContextUtil.isTaskCacheByDefault && !isUncacheApplied && cl.nonEmpty
t match
case '{ if ($cond) then $thenp else $elsep } => taskIfImpl[A1](t, cached)
case _ =>
case _ =>
val convert1 = new FullConvert(qctx, 0)
if cached then
convert1.contMapN[A1, F, Id](
@ -84,7 +84,7 @@ object TaskMacro:
): Expr[Initialize[Task[A1]]] =
t match
case '{ if ($cond) then $thenp else $elsep } => taskIfImpl[A1](t, cached)
case _ =>
case _ =>
val convert1 = new FullConvert(qctx, 0)
if cached then
convert1.contMapN[A1, F, Id](

View File

@ -89,8 +89,7 @@ object Assign {
val dyn: Def.Initialize[Task[Int]] = Def.taskDyn {
val a = ak.value
if a < 1 then Def.task { 1 }
else Def.task { 0 }
if a < 1 then Def.task { 1 } else Def.task { 0 }
}
import DefaultParsers.*

View File

@ -51,7 +51,7 @@ object Cross {
versionArg.split("=", 2) match {
case Array(home) if new File(home).exists() =>
ScalaHomeVersion(new File(home), None, force)
case Array(v) => NamedScalaVersion(v, force)
case Array(v) => NamedScalaVersion(v, force)
case Array(v, home) =>
ScalaHomeVersion(new File(home), Some(v).filterNot(_.isEmpty), force)
}
@ -211,8 +211,8 @@ object Cross {
.sortBy(_._1)
commandsByVersion.flatMap { (v, commands) =>
commands match {
case Seq(c) => Seq(s"$SwitchCommand $verbose $v $c")
case Seq() => Nil // should be unreachable
case Seq(c) => Seq(s"$SwitchCommand $verbose $v $c")
case Seq() => Nil // should be unreachable
case multi if fullArgs.isEmpty =>
Seq(s"$SwitchCommand $verbose $v all ${multi.mkString(" ")}")
case multi => Seq(s"$SwitchCommand $verbose $v") ++ multi
@ -348,7 +348,7 @@ object Cross {
scalaVersions.filter(v => selector.matches(VersionNumber(v))) match {
case Nil => (project, None, scalaVersions)
case Seq(version) => (project, Some(version), scalaVersions)
case multiple =>
case multiple =>
sys.error(
s"Multiple crossScalaVersions matched query '$version': ${multiple.mkString(", ")}"
)

View File

@ -13,7 +13,7 @@ import java.nio.file.{ Files, Path as NioPath }
import java.util.{ Optional, UUID }
import java.util.concurrent.TimeUnit
import lmcoursier.CoursierDependencyResolution
import lmcoursier.definitions.{ Configuration as CConfiguration }
import lmcoursier.definitions.Configuration as CConfiguration
import org.apache.ivy.core.module.descriptor.ModuleDescriptor
import org.apache.ivy.core.module.id.ModuleRevisionId
import org.scalasbt.ipcsocket.Win32SecurityLevel
@ -1963,7 +1963,7 @@ object Defaults extends BuildCommon {
try
ITerminal.get.inputStream.read match {
case -1 | -2 => None
case b =>
case b =>
val res = b.toChar.toString
println(res)
Some(res)
@ -3139,7 +3139,7 @@ object Classpaths {
) match {
case (Some(delegated), Seq(), _) => delegated
case (_, rs, Some(ars)) => ars ++ rs
case (_, rs, _) =>
case (_, rs, _) =>
Resolver.combineDefaultResolvers(rs.toVector, mavenCentral = true)
}
),
@ -3170,7 +3170,7 @@ object Classpaths {
else Vector.empty
bootResolvers.value match {
case Some(repos) if overrideBuildResolvers.value => proj +: repos
case _ =>
case _ =>
val base = if (sbtPlugin.value) sbtResolvers.value ++ rs ++ pr else rs ++ pr
(proj +: base).distinct
}
@ -3935,7 +3935,7 @@ object Classpaths {
val currentBuildClock = DependencyLockFile.computeBuildClock(deps, resolverNames)
DependencyLockManager.validate(lockFile, currentBuildClock, log) match
case Some(_) => ()
case None =>
case None =>
throw new MessageOnlyException(
s"Dependency lock file is stale: ${lockFile.getAbsolutePath}. Run 'dependencyLock' to update it."
)
@ -4055,7 +4055,7 @@ object Classpaths {
val isRoot = er.contains(rs)
val shouldForce = isRoot || {
fup match
case None => false
case None => false
case Some(period) =>
val fullUpdateOutput = cacheDirectory / "output"
val now = System.currentTimeMillis
@ -4711,7 +4711,7 @@ object Classpaths {
case Predefined.ScalaToolsSnapshots => Resolver.ScalaToolsSnapshots
case Predefined.SonatypeOSSReleases => Resolver.sonatypeRepo("releases")
case Predefined.SonatypeOSSSnapshots => Resolver.sonatypeRepo("snapshots")
case unknown =>
case unknown =>
sys.error(
"Unknown predefined resolver '" + unknown + "'. This resolver may only be supported in newer sbt versions."
)

View File

@ -8,7 +8,7 @@
package sbt
import java.nio.file.{ Path as NioPath }
import java.nio.file.Path as NioPath
import java.io.File
import java.net.URI
import lmcoursier.definitions.{ CacheLogger, ModuleMatchers, Reconciliation }

View File

@ -772,7 +772,7 @@ object BuiltinCommands {
def last: Command = Command(LastCommand, lastBrief, lastDetailed)(aggregatedKeyValueParser) {
case (s, Some(sks)) => lastImpl(s, sks, None)
case (s, None) =>
case (s, None) =>
for (logFile <- lastLogFile(s)) yield Output.last(logFile, printLast)
keepLastLog(s)
}
@ -1258,7 +1258,9 @@ object BuiltinCommands {
if (!suppress) {
Banner(version).foreach(banner => state.log.info(banner))
}
} catch { case _: IOException => /* Don't let errors in this command prevent startup */ }
} catch {
case _: IOException => /* Don't let errors in this command prevent startup */
}
state.put(bannerHasBeenShown, true)
} else state
}

View File

@ -223,7 +223,7 @@ private[sbt] object MainLoop:
def getOrSet[T](state: State, key: AttributeKey[T], value: Extracted => T): State = {
state.get(key) match {
case Some(_) => state
case _ =>
case _ =>
if (state.get(Keys.stateBuildStructure).isDefined) {
val extracted = Project.extract(state)
state.put(key, value(extracted))
@ -364,12 +364,12 @@ private[sbt] object MainLoop:
case State.Continue => ExitCode.Success
case State.ClearGlobalLog => ExitCode.Success
case State.KeepLastLog => ExitCode.Success
case ret: State.Return =>
case ret: State.Return =>
ret.result match
case exit: xsbti.Exit => ExitCode(exit.code().toLong)
case _: xsbti.Continue => ExitCode.Success
case _: xsbti.Reboot => ExitCode.Success
case x =>
case x =>
val clazz = if (x eq null) "" else " (class: " + x.getClass + ")"
state.log.debug(s"Unknown main result: $x$clazz")
ExitCode.Unknown

View File

@ -8,7 +8,7 @@
package sbt
import java.io.File
import java.nio.file.{ Path as NioPath }
import java.nio.file.Path as NioPath
import java.net.URI
// import Project._
import Keys.{
@ -638,7 +638,8 @@ trait ProjectExtra extends Scoped.Syntax:
case LoadAction.Current =>
val base = s.configuration.baseDirectory
projectReturn(s) match
case Nil => (setProjectReturn(s, base :: Nil), base); case x :: _ => (s, x)
case Nil => (setProjectReturn(s, base :: Nil), base);
case x :: _ => (s, x)
case LoadAction.Plugins =>
val (newBase, oldStack) =

View File

@ -80,7 +80,7 @@ object SessionVar {
): (State, Option[T]) =
get(key, state) match {
case s: Some[T] => (state, s)
case None =>
case None =>
read(key, state)(using f) match {
case s @ Some(t) =>
val newState =

View File

@ -58,7 +58,7 @@ private[sbt] object TemplateCommandUtil {
terminate
} else {
fortifyArgs(templateDescriptions.toList) match {
case Nil => terminate
case Nil => terminate
case arg :: Nil if arg.endsWith(".local") =>
extracted.runInputTask(Keys.templateRunLocal, " " + arg, s0)
reload
@ -87,7 +87,7 @@ private[sbt] object TemplateCommandUtil {
hit
} match {
case Some(_) => // do nothing
case None =>
case None =>
val error = "Template not found for: " + arguments.mkString(" ")
throw new IllegalArgumentException(error)
}
@ -224,8 +224,8 @@ private[sbt] object TemplateCommandUtil {
ans
}
ans0 match {
case '\r' | '\n' => printThenReturn(focusValue)
case 'q' | 'Q' | -1 => printThenReturn("")
case '\r' | '\n' => printThenReturn(focusValue)
case 'q' | 'Q' | -1 => printThenReturn("")
case 'j' | 'J' | ITerminal.VK_DOWN =>
clearMenu(mappingList)
askTemplate(mappingList, math.min(focus + 1, mappingList.size - 1))
@ -281,7 +281,7 @@ private[sbt] object TemplateCommandUtil {
case ScalaToolkitSlug :: Nil => scalaToolkitTemplate()
case TypelevelToolkitSlug :: Nil => typelevelToolkitTemplate()
case SbtCrossPlatformSlug :: Nil => sbtCrossPlatformTemplate()
case _ =>
case _ =>
val error = "Local template not found for: " + arguments.mkString(" ")
throw new IllegalArgumentException(error)
}

View File

@ -229,7 +229,7 @@ object CoursierInputsTasks {
val creds = sbt.Keys.allCredentials.value
.flatMap {
case dc: IvyCredentials.DirectCredentials => List(dc)
case fc: IvyCredentials.FileCredentials =>
case fc: IvyCredentials.FileCredentials =>
sbt.internal.librarymanagement.ivy.IvyCredentials.loadCredentials(fc.path) match {
case Left(err) =>
log.warn(s"$err, ignoring it")

View File

@ -24,7 +24,7 @@ import lmcoursier.*
import lmcoursier.syntax.*
import lmcoursier.credentials.Credentials
import Keys.*
import sbt.librarymanagement.{ Credentials as IvyCredentials }
import sbt.librarymanagement.Credentials as IvyCredentials
import sbt.internal.util.Util
import sbt.librarymanagement.*
import sbt.util.Logger
@ -60,7 +60,7 @@ object LMCoursier {
.orElse(sys.env.get("COURSIER_CACHE").map(absoluteFile))
.orElse(sys.props.get("coursier.cache").map(absoluteFile)) match {
case Some(dir) => dir
case _ =>
case _ =>
if Util.isWindows then windowsCacheDirectory
else CoursierDependencyResolution.defaultCacheLocation
}
@ -281,7 +281,7 @@ object LMCoursier {
sbt.internal.librarymanagement.ivy.IvyCredentials.loadCredentials(fc.path)
}) match {
case Left(err) => st.log.warn(err)
case Right(d) =>
case Right(d) =>
credentialRegistry.put((d.host, d.realm), d)
()
}

View File

@ -30,7 +30,7 @@ private[sbt] object APIMappings {
): Option[(HashedVirtualFileRef, URI)] =
entry.get(Keys.entryApiURL) match
case Some(u) => Some((entry.data, URI(u)))
case None =>
case None =>
entry.get(Keys.moduleIDStr).flatMap { str =>
val mid = Classpaths.moduleIdJsonKeyFormat.read(str)
extractFromID(entry.data, mid, log)

View File

@ -53,7 +53,7 @@ private[sbt] abstract class AbstractTaskExecuteProgress(
val now = System.nanoTime
tasks.forEach { t =>
timings.get(t) match {
case null =>
case null =>
case timing =>
if (timing.isActive) {
val elapsed = (now - timing.startNanos) / 1000

View File

@ -178,15 +178,16 @@ object Act {
): Seq[Parser[ParsedKey]] =
for {
conf <- configs(confAmb, defaultConfigs, proj, index)
} yield for {
taskAmb <- taskAxis(index.tasks(proj, conf), keyMap)
task = resolveTask(taskAmb)
key <- key(index, proj, conf, task, keyMap)
extra <- extraAxis(keyMap, IMap.empty)
} yield {
val mask = baseMask.copy(task = taskAmb.isExplicit, extra = true)
ParsedKey(makeScopedKey(proj, conf, task, extra, key), mask)
}
} yield
for {
taskAmb <- taskAxis(index.tasks(proj, conf), keyMap)
task = resolveTask(taskAmb)
key <- key(index, proj, conf, task, keyMap)
extra <- extraAxis(keyMap, IMap.empty)
} yield {
val mask = baseMask.copy(task = taskAmb.isExplicit, extra = true)
ParsedKey(makeScopedKey(proj, conf, task, extra, key), mask)
}
def makeScopedKey(
proj: Option[ResolvedReference],
@ -246,7 +247,7 @@ object Act {
private def keys(ss: Seq[ParsedKey]): Seq[ScopedKey[?]] = ss.map(_.key)
def selectByConfig(ss: Seq[ParsedKey]): Seq[ParsedKey] =
ss match {
case Seq() => Nil
case Seq() => Nil
case Seq(x, tail*) => // select the first configuration containing a valid key
tail.takeWhile(_.key.scope.config == x.key.scope.config) match {
case Seq() => x :: Nil
@ -531,7 +532,7 @@ object Act {
for
keys <-
action match
case SingleAction => akp
case SingleAction => akp
case ShowAction | PrintAction | MultiAction =>
for pairs <- rep1sep(akp, token(Space))
yield pairs.flatten
@ -547,7 +548,7 @@ object Act {
structure: BuildStructure,
): Seq[(ScopedKey[?], Option[ProjectQuery])] =
pairs.filter {
case (_, None) => true
case (_, None) => true
case (keys, Some(query)) =>
val f = query.buildQuery(structure)
keys.scope.project.toOption match

View File

@ -55,7 +55,7 @@ object Aggregation {
xs match {
case Seq(KeyValue(_, x: Seq[?])) => print(x.mkString("* ", "\n* ", ""))
case Seq(KeyValue(_, x)) => print(x.toString)
case _ =>
case _ =>
xs foreach { kv =>
print(display.show(kv.key))
kv.value match {

View File

@ -11,7 +11,7 @@ package internal
import java.nio.file.Path
import sbt.internal.inc.MixedAnalyzingCompiler
import xsbti.compile.{ AnalysisStore as XAnalysisStore }
import xsbti.compile.AnalysisStore as XAnalysisStore
import xsbti.compile.analysis.ReadWriteMappers
private[sbt] object AnalysisUtil {

Some files were not shown because too many files have changed in this diff Show More