Has anybody been able to get detekt to check gradl...
# detekt
n
Has anybody been able to get detekt to check gradle build files? What about the
buildSrc
directory? Ideally from within Gradle.
e
yeah, just add a custom Detekt task for them
Copy code
tasks.register<Detekt>("detektKotlinScripts") {
    group = VERIFICATION_GROUP
    description = "Run detekt analysis for Kotlin scripts"
    source(files().apply { from(layout.projectDirectory.asFileTree.matching { include("*.kts") }) })
}
tasks.register("detektAll") { dependsOn(tasks.withType<Detekt>()) }
tasks.check { dependsOn(tasks.withType<Detekt>()) }
or whatever makes sense for your usage
n
Thank you that worked!