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

adam-mcneilly

10/20/2019, 1:47 AM
In one of my sample apps, I'm trying to move all of my static analysis checks into the root project, where previously I had them in each of two modules. I put this off because I keep facing some issue that when I put the static analysis plugin inside it's own gradle file, detekt never seems to be able to find my config file and I believe that causes it to fall back on detekt's default config file. I have a PR up on the sample app highlighting the code change, if anyone could help take a look some time, but this isn't urgent. https://github.com/AdamMc331/PokeDex/pull/54/files#r336759846
Is there some way to see where detekt is pointing to for a config file? I tried running with
--info
but didn't see it.
If I run
detektGenerateConfig
, it creates a file in
rootProject/config/detekt/detekt.yml
. If I replace that with my custom one, everything works fine. I suppose I found a work around, now, but I still don't understand why the above doesn't work out.
t

taso

10/26/2019, 9:27 AM
Instead of
file("${project.projectDir}/config/detekt/detekt.yml")
shouldn't it be rootProject?
You can actually use this
rootProject.file('config/detekt/detekt.yml')
Project at that level is the subproject. That is trying to look into yml files in each module.