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

sanogueralorenzo

11/06/2019, 9:39 PM
Hello people, aiming to update to detekt 1.1.1 today + change the detekt level to be a unique top level task (gradle cache is nice but on clean but on CI we jumped from 30 seconds to 2:30 due to an increase amount of modules). Is the best way still to do this https://github.com/arturbosch/detekt/issues/1295#issuecomment-516015993 or the detektAll task from detekt project itself? Asked a while back and got it to work (only if you didn't have any baseline) so asking to see if there is any updates or someone can share some experience trying this out https://kotlinlang.slack.com/archives/C88E12QH4/p1566002344009600
m

marschwar

11/07/2019, 6:20 PM
The short answer seems to be "Yes". You might want to follow the discussion at https://github.com/arturbosch/detekt/issues/2035 I just created su a configuration myself and it seems to work fine.
Copy code
task detektAll(type: io.gitlab.arturbosch.detekt.Detekt) {
    description = "Runs detekt for the entire project."

    input = files("$projectDir")
    config = files("$rootDir/detekt-config.yml")
    includes = ["**/*.kt", "**/*.kts"]
    excludes = ["**/test/**/*.kt"]
}
s

sanogueralorenzo

11/07/2019, 7:00 PM
nice thanks! I was about to post that issue I found while digging through the detekt github but you beat me to it
just tried it out, a massive improvement need to create the centralized baseline and I'm also looking how does detekt formatting plugin can work with this approach @marschwar
4 Views