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

Lilly

11/02/2020, 1:45 PM
Hi, I have registered the following task in my root build.gradle.kts:
Copy code
tasks.register<Detekt>("detektAll") {
        setSource(projectDir)
        buildUponDefaultConfig = true
        config.setFrom(configFile)
        parallel = true
        debug = true
        reports {
            xml.enabled = false
            html.enabled = false
            txt.enabled = false
        }
        include("**/*.kt")
        include("**/*.kts")
        exclude("resources/")
        exclude("build/")
    }
I run the task with
gradlew detektAll
. Why does it log the output to console in first run but not in second run? Edit: ok got it. I had set the maxIssues to 30, now it's 0 again. Same code different question: my task does not show the
formatting
rule set from the
formatting
plugin while
detekt
does. Did I miss something. Edit2: ok got second issue too. I had to add
Copy code
dependencies {
    detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.14.2")
}
to my root build.gradle.kts, not to my sub projects build script. Edit3: correction: I have to add it to root build script and sub projects build script aswell
g

gammax

11/02/2020, 2:14 PM
does not show the 
formatting
 rule set
Do you mean that you’re not getting issue reported for the
formatting
rule set?
l

Lilly

11/02/2020, 2:18 PM
@gammax Thanks for your answer. I have solved it, see Edit2
g

gammax

11/02/2020, 2:31 PM
👍
3 Views