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

promote PreferCommonAnnotations to WARNING #2962

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@AutoService(BugChecker.class)
@BugPattern(
summary = "Prefer the common version of annotations over other copies.",
severity = SeverityLevel.SUGGESTION)
severity = SeverityLevel.WARNING)
public final class PreferCommonAnnotations extends BugChecker implements ImportTreeMatcher {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imports can't be suppressed using @SuppressedWarnings, so this cannot be auto-suppressed. If it had an autofix that worked every time, it would be fine to make this error level. But I don't think this works every time as repos may not have guava as an import (that said, we could make this a "ConditionalPatchCheck" on the presence of guava, which should make it safe).

I don't actually know how suppressible-error-prone behaves with errors on imports - maybe try running this on an internal repo using maven local and see what happens.


/** ClassName -> preferred import. */
Expand Down