Skip to content

Commit

Permalink
Display all supported scalaVersions for ExplicitResultType (#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlachkar authored Jul 3, 2020
1 parent c5817c6 commit ad0de52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ lazy val rules = project
buildInfoKeys ++= Seq[BuildInfoKey](
"supportedScalaVersions" -> (scalaVersion.value +:
testedPreviousScalaVersions
.getOrElse(scalaVersion.value, Nil))
.getOrElse(scalaVersion.value, Nil)),
"allSupportedScalaVersions" -> ((crossScalaVersions.value ++ testedPreviousScalaVersions.values.toSeq.flatten).sorted)
),
buildInfoObject := "RulesBuildInfo",
description := "Built-in Scalafix rules",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ final class ExplicitResultTypes(
) extends SemanticRule("ExplicitResultTypes") {

def this() = this(ExplicitResultTypesConfig.default, LazyValue.now(None))
val supportedScalaVersions = RulesBuildInfo.supportedScalaVersions
val compilerScalaVersion = RulesBuildInfo.scalaVersion
val supportedScalaVersions: collection.Seq[String] =
RulesBuildInfo.supportedScalaVersions
val compilerScalaVersion: String = RulesBuildInfo.scalaVersion

private def toBinaryVersion(v: String) = v.split('.').take(2).mkString(".")

override def description: String =
"Inserts type annotations for inferred public members. " +
s"Only compatible with Scala ${supportedScalaVersions.mkString(",")}."
s"Only compatible with Scala ${RulesBuildInfo.allSupportedScalaVersions.mkString(", ")}."
override def isRewrite: Boolean = true

override def afterComplete(): Unit = {
Expand Down

0 comments on commit ad0de52

Please sign in to comment.