Skip to content

Commit

Permalink
Merge pull request #467 from danicheg/tweak-error-msg
Browse files Browse the repository at this point in the history
Enhance error message when SemanticDB scalac plugin can't be found
  • Loading branch information
bjaglin authored Feb 16, 2025
2 parents 72375c3 + a7600dd commit 037b18d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/main/scala/scalafix/sbt/ScalafixPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,12 @@ object ScalafixPlugin extends AutoPlugin {
resolveException.failed.headOption match {
case Some(SemanticdbScalac(rev)) =>
val scalaV = scalaVersion.value
val msg = s"The SemanticDB scalac plugin version ${rev} set up " +
"via `semanticdbVersion` does follow the version recommended " +
"for Scalafix, but is not supported for the outdated Scala " +
s"version ${scalaV}. Please upgrade to a more recent Scala " +
"patch version or uninstall sbt-scalafix."
val msg =
s"The SemanticDB scalac plugin version ${rev} set up " +
"via `semanticdbVersion` does follow the version recommended " +
"for Scalafix, but is not supported for the given Scala " +
s"version ${scalaV}. Please consider upgrading to a more recent version " +
"of sbt-scalafix and/or Scala, or uninstalling sbt-scalafix plugin."
throw inc.copy(message = Some(msg))
case _ =>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ checkLogs := {
assert(
logLines.exists(
_.contains(
"Please upgrade to a more recent Scala patch version or uninstall sbt-scalafix"
"Please consider upgrading to a more recent version of sbt-scalafix and/or Scala, or uninstalling sbt-scalafix plugin"
)
)
)
Expand Down

0 comments on commit 037b18d

Please sign in to comment.