I am currently trying to write a custom lint check that I am working on. I have created a separate java project and included it as a jar.
My problem is that no matter what, it seems that my custom check is not being run when analyzing my code base.
I've included a registry
class MyIssueRegistry : IssueRegistry() {
override val issues: List<Issue>
get() = listOf(MyIssues.ISSUE_PATTERN)
}
And a detector
class MyIssueDetector : Detector(), Detector.UastScanner {
override fun getApplicableUastTypes() = listOf(UClass::class.java)
override fun createUastHandler(context: JavaContext) =
MyIssueDetector(context)
class MyIssueDetector(private val context: JavaContext) : UElementHandler() {
override fun visitClass(node: UClass) {
context.report(MyIssues.ISSUE_PATTERN, context.getNameLocation(node), "This is just a test")
}
}
}
I've also added attributes("Lint-Registry-v2": "com.pathto.lint.MyIssueRegistry")
to my java project's gradle and included it in my app gradle as lintChecks project(":lint")
AFAIK this topic- My code should be throwing a warning everytime it reads a class, but the lint check is not being ran. Is there a step I am missing?