Skip to content

Conversation

Nirvikalpa108
Copy link

What is the problem?

As detailed in #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 the 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 #6430.

@eed3si9n
Copy link
Member

@Nirvikalpa108 Thanks for the contribution!

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).
@eed3si9n eed3si9n merged commit 1ae2d9d into sbt:develop May 21, 2021
@eed3si9n eed3si9n changed the title Fix @nowarn annotation in old sbt plugin style Fixes spurious "@nowarn annotation does not suppress any warnings" in old style sbt plugins with sbtPlugin := true Jun 1, 2021
@eed3si9n eed3si9n added this to the 1.5.3 milestone Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@nowarn annotation does not suppress any warnings when compiling SBT plugins
2 participants