forbidden-apis icon indicating copy to clipboard operation
forbidden-apis copied to clipboard

Method whitelist support

Open hakanai opened this issue 3 years ago • 1 comments

Often I find myself in a situation where an update to a library drags in a new evil method, and I only discover it after the fact. It would be nice if new methods were treated as suspicious by default.

The syntax I was thinking of was something like:

@defaultMessage Use `MatcherAssert` from Hamcrest instead.
!org.junit.jupiter.api.Assertions#fail(java.lang.String)
org.junit.jupiter.api.Assertions#*

Allowing people to call fail() still while also saying that any other calls to Assertions' static methods are not OK.

This way, when a new method appears, it's automatically blocked, and someone can come and discuss why they think they need it.

hakanai avatar Sep 21 '21 02:09 hakanai

I often find myself in a similar situation - I would like to allow only part of the library, a single package, etc...

saberduck avatar Aug 26 '22 14:08 saberduck