https://kotlinlang.org logo
#detekt
Title
# detekt
c

Csabi Szenczi

06/03/2022, 11:33 AM
Hi, How can I include checking of xml files in detekt? I would like to apply to some rules on them. Can someone help me with this please?
i have applied the plugin at root level build.gradle.kts
Copy code
detekt {
    source = files(rootProject.rootDir, "src")
}

tasks.withType<Detekt>().configureEach {
    setSource(files("src/main/res"))
    include("**/*.kt")
    include("**/*.kts")
    include("**/*.xml")
    include("**/**.xml")
    exclude("**/resources/**")
    exclude("**/build/**")
}
As you can see I have tried it with redundancy in hope that I will get lucky with one of the syntaxes but didn't work with either of them
g

gammax

06/03/2022, 11:50 AM
Hey 👋 I don't think it's doable as Detekt is mostly focused on Kotlin files. You won't be able to access the AST and do any inspection
👍 1
c

Csabi Szenczi

06/03/2022, 11:51 AM
Okay, it's alright, it would've been just some small extra anyway. thanks! 🙂
12 Views