Skip to content
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

False positive-ish: no way to suppress warnings where annotations cannot be used #410

Open
marconilanna opened this issue Nov 11, 2017 · 0 comments

Comments

@marconilanna
Copy link

I'm using contrib.OldTime, however the issue applies to other rules as well.

I need to interop with a legacy Java API. While I can @SuppressWarnings the usage site, there is no way to annotate the import clause. Disabling the check for the whole project is not desirable. Other static analysis tools can use comments instead of annotations, which would be a solution to this problem.

import java.util.Date // wartremover error here. how to whitelist it?

@SuppressWarnings(Array(Warts.OldTime))
class X {
  def y = legacyJavaApi.z(new Date)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant