diff --git a/.scalafmt.conf b/.scalafmt.conf index 06bf21490..6cea8df82 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,5 +1,5 @@ version = 3.8.3 -runner.dialect = scala213 +runner.dialect = scala213source3 assumeStandardLibraryStripMargin = true align.openParenCallSite = false align.openParenDefnSite = false diff --git a/build.sbt b/build.sbt index 5aefd8898..b053eda9b 100644 --- a/build.sbt +++ b/build.sbt @@ -311,6 +311,14 @@ lazy val commonSettings = Def.settings( lazy val compileSettings = Def.settings( scalaVersion := Scala213, + scalacOptions ++= { + scalaBinaryVersion.value match { + case "2.13" => + Seq("-Xsource:3-cross") + case _ => + Nil + } + }, doctestTestFramework := DoctestTestFramework.Munit ) diff --git a/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/parser.scala b/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/parser.scala index 691aa5bf1..07ca6b0cd 100644 --- a/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/parser.scala +++ b/modules/core/src/main/scala/org/scalasteward/core/buildtool/sbt/parser.scala @@ -32,7 +32,7 @@ object parser { val chunks = fs2.Stream.emits(lines).map(removeSbtNoise).split(_ === "--- snip ---") val decoder = Decoder[Dependency].either(Decoder[Resolver]) chunks.mapFilter { chunk => - val (dependencies, resolvers) = chunk.toList.flatMap(decode(_)(decoder).toList).separate + val (dependencies, resolvers) = chunk.toList.flatMap(decode(_)(using decoder).toList).separate Option.when(dependencies.nonEmpty && resolvers.nonEmpty)( Scope(dependencies, resolvers.sorted) ) diff --git a/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala b/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala index 0731484bf..db00d9c6e 100644 --- a/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala +++ b/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala @@ -112,7 +112,7 @@ final case class Version(value: String) { case _ => false } || Rfc5234.hexdig.rep(8).string.filterNot(startsWithDate).parse(value).isRight - private[this] def alnumComponentsWithoutPreRelease: List[Version.Component] = + private def alnumComponentsWithoutPreRelease: List[Version.Component] = alnumComponents.takeWhile { case a: Version.Component.Alpha => !a.isPreReleaseIdent case _ => true diff --git a/modules/core/src/main/scala/org/scalasteward/core/forge/github/GitHubAppApiAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/forge/github/GitHubAppApiAlg.scala index 94d3dc149..b04b4a332 100644 --- a/modules/core/src/main/scala/org/scalasteward/core/forge/github/GitHubAppApiAlg.scala +++ b/modules/core/src/main/scala/org/scalasteward/core/forge/github/GitHubAppApiAlg.scala @@ -29,10 +29,10 @@ class GitHubAppApiAlg[F[_]]( F: Concurrent[F] ) { - private[this] val acceptHeader = + private val acceptHeader = Header.Raw(ci"Accept", "application/vnd.github.v3+json") - private[this] def addHeaders(jwt: String): client.ModReq = + private def addHeaders(jwt: String): client.ModReq = req => F.point( req.putHeaders( diff --git a/modules/core/src/main/scala/org/scalasteward/core/git/FileGitAlg.scala b/modules/core/src/main/scala/org/scalasteward/core/git/FileGitAlg.scala index 40297a326..535d99d0c 100644 --- a/modules/core/src/main/scala/org/scalasteward/core/git/FileGitAlg.scala +++ b/modules/core/src/main/scala/org/scalasteward/core/git/FileGitAlg.scala @@ -71,7 +71,7 @@ final class FileGitAlg[F[_]](config: Config)(implicit ): F[Commit] = { val messages = message.paragraphs.foldMap(m => List("-m", m)) val trailers = message.trailers.foldMap { case (k, v) => List("--trailer", s"$k=$v") } - git_("commit" :: "--all" :: sign :: signoff(signoffCommits) :: messages ++ trailers: _*)( + git_(("commit" :: "--all" :: sign :: signoff(signoffCommits) :: messages ++ trailers)*)( repo ) >> latestSha1(repo, Branch.head).map(Commit.apply) @@ -181,7 +181,7 @@ final class FileGitAlg[F[_]](config: Config)(implicit } private def git_(args: String*)(repo: File): F[List[String]] = - git(args: _*)(repo, SlurpOptions.ignoreBufferOverflow) + git(args*)(repo, SlurpOptions.ignoreBufferOverflow) private val sign: String = if (config.gitCfg.signCommits) "--gpg-sign" else "--no-gpg-sign" diff --git a/modules/core/src/main/scala/org/scalasteward/core/io/process.scala b/modules/core/src/main/scala/org/scalasteward/core/io/process.scala index 3eb2c5ac8..79ce86ba2 100644 --- a/modules/core/src/main/scala/org/scalasteward/core/io/process.scala +++ b/modules/core/src/main/scala/org/scalasteward/core/io/process.scala @@ -61,7 +61,7 @@ object process { )(implicit F: Async[F]): F[List[String]] = createProcess(args).flatMap { process => F.delay(new ListBuffer[String]).flatMap { buffer => - val raiseError = F.raiseError[List[String]] _ + val raiseError = F.raiseError[List[String]] val result = readLinesIntoBuffer(process.getInputStream, buffer, maxBufferSize, log) @@ -91,7 +91,7 @@ object process { private def createProcessBuilder[F[_]](args: Args)(implicit F: Sync[F]): F[ProcessBuilder] = F.blocking { - val pb = new ProcessBuilder(args.command.toList: _*) + val pb = new ProcessBuilder(args.command.toList*) args.workingDirectory.foreach(file => pb.directory(file.toJava)) val env = pb.environment() if (args.slurpOptions(SlurpOption.ClearEnvironment)) env.clear()