Skip to content

Commit b582487

Browse files
committed
support upcoming 3.3.4 for unused warnings
scala/scala3#17835 (comment)
1 parent a005e01 commit b582487

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

scalafix-rules/src/main/scala/scalafix/internal/rule/OrganizeImports.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ object OrganizeImports {
864864
scalaVersion: String
865865
): Configured[Rule] = {
866866
val hasCompilerSupport =
867-
Seq("3.0", "3.1", "3.2", "3.3")
867+
Seq("3.0", "3.1", "3.2", "3.3.0", "3.3.1", "3.3.2", "3.3.3")
868868
.forall(v => !scalaVersion.startsWith(v))
869869

870870
val hasWarnUnused = hasCompilerSupport && {
@@ -916,12 +916,12 @@ object OrganizeImports {
916916
"A Scala compiler option is required to use OrganizeImports with"
917917
+ " \"OrganizeImports.removeUnused\" set to true. To fix this problem, update your"
918918
+ " build to add `-Ywarn-unused` (2.12), `-Wunused:imports` (2.13), or"
919-
+ " `-Wunused:import` (3.4+)."
919+
+ " `-Wunused:import` (3.3.4+ or 3.4+)."
920920
)
921921
else
922922
Configured.error(
923923
"\"OrganizeImports.removeUnused\"" + s"is not supported on $scalaVersion as the compiler is"
924-
+ " not providing enough information. Please upgrade the Scala compiler to 3.4.0 or greater."
924+
+ " not providing enough information. Please upgrade the Scala compiler to 3.3.4+ or 3.4+."
925925
+ " Otherwise, run the rule with \"OrganizeImports.removeUnused\" set to false"
926926
+ " to organize imports while keeping potentially unused imports."
927927
)

scalafix-rules/src/main/scala/scalafix/internal/rule/RemoveUnused.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RemoveUnused(config: RemoveUnusedConfig)
3333
private def warnUnusedString = List("-Xlint", "-Xlint:unused")
3434
override def withConfiguration(config: Configuration): Configured[Rule] = {
3535
val diagnosticsAvailableInSemanticdb =
36-
Seq("3.0", "3.1", "3.2", "3.3")
36+
Seq("3.0", "3.1", "3.2", "3.3.0", "3.3.1", "3.3.2", "3.3.3")
3737
.forall(v => !config.scalaVersion.startsWith(v))
3838

3939
val hasWarnUnused = config.scalacOptions.exists(option =>
@@ -44,11 +44,11 @@ class RemoveUnused(config: RemoveUnusedConfig)
4444
Configured.error(
4545
"""|A Scala compiler option is required to use RemoveUnused. To fix this problem,
4646
|update your build to add -Ywarn-unused (with 2.12), -Wunused (with 2.13), or
47-
|-Wunused:all (with 3.4+)""".stripMargin
47+
|-Wunused:all (with 3.3.4+ or 3.4+)""".stripMargin
4848
)
4949
} else if (!diagnosticsAvailableInSemanticdb) {
5050
Configured.error(
51-
"You must use a more recent version of the Scala 3 compiler (3.4+)"
51+
"You must use a more recent version of the Scala 3 compiler (3.3.4+ or 3.4+)"
5252
)
5353
} else {
5454
config.conf

0 commit comments

Comments
 (0)