Skip to content

Commit

Permalink
Merge pull request #403 from steinybot/fix-scala3-error-message
Browse files Browse the repository at this point in the history
Rename scalafixBinaryScalaVersion to scalafixScalaBinaryVersion
  • Loading branch information
bjaglin committed Mar 6, 2024
2 parents 0ab8c2c + 1869f7a commit a6e655e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ object ScalafixInterface {
private[scalafix] val defaultLogger: Logger = ConsoleLogger(System.out)

def fromToolClasspath(
scalafixBinaryScalaVersion: String,
scalafixScalaBinaryVersion: String,
scalafixDependencies: Seq[ModuleID],
scalafixCustomResolvers: Seq[Repository],
logger: Logger,
Expand All @@ -133,24 +133,24 @@ object ScalafixInterface {
new LazyValue({ () =>
fromToolClasspathMemo.getOrElseUpdate(
(
scalafixBinaryScalaVersion,
scalafixScalaBinaryVersion,
scalafixDependencies,
scalafixCustomResolvers
), {
if (scalafixBinaryScalaVersion.startsWith("3"))
if (scalafixScalaBinaryVersion.startsWith("3"))
logger.error(
"To use Scalafix on Scala 3 projects, you must unset `scalafixBinaryScalaVersion`. " +
"To use Scalafix on Scala 3 projects, you must unset `scalafixScalaBinaryVersion`. " +
"Rules such as ExplicitResultTypes requiring the project version to match the Scalafix " +
"version are unsupported for the moment."
)
else if (scalafixBinaryScalaVersion == "2.11")
else if (scalafixScalaBinaryVersion == "2.11")
logger.error(
"Scala 2.11 is no longer supported. Please downgrade to the final version supporting " +
"it: sbt-scalafix 0.10.4."
)
val scalafixArguments = ScalafixAPI
.fetchAndClassloadInstance(
scalafixBinaryScalaVersion,
scalafixScalaBinaryVersion,
scalafixCustomResolvers.asJava
)
.newArguments()
Expand Down

0 comments on commit a6e655e

Please sign in to comment.