With the 1.2.0 release, I seem to be having troubl...
# ktlint
c
With the 1.2.0 release, I seem to be having trouble with the CLI arguments for writing a checkstyle report to a file.
With a Gradle script along the lines of
Copy code
val outputDir = File(File(layout.buildDirectory.asFile.get(), "reports"), "ktlint")
    val outputFile = File(outputDir, "ktlint.xml")
    val ktlintArgs = listOf(
        "--reporter=checkstyle,output=${outputFile.path}",
        "**/src/**/*.kt",
        "!**/build/**.kt",
        "--baseline=$baselineFile",
        "--editorconfig=$editorConfigFile"
    )

    register("ktlint", org.gradle.api.tasks.JavaExec::class) {
        description = "Analyze code style with ktlint."
        classpath = ktlint
        mainClass = "com.pinterest.ktlint.Main"
        args = ktlintArgs
    }
The result is
Copy code
15:29:57.715 [main] ERROR com.pinterest.ktlint.cli.internal.ReporterAggregator -- reporter "output=build/reports/ktlint/ktlint.xml" wasn't found (available: baseline, checkstyle, format, html, json, plain, plain-summary, sarif)
Reading the error message, it seems like something might have changed with the CLI parsing? It seems like the reporter parsing has dropped the
checkstyle,
Is this a bug? Or is there a change to the CLI that I need to accomodate with the 1.2 release?
p
Can you please create an issue? Most likely it is bug. The CLI parser has been replaced.
c