Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Fix removeUnused on 2.11 (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabro authored Sep 27, 2020
1 parent 0356d25 commit cdc0165
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 76 deletions.
18 changes: 7 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,18 @@ lazy val input = project

lazy val output = project
.dependsOn(shared)
.settings(
skip in publish := true,
Compile / unmanagedSourceDirectories ++= {
val baseMainDir = baseDirectory.value / "src" / "main"
if (scalaVersion.value.startsWith("2.12.") || scalaVersion.value.startsWith("2.13."))
Seq(baseMainDir / "scala-2.12_2.13")
else
Nil
}
)
.settings(skip in publish := true)

lazy val inputUnusedImports = project
.dependsOn(shared)
.settings(
skip in publish := true,
scalacOptions ++= List("-Ywarn-unused")
scalacOptions += {
if (scalaVersion.value.startsWith("2.11."))
"-Ywarn-unused-import"
else
"-Ywarn-unused"
}
)

lazy val tests = project
Expand Down
15 changes: 0 additions & 15 deletions output/src/main/scala-2.11/fix/RemoveUnused.scala

This file was deleted.

13 changes: 0 additions & 13 deletions output/src/main/scala-2.11/fix/RemoveUnusedLocal.scala

This file was deleted.

16 changes: 0 additions & 16 deletions output/src/main/scala-2.11/fix/RemoveUnusedMixed.scala

This file was deleted.

19 changes: 0 additions & 19 deletions output/src/main/scala-2.11/fix/RemoveUnusedRelative.scala

This file was deleted.

4 changes: 2 additions & 2 deletions rules/src/main/scala/fix/OrganizeImports.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class OrganizeImports(config: OrganizeImportsConfig) extends SemanticRule("Organ
Configured.error(
"The Scala compiler option \"-Ywarn-unused\" is required to use OrganizeImports with"
+ " \"OrganizeImports.removeUnused\" set to true. To fix this problem, update your"
+ " build to use at least one Scala compiler option like -Ywarn-unused, -Xlint:unused"
+ " (2.12.2 or above) or -Wunused (2.13 only)"
+ " build to use at least one Scala compiler option like -Ywarn-unused-import (2.11 only),"
+ " -Ywarn-unused, -Xlint:unused (2.12.2 or above) or -Wunused (2.13 only)"
)
}

Expand Down

0 comments on commit cdc0165

Please sign in to comment.