-
Notifications
You must be signed in to change notification settings - Fork 928
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
@nowarn annotation does not suppress any warnings
when compiling SBT plugins
#6430
Comments
Thanks for reporting! This bug is indeed related to #6398 We will be able to fix it by adding As a temporary fix you should do the same in your build. |
Thanks for the quick fix! |
Hey @adpi2 and @eed3si9n, it looks like the problem still happens with sbt 1.5.1, at least under certain circumstances. Here's a minimal example:
|
Ah, I think I figured this out. Looking at the fix (https://github.com/sbt/sbt/pull/6431/files) it only works when using I assume that using the plugin is (now) preferred over just setting the |
@dziemba Thanks for the detective work. It's true that using |
Fixes sbt#6430. What is the problem? As detailed in sbt#6430, the @nowarn annotation was not suppressing warnings, even after the first attempt to fix this in PR#6431. This first PR fixed the problem for projects using enablePlugins(SbtPlugin), but not for those using sbtPlugin := true. Why is this a valuable problem to solve? The annotation was not working as users would expect. What is this solution? I have moved the scalacOptions change from SbtPlugin.projectSettings to the scalacOptions in the JvmPlugin settings. Has this been tested? Yes, a test has been added. Also, this branch was tested successfully on the twinagle repo (soundcloud/twinagle#224).
Fixes sbt#6430. What is the problem? As detailed in sbt#6430, the @nowarn annotation was not suppressing warnings, even after the first attempt to fix this in PR#6431. This first PR fixed the problem for projects using enablePlugins(SbtPlugin), but not for those using sbtPlugin := true. Why is this a valuable problem to solve? The annotation was not working as users would expect. What is this solution? I have moved the scalacOptions change from SbtPlugin.projectSettings to the scalacOptions in the JvmPlugin settings. Has this been tested? Yes, a test has been added. Also, this branch was tested successfully on the twinagle repo (soundcloud/twinagle#224).
Fixes sbt#6430. What is the problem? As detailed in sbt#6430, the @nowarn annotation was not suppressing warnings, even after the first attempt to fix this in PR#6431. This first PR fixed the problem for projects using enablePlugins(SbtPlugin), but not for those using sbtPlugin := true. Why is this a valuable problem to solve? The annotation was not working as users would expect. What is this solution? I have moved the scalacOptions change from SbtPlugin.projectSettings to the scalacOptions in the JvmPlugin settings. Has this been tested? Yes, a test has been added. Also, this branch was tested successfully on the twinagle repo (soundcloud/twinagle#224).
Fixes sbt#6430. What is the problem? As detailed in sbt#6430, the @nowarn annotation was not suppressing warnings, even after the first attempt to fix this in PR#6431. This first PR fixed the problem for projects using enablePlugins(SbtPlugin), but not for those using sbtPlugin := true. Why is this a valuable problem to solve? The annotation was not working as users would expect. What is this solution? I have moved the scalacOptions change from SbtPlugin.projectSettings to the scalacOptions in the JvmPlugin settings. Has this been tested? Yes, a test has been added. Also, this branch was tested successfully on the twinagle repo (soundcloud/twinagle#224).
steps
Trying to build an SBT plugin with sbt 1.5.0, in our case twinagle.
problem
We get
@nowarn annotation does not suppress any warnings
errors in the code that extendsAutoPlugin
.expectation
No warnings/errors are emitted.
notes
Seems related to #6398
The text was updated successfully, but these errors were encountered: