Javier
12/24/2021, 12:31 PMmultiplatform
in docs and I found nothing. I am just running ./gradlew detekt
(indeed ./gradlew build
) and I would like to know if just running it in the linux runner is enough or I just run detekt
on every single runner to detect code smells in all targets of all modules. I would like to avoid running specific detekt**
tasks because I am using reusable workflows in all projects and every project can have different targets and I want a modular workflow but not very complex one.Brais Gabin
12/24/2021, 12:56 PMdetekt
is a dump task. It only runs on src/main/java(kotlin) and src/test/java(kotlin). If you want it to run over other source sets you need to add them. (I'm on phone so please check the documentation to see how, I can't link it). And remember that you wouldn't be running the rules that need type solving.
My recommendation is to add the task detektAll
to all your projects and configure it for each one in gradle.
We need to refactor our gradle plugin. At the begging it was doing a very simple thing so the api was really simple but that api didn't evolve with the complexity of the project. But we would need to add lots of breaking changes to do that. It's a difficult topic. Any contribution to six this is more than appreciated as always.Javier
12/24/2021, 1:29 PMtarget.tasks.withType(Detekt::class.java).configureEach { detekt ->
detekt.setSource(detekt.project.files(detekt.project.projectDir))
detekt.include("**/*.kt")
detekt.include("**/*.kts")
detekt.exclude("**/resources/**")
detekt.exclude("**/build/**")
}
Javier
12/24/2021, 1:30 PMJavier
12/24/2021, 1:31 PMBrais Gabin
12/24/2021, 1:32 PMJavier
12/24/2021, 1:44 PMgammax
12/24/2021, 4:21 PMJavier
12/24/2021, 4:28 PMJavier
12/24/2021, 4:28 PMgammax
12/24/2021, 4:41 PM