Open Vampire opened 5 years ago
@Vampire is this still an issue?
Well, it is kind of anti-fixed. The possibility to exclude was completely removed. :-(
@Vampire I guess I am confused, are we not talking about the onlyAnalyze
filter in the new plugin? Example: onlyAnalyze = ['com.foobar.MyClass', 'com.foobar.mypkg.*']
. You could also use the <class>
element in the excludeFilter = file('spotbugs-exclude.xml')
see https://spotbugs.readthedocs.io/en/latest/filter.html
The old plugin (2.0.0 for example) was PatternFilterable
, so it should have worked to use the standard exclude
and include
to exclude and include files to be analyzed, but they were just ignored.
excludeFilter
just works after the analysis was done, so it is a waste of time, as all the generated files have to be analyzed just to then exclude the findings for them in the result.
onlyAnalyze
I just have found too, but it is an include filter, not an exclude filter.
So I would need to calculate all classes, and then subtract the the generated classes to set up this property instead of being able to simple exclude the generated classes.
As far as I could determine, using the
PatternFilterable
methods likeexclude
andinclude
has no effect at all. I also see nowhere documented how to include or exclude files from analysis. I found in an issue, that you can useclasses = classes.filter { ... }
to filter the class files.It would be nice if the documentation would get some bits about how to include / exclude files (from analysis, not with the spotbugs exclude filter file which is only applied after the actual analysis).
And it would be much nicer if the
PatternFilterable
methods would work, otherwise it is very confusing thatPatternFilterable
is implemented. At the very least, please make those methods immediately throw an exception if they don't have an effect actually.The PMD plugin for example supports some of the
PatternFilterable
methods (the ones taking an Ant pattern) and the others (likeexclude { ... }
) fail the build if you use them.