Extended annotation filtering#3364
Merged
hazendaz merged 2 commits intospotbugs:masterfrom Apr 15, 2025
Merged
Conversation
hazendaz
approved these changes
Mar 22, 2025
JuditKnoll
requested changes
Mar 24, 2025
spotbugs-tests/src/test/java/edu/umd/cs/findbugs/filter/AnnotationMatcherTest.java
Outdated
Show resolved
Hide resolved
spotbugs-tests/src/test/java/edu/umd/cs/findbugs/filter/AnnotationMatcherTest.java
Outdated
Show resolved
Hide resolved
spotbugs-tests/src/test/java/edu/umd/cs/findbugs/filter/AnnotationMatcherTest.java
Show resolved
Hide resolved
spotbugs-tests/src/test/java/edu/umd/cs/findbugs/filter/AnnotationMatcherTest.java
Outdated
Show resolved
Hide resolved
a4e79b2 to
371dd17
Compare
Contributor
Author
|
@JuditKnoll Can you please take another look at the updated patch? |
JuditKnoll
requested changes
Mar 28, 2025
spotbugs-tests/src/test/java/edu/umd/cs/findbugs/filter/AnnotationMatcherTest.java
Outdated
Show resolved
Hide resolved
spotbugsTestCases/src/fakeAnnotations/org/immutables/value/Generated.java
Outdated
Show resolved
Hide resolved
371dd17 to
fb36014
Compare
Pull request spotbugs#2395 added option to filter out bugs based on annotation on class. This patch generalizes the feature to include annotations applied to methods and fields as well. It is particularly useful for generated code; e.g. lombok can be configured to apply `@lombok.Generated` to methods it generates. Generalized annotation filtering can be used to fix issue spotbugs#3350 with change to the `lombok.config` file: ```diff + lombok.addLombokGeneratedAnnotation = true - lombok.extern.findbugs.addSuppressFBWarnings = true ``` and `<Annotation name="lombok.Generated" />` addition to the `spotbugsExclude.xml`.
fb36014 to
ad20f67
Compare
JuditKnoll
approved these changes
Apr 1, 2025
Contributor
Author
|
Is there anything left to be done before it can be merged? |
hazendaz
approved these changes
Apr 15, 2025
Member
I fixed merged conflict on change log, rebuilding now. If all builds ok will merge. I'm thinking we probably release this coming weekend. |
Contributor
Author
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request #2395 added option to filter out bugs based on annotation on class. This patch generalizes the feature to include annotations applied to methods and fields as well. It is particularly useful for generated code; e.g. lombok can be configured to apply
@lombok.Generatedto methods it generates.Generalized annotation filtering can be used to fix issue #3350 with change to the
lombok.configfile:and
<Annotation name="lombok.Generated" />addition to thespotbugsExclude.xml.Make sure these boxes are checked before submitting your PR -- thank you!
CHANGELOG.mdif you have changed SpotBugs code