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
Fix unused nowarn in sbt plugins #6431
Conversation
|
||
object SbtPlugin extends AutoPlugin { | ||
override def requires = ScriptedPlugin | ||
|
||
override lazy val projectSettings: Seq[Setting[_]] = Seq( | ||
sbtPlugin := true | ||
sbtPlugin := true, | ||
Compile / scalacOptions += "-Wconf:cat=unused-nowarn:s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this too global? Wouldn't this silence also other "unused" warnings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option does only silence the unused @nowarn
warnings in the SbtPlugin
projects.
@nowarn annotation does not suppress any warnings
It is not a perfect solution because it will silence your own unused @nowarn
annotations. But it is very specific to sbt plugins and it is harmless.
A better solution would be to have scala/scala#9491 but it is only available in 2.13.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix!
The fix LGTM but could you add fatal warning to some scripted plugin build as a test plz?
3da6160
to
6768987
Compare
Test added. Also the option is only added if scalaVersion >= 2.12.13 because it was not available in 2.12.12. So the solution in 2.12.12 is to upgrade to 2.12.13 |
Fixes #6430