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

StaticImport: add com.google.errorprone.BugPattern.{LinkType,SeverityLevel,StandardTags} #34

Merged
merged 4 commits into from
Apr 11, 2022

Conversation

rickie
Copy link
Member

@rickie rickie commented Jan 22, 2022

No description provided.

Copy link
Member

@werli werli left a comment

Choose a reason for hiding this comment

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

Nothing from my side except: Nice!

@rickie
Copy link
Member Author

rickie commented Mar 5, 2022

Suggested commit message:

Require static import of `com.google.errorprone.BugPattern.*` enums and fields

Import the enums `BugPattern.{LinkType,ServerityLevel}` and fields from
`BugPattern.StandardTags`.

Not sure about the term "fields" here, as the fields are nested in StandardTags.

@Stephan202 Stephan202 added this to the 0.1.0 milestone Apr 10, 2022
@Stephan202 Stephan202 force-pushed the rossendrijver/bugpattern_annotation_static_imports branch from c0ed971 to ec88b8a Compare April 10, 2022 11:16
Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Rebased and added a small commit. Alternative suggested commit message:

Require static import of `BugPattern.{LinkType,ServerityLevel,StandardTags}` members (#34)

Comment on lines 48 to 52
// XXX: Enable this test for all JREs once https://github.com/google/error-prone/pull/2820 is
// merged and released.
@Test
@DisabledForJreRange(min = JRE.JAVA_12)
@Test
void replacement() {
Copy link
Member

Choose a reason for hiding this comment

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

Would leave this change out; once we enable annotation ordering we might actually add an exemption for these two.

" final class Test {}",
"",
" @BugPattern(",
" name = \"TestBugChecker\",",
Copy link
Member

Choose a reason for hiding this comment

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

In anticipation of upcoming changes we can already omit the word Checker here and from the class name. (And after upgrading Error Prone we can omit the name attribute.)

@rickie
Copy link
Member Author

rickie commented Apr 11, 2022

Changes LGTM!

@Stephan202 Stephan202 merged commit e8977be into master Apr 11, 2022
@Stephan202 Stephan202 deleted the rossendrijver/bugpattern_annotation_static_imports branch April 11, 2022 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants