-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[error] bad option: -P:silencer:checkUnused in Compile / doc #40
Comments
I ran into the same issue using another silencer parameter ( EDIT: my workaround .settings(
scalacOptions += "-P:silencer:pathFilters=src_managed",
Compile / doc / scalacOptions := scalacOptions.value.filterNot(_.startsWith("-P:silencer"))
) |
Seems like Currently the best solution is to manually filter out plugin related compiler options when running |
Is this true? I just called sbt:sbtRoot> show utilLogging/Compile/scalacOptions
[info] * -encoding
[info] * utf8
[info] * -deprecation
[info] * -feature
[info] * -unchecked
[info] * -Xlint
[info] * -language:higherKinds
[info] * -language:implicitConversions
[info] * -Xfuture
[info] * -Xlint
[info] * -Xfatal-warnings
[info] * -Yno-adapted-args
[info] * -Ywarn-dead-code
[info] * -Ywarn-numeric-widen
[info] * -Ywarn-value-discard
[info] * -Ywarn-unused-import
[info] * -Xplugin:/Users/eed3si9n/.coursier/cache/v1/https/repo1.maven.org/maven2/com/github/ghik/silencer-plugin_2.12/1.4.2/silencer-plugin_2.12-1.4.2.jar
[info] * -Ywarn-unused:-locals,-explicits,-privates
[success] Total time: 0 s, completed Jan 8, 2020 1:35:30 PM
sbt:sbtRoot> show utilLogging/Compile/doc/scalacOptions
[info] * -encoding
[info] * utf8
[info] * -deprecation
[info] * -feature
[info] * -unchecked
[info] * -Xlint
[info] * -language:higherKinds
[info] * -language:implicitConversions
[info] * -Xfuture
[info] * -Xlint
[info] * -Xfatal-warnings
[info] * -Yno-adapted-args
[info] * -Ywarn-dead-code
[info] * -Ywarn-numeric-widen
[info] * -Ywarn-value-discard
[info] * -Ywarn-unused-import
[info] * -Xplugin:/Users/eed3si9n/.coursier/cache/v1/https/repo1.maven.org/maven2/com/github/ghik/silencer-plugin_2.12/1.4.2/silencer-plugin_2.12-1.4.2.jar
[info] * -Ywarn-unused:-locals,-explicits,-privates
[info] * -sourcepath
[info] * /Users/eed3si9n/work/sbt-modules/sbt
[info] * -doc-source-url
[info] * https://github.com/sbt/sbt/tree/b37bad6644da01937fac6eabc798bc670742da24€{FILE_PATH}.scala
[success] Total time: 0 s, completed Jan 8, 2020 1:35:36 PM |
And here's wtih sbt:sbtRoot> show utilLogging/Compile/scalacOptions
[info] * -encoding
[info] * utf8
[info] * -deprecation
[info] * -feature
[info] * -unchecked
[info] * -Xlint
[info] * -language:higherKinds
[info] * -language:implicitConversions
[info] * -Xfuture
[info] * -Xlint
[info] * -Xfatal-warnings
[info] * -Yno-adapted-args
[info] * -Ywarn-dead-code
[info] * -Ywarn-numeric-widen
[info] * -Ywarn-value-discard
[info] * -Ywarn-unused-import
[info] * -Xplugin:/Users/eed3si9n/.coursier/cache/v1/https/repo1.maven.org/maven2/com/github/ghik/silencer-plugin_2.12/1.4.2/silencer-plugin_2.12-1.4.2.jar
[info] * -Ywarn-unused:-locals,-explicits,-privates
[info] * -P:silencer:checkUnused
[success] Total time: 0 s, completed Jan 8, 2020 1:57:48 PM
sbt:sbtRoot> show utilLogging/Compile/doc/scalacOptions
[info] * -encoding
[info] * utf8
[info] * -deprecation
[info] * -feature
[info] * -unchecked
[info] * -Xlint
[info] * -language:higherKinds
[info] * -language:implicitConversions
[info] * -Xfuture
[info] * -Xlint
[info] * -Xfatal-warnings
[info] * -Yno-adapted-args
[info] * -Ywarn-dead-code
[info] * -Ywarn-numeric-widen
[info] * -Ywarn-value-discard
[info] * -Ywarn-unused-import
[info] * -Xplugin:/Users/eed3si9n/.coursier/cache/v1/https/repo1.maven.org/maven2/com/github/ghik/silencer-plugin_2.12/1.4.2/silencer-plugin_2.12-1.4.2.jar
[info] * -Ywarn-unused:-locals,-explicits,-privates
[info] * -P:silencer:checkUnused
[info] * -sourcepath
[info] * /Users/eed3si9n/work/sbt-modules/sbt
[info] * -doc-source-url
[info] * https://github.com/sbt/sbt/tree/b37bad6644da01937fac6eabc798bc670742da24€{FILE_PATH}.scala
[success] Total time: 0 s, completed Jan 8, 2020 1:57:51 PM |
Thanks @eed3si9n, that's interesting. Then it seems that silencer was somehow not properly enabled for |
@ghik The project I'm working with is https://github.com/akka/alpakka. The solution @eed3si9n proposed by omitting the
Before the workaround (akka/alpakka#2077) the build would fail during our snapshot publishing step, on the
|
I believe my object Dependencies {
val silencerLib = "com.github.ghik" % "silencer-lib" % Versions.Silencer % Provided
val silencerPlugin = "com.github.ghik" % "silencer-plugin" % Versions.Silencer
}
object Versions {
val Silencer = "1.4.4"
}
lazy val foo = (project in file("foo"))
.settings(
libraryDependencies ++= Seq(
compilerPlugin(Dependencies.silencerPlugin).cross(CrossVersion.full),
Dependencies.silencerLib.cross(CrossVersion.full)
),
scalacOptions ++= Seq(
"-P:silencer:checkUnused",
...
)
) So is another fix to use |
Just wanted to note that adding this flag to
scalacOptions
caused an error when trying to generate docs (sbt doc
). To fix, I have removed this flag fromCompile / doc
scope inbuild.sbt
like so:Although perhaps the flag could also only be applied to the
Compile / compile
scope:The text was updated successfully, but these errors were encountered: