brent
01/14/2020, 7:11 PM1.0.0-RC146
to 1.4.0
. Mostly working, but many of the rules simply aren't running. Looking through GH issues I see work was done around "type resolution" in v 1.1
. Is this working on multi-module Android projects yet? I see this comment from back in October with no corresponding PRs since: https://github.com/arturbosch/detekt/issues/2036#issuecomment-544105669Artur Bosch
01/14/2020, 7:35 PMdetektMain
or detektTest
.
This brings a huge performance penalty. Testing detekt as a kotlin compiler plugin (https://github.com/detekt/detekt-compiler-plugin) lead to huge benefits for us where rules relying on type resolution will come to shine.brent
01/14/2020, 7:59 PMgw detekt
on a module but some of the tasks seem to be silently not running.
I might be experiencing this same issue: https://github.com/arturbosch/detekt/issues/2038#issuecomment-573917395Artur Bosch
01/14/2020, 8:13 PMbrent
01/14/2020, 8:34 PMOnly custom tasks are allowed to override the classpath property.I saw a bunch of references to creating this type of custom task with
classpath
. Including this https://github.com/arturbosch/detekt/issues/1967#issuecomment-538165203
Do you have a working example handy? It's referenced as a possible solution in a few places, but I haven't seen a working example posted anywhere yet.schalkms
01/14/2020, 8:54 PMdetektMain
in order to use rules that use type and symbol solving.brent
01/14/2020, 8:59 PMdetektMain
isn't available on Android projects.schalkms
01/14/2020, 9:01 PMbrent
01/14/2020, 9:13 PMArtur Bosch
01/14/2020, 9:15 PMdependencies {
detekt(project(":detekt-cli"))
detektPlugins(project(":detekt-formatting"))
}
val detektAll by tasks.registering(Detekt::class) {
description = "Runs over whole code base without the starting overhead for each module."
parallel = true
buildUponDefaultConfig = true
include("**/*.kt")
exclude("**/resources/**")
exclude("**/build/**")
exclude("**/*.kts")
// baseline.set(file("$rootDir/config/detekt/baseline.xml"))
classpath.setFrom(project.configurations.getByName("detekt"))
reports {
xml.enabled = false
html.enabled = false
txt.enabled = false
}
}
org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration Build_gradle
File being compiled at position: (1,42) in /build.gradle.kts
The root cause org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException was thrown at: org.jetbrains.kotlin.resolve.lazy.BasicAbsentDescriptorHandler.diagnoseDescriptorNotFound(AbsentDescriptorHandler.kt:18)
brent
01/14/2020, 9:16 PMclasspath.setFrom(project.configurations.getByName("detekt"))
was the magic I was looking for. I'm out of time for today but I'll give this a shot tomorrow. Thanks!!Artur Bosch
01/14/2020, 9:17 PMdetektPlugins
classpath too if you want to use formatting or other pluginsschalkms
01/15/2020, 6:34 PMbrent
01/15/2020, 6:49 PM