-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add gradle thirdPartyAudit to precommit tasks #15491
Conversation
|
That is intentional, because of this problem, we have to hide all forbidden APIs warnings (otherwise the thousands of missing classes would overflow your screen). So yes, it should be leaving stuff to the imagination, like "what else could be wrong". |
LGTM |
Got it. |
The unzipping is not nice, but looks fine. The alternative would be to not use forbiddenapis ANT task, but instead instantiate the forbiddenapis Checker class directly, pass custom logger with INFO and ERROR, but no WARN, and finally feed all classes from a ZipInputStream or similar to prevent the "Ant O(n^2) zipfileset" bug. Backside: You need a bit more code to fix the Checker initialization (classloader, load classes from ZIP stream) +1 |
Tried it locally as well. LGTM. |
Instead of Basically if we have this situation, anything goes. I thought lenient would make it sound appropriately negative, but something in all-upper-case like that would be fine too. :) |
Add gradle thirdPartyAudit to precommit tasks
I am working on improving it further, to eventually remove This is better as it always "keeps tabs", which is what we need. It does require doing a little hack to parse the forbidden apis warnings :) The me, the point of these checks right now is to have nice documentation of issues for every module, not necessarily even to try to fix them. We have to at least know what is happening and what code is or is not running! |
Currently, we do all kinds of checks on our own code, but dependencies are no different. The computer does not care if you wrote it, or dragged it in via a dependency.
This task fails for two situations (implemented with forbidden apis checks):
NoClassDefFoundError
, but in some cases its actually intentional (e.g. optional dependency of a dependency). In those cases, this check can be disabled withthirdPartyAudit.lenient = true
thirdPartyAudit.excludes
. Wildcards are explicitly not permitted in exclusion lists.We can expand in the future, e.g. add additional forbidden apis beyond just internal JDK apis for 3rd party jars if we want. Probably better to worry about sorting out the messes discovered here first (I don't fix em, i just document what they are).