how to run detect with auto-corrector?

229 views Asked by At

./gradlew detekt return very big list with Indentation, and ./gradlew detekt --auto-correct return error - Unknown command-line option --auto-correct.

detect.yml

formatting:
  active: true
  android: false
  autoCorrect: true
  Indentation:
    active: true
    autoCorrect: true
    indentSize: 4
    continuationIndentSize: 4
  ...
  ...

there is an autoCorrect: true everywhere in this block.

detekt.gradle

apply plugin: "io.gitlab.arturbosch.detekt"

detekt {
    autoCorrect = project.hasProperty("correct") ?  correct : false
    toolVersion = "$detektVersion"
    config = files("$rootDir/dev/detekt/detekt.yml")
    buildUponDefaultConfig = true
    parallel = true

    reports {
        html {
            enabled = true
            destination = file("build/reports/detekt.html")
        }
    }
}

dependencies {
    detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion"
    detektPlugins "io.gitlab.arturbosch.detekt:detekt-cli:$detektVersion"
}
0

There are 0 answers