This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
PT-434: Better classes filtering for Findbugs tasks #23
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.
Scope of the PR
While integrating the plugin in one of our projects we realised that Findbugs was analysing a source folder even though an exclude rule was provided for it.
Considerations and implementation
After quite some investigation we realised that the issue is related to the way* we create include patterns from the filtered collection in
source
. When the source is empty (eg: all the source files have been filtered out) no include pattern can be generated, therefore the collection of classes won't be filtered at all. This sometimes is not a problem because the analysis task is skipped anyway (source
property is marked as@SkipWhenEmpty
), but this doesn't seem enough to cover all cases.We decided then to enforce an empty collection for
classes
when an empty collection is found insource
.Incidentally the task generating html reports for findbugs is now skipped when the related analysis has not run.
Test(s) added
FindbugsIntegrationTest
now contains few more tests to check::findbug*
task has been executed/skippedclasses
property is provided to eachfindbugs*
task with an emptysource