Custom lint rule to check 'override' functions in Kotlin

69 Views Asked by At

I want to write a custom lint rule to detect 'override' functions in Kotlin.

override fun testFunction(test: String) {
// function body
}

I would like to detect whether any function I am traversing via UAST is an override function.

override fun createUastHandler(context: JavaContext): UElementHandler {
        return object : UElementHandler() {
            override fun visitMethod(node: UMethod) {
                // function to detect whether node is an override function

            }
        }
    }

I tried almost all properties present in UMethod but could not get any success.

0

There are 0 best solutions below