Closed ccjernigan closed 4 months ago
Experiencing the same issue (was about to open it too, thanks @ccjernigan 🙂)
From looking at the code I suspect line 168 in KtlintCommandLine.kt to be the problem: split(",")
would put output=...
as a own reporter configuration, leading to the error down the line in ReporterAggregator
For reference, the error was probably introduced in
Experiencing the same issue (was about to open it too, thanks @ccjernigan 🙂)
From looking at the code I suspect line 168 in KtlintCommandLine.kt to be the problem:
split(",")
would putoutput=...
as a own reporter configuration, leading to the error down the line inReporterAggregator
You're right that this is part of the problem. I made a mistake while migrating to clikt. The reporterConfiguration
has to be a list because multiple reporters can be specified:
ktlint --reporter=plain --reporter=checkstyle,output=ktlint-report-in-checkstyle-format.xml
I have assumed that the list of reporters would be separated by comma's. But the comma is indeeded needed for parsing the different elements in a reporter configuration. Apparently this was not covered by the unit tests.
Expected Behavior
Using the CLI, generating a ktlint report to a checkstyle formatted file should succeed.
Observed Behavior
Looking at the error, it suggests the command line parser has dropped the report type. This is a regression in 1.2.0.
Steps to Reproduce
Invoke the ktlint CLI with the arguments
--reporter=checkstyle,output=${path}
See custom ktlint gradle convention script below.
Your Environment
.editorconfig
settings