Hi, I am new to detekt. Will like to check if ther...
# detekt
n
Hi, I am new to detekt. Will like to check if there any limitations to detekt? Also is detekt able to have compilation information? What I mean by this is if detekt is able have the full Kotlin IR information? Reason is because I have Kotlin source files that uses third party packages APIs. Some of these APIs implementation have a certain annotation that I want to detect. However we will not directly see these annotations as they are only present in the external library. In the case of KAPT, I observed that KAPT can only detect annotations present in Kotlin source files that were parsed to kotlinc. If I want to detect annotations in a “deeper level” (third party library class files) I have to rely on Kotlin IR as it is able to have almost a full context of the entire program information before bytecode is produced.
g
Also is detekt able to have compilation information? What I mean by this is if detekt is able have the full Kotlin IR information?
Yes it is
thank you color 1
n
Nice, thanks!
s
Hi @Nick Chong! Welcome to detekt. You might also want to have a look at detekt's compiler plugin. https://detekt.dev/docs/gettingstarted/compilerplugin
thank you color 1
n
Can I clarify my understanding, we use detekt cli to generate custom rules?
s
Not necessarily. You can also integrate your custom rules with the Gradle plugin. See here for more details. https://detekt.dev/docs/introduction/extensions#let-detekt-know-about-your-extensions