Skip to content

Custom reporter

Build a custom reporter

Take a look at ktlint-cli-reporter-plain.

In short, all you need to do is to implement a ReporterV2 and make it available by registering a custom ReporterProviderV2 using META-INF/services/com.pinterest.ktlint.cli.reporter.core.api.ReporterProviderV2. Pack all of that into a JAR and you're done.

To load a custom (3rd party) reporter use ktlint --reporter=name,artifact=/path/to/custom-ktlint-reporter.jar (see ktlint --help for more).

Third party reporters

Known third-party reporters: