mirror of https://github.com/sbt/sbt.git
add `using` if explicitly providing arguments to methods defined with `implicit`
This commit is contained in:
parent
84ebcd3c34
commit
74a4abf049
|
|
@ -37,7 +37,7 @@ private[sbt] object SbtRefactorings:
|
|||
val split = SbtParser(FAKE_FILE, lines)
|
||||
given ctx: Context = SbtParser.defaultGlobalForParser.compileCtx
|
||||
val recordedCommands = recordCommands(commands, split)
|
||||
val sortedRecordedCommands = recordedCommands.sortBy(_._1)(reverseOrderingInt)
|
||||
val sortedRecordedCommands = recordedCommands.sortBy(_._1)(using reverseOrderingInt)
|
||||
|
||||
val newContent = replaceFromBottomToTop(lines.mkString(END_OF_LINE), sortedRecordedCommands)
|
||||
newContent.linesIterator.toList
|
||||
|
|
|
|||
|
|
@ -543,9 +543,7 @@ object Tests {
|
|||
}
|
||||
}
|
||||
sequence(results.toList, List()) map { res =>
|
||||
val (rs, ms) = res.unzip { e =>
|
||||
(e.overall, e.events)
|
||||
}
|
||||
val (rs, ms) = res.unzip(using (e => (e.overall, e.events)))
|
||||
val m = ms reduce { (m1: Map[String, SuiteResult], m2: Map[String, SuiteResult]) =>
|
||||
Map((m1.toSeq ++ m2.toSeq)*)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3552,9 +3552,9 @@ object Classpaths {
|
|||
import sjsonnew.support.scalajson.unsafe.*
|
||||
val moduleIdFormat: JsonFormat[ModuleID] = implicitly[JsonFormat[ModuleID]]
|
||||
def write(key: ModuleID): String =
|
||||
CompactPrinter(Converter.toJsonUnsafe(key)(moduleIdFormat))
|
||||
CompactPrinter(Converter.toJsonUnsafe(key)(using moduleIdFormat))
|
||||
def read(key: String): ModuleID =
|
||||
Converter.fromJsonUnsafe[ModuleID](Parser.parseUnsafe(key))(moduleIdFormat)
|
||||
Converter.fromJsonUnsafe[ModuleID](Parser.parseUnsafe(key))(using moduleIdFormat)
|
||||
}
|
||||
|
||||
def classifiersModuleTask: Initialize[Task[GetClassifiersModule]] =
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ object RemoteCache {
|
|||
import LibraryManagementCodec.*
|
||||
import sjsonnew.support.scalajson.unsafe.*
|
||||
val format: JsonFormat[Artifact] = summon[JsonFormat[Artifact]]
|
||||
CompactPrinter(Converter.toJsonUnsafe(art)(format))
|
||||
CompactPrinter(Converter.toJsonUnsafe(art)(using format))
|
||||
}
|
||||
|
||||
def gitCommitId: String =
|
||||
|
|
|
|||
|
|
@ -242,9 +242,9 @@ private[sbt] object LibraryManagement {
|
|||
import sjsonnew.support.scalajson.unsafe.*
|
||||
val moduleIdFormat: JsonFormat[ModuleID] = implicitly[JsonFormat[ModuleID]]
|
||||
def write(key: ModuleID): String =
|
||||
CompactPrinter(Converter.toJsonUnsafe(key)(moduleIdFormat))
|
||||
CompactPrinter(Converter.toJsonUnsafe(key)(using moduleIdFormat))
|
||||
def read(key: String): ModuleID =
|
||||
Converter.fromJsonUnsafe[ModuleID](Parser.parseUnsafe(key))(moduleIdFormat)
|
||||
Converter.fromJsonUnsafe[ModuleID](Parser.parseUnsafe(key))(using moduleIdFormat)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -158,13 +158,13 @@ object FileStamp {
|
|||
override def write[J](obj: Seq[(Path, FileStamp)], builder: Builder[J]): Unit = {
|
||||
val (hashes, lastModifiedTimes) = obj.partition(_._2.isInstanceOf[Hash])
|
||||
builder.beginObject()
|
||||
builder.addField("hashes", hashes.asInstanceOf[Seq[(Path, Hash)]])(
|
||||
builder.addField("hashes", hashes.asInstanceOf[Seq[(Path, Hash)]])(using
|
||||
seqPathHashJsonFormatter
|
||||
)
|
||||
builder.addField(
|
||||
"lastModifiedTimes",
|
||||
lastModifiedTimes.asInstanceOf[Seq[(Path, LastModified)]]
|
||||
)(seqPathLastModifiedJsonFormatter)
|
||||
)(using seqPathLastModifiedJsonFormatter)
|
||||
builder.endObject()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue