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

PatternFilterable not working #151

Open
Vampire opened this issue Jun 6, 2019 · 4 comments
Open

PatternFilterable not working #151

Vampire opened this issue Jun 6, 2019 · 4 comments

Comments

@Vampire
Copy link

Vampire commented Jun 6, 2019

As far as I could determine, using the PatternFilterable methods like exclude and include 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 use classes = 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 that PatternFilterable 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 (like exclude { ... }) fail the build if you use them.

@jscancella
Copy link
Contributor

@Vampire is this still an issue?

@Vampire
Copy link
Author

Vampire commented Apr 8, 2021

Well, it is kind of anti-fixed.
The possibility to exclude was completely removed. :-(

@jscancella
Copy link
Contributor

@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

@Vampire
Copy link
Author

Vampire commented Apr 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants