I'm trying to create a custom rule for Lint that would be a twist on existing deprecation warning tests.
Thing is the documentation I have read so far tells me really little about how to implement a class (that I think needs to be) implementing Detector.JavaScanner
This is a fairly general question I guess, but anyone knowledgeable of this issue, or where I could find actually useful documentation on the matter?
Best How To :
Documentation on this is really rare, so don't worry if you haven't found more.
The best way to start into custom lint rule development is actually to adapt existing rules like mentioned here .
Here are the sources of Android's default set of rules: . Pick one that implements
JavaScanner to see how it works.
If you are looking for a basic, gradle-based, project template for your custom rules, please take a look at one custom rule I have created . Just replace the
HardcodedValueDetector with your detector and reference it in the
One last remark: I'am holding a workshop at this year's Droidcon in Berlin, where I will elaborate on how to write custom lint rules. One part will be on JavaScanners . So feel free to visit the workshop or stand by, cause I am going to publish all sources after that workshop.