jeremymailen / kotlinter-gradle

Painless, fast ktlint plugin for Gradle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move `ignoreFailures` property up to `ConfigurableKtLintTask` class

igorwojda opened this issue · comments

Now ignoreFailures property is defined in the LintTask and FormatTask. This property should be moved to ConfigurableKtLintTask and overridden in LintTask and FormatTask.

Example:

val ktlintCheck by tasks.registering(LintTask::class) {
    ignoreFailures = false // Must be provided here

    reports.set(
        mapOf(
            "html" to file("build/reports/ktlint/lint-report.html"),
            "json" to file("build/reports/ktlint/lint-report.json")
        )
    )
}
val ktlintFormat by tasks.registering(FormatTask::class) {
    failBuildWhenCannotAutoFormat = true
    ignoreFailures = false // Must be provided here
}

configure(listOf(ktlintCheck, ktlintFormat)) {
    configure {
        group = "verification"
        source(files("src"))
        // ignoreFailures = false // Can't be provided here
    }
}