From a78998820839edf3900573c7a0caccbf16295319 Mon Sep 17 00:00:00 2001 From: Stanley Shyiko Date: Sun, 23 Jul 2017 21:27:41 -0700 Subject: [PATCH] Added a readme section describing the basics of creating a reporter --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 5044897897..7617aba759 100644 --- a/README.md +++ b/README.md @@ -278,6 +278,18 @@ containing a fully qualified name of your [RuleSetProvider](ktlint-core/src/main A complete sample project (with tests and build files) is included in this repo under the [ktlint-ruleset-template](ktlint-ruleset-template) directory (make sure to check [NoVarRuleTest](ktlint-ruleset-template/src/test/kotlin/yourpkgname/NoVarRuleTest.kt) as it contains some useful information). +## Creating a reporter + +Take a look at [ktlint-reporter-plain](ktlint-reporter-plain). + +In short, all you need to do is to implement a +[Reporter](ktlint-core/src/main/kotlin/com/github/shyiko/ktlint/core/Reporter.kt) and make it available by registering +a custom [ReporterProvider](ktlint-core/src/main/kotlin/com/github/shyiko/ktlint/core/ReporterProvider.kt) using +`META-INF/services/com.github.shyiko.ktlint.core.ReporterProvider`. Pack all of that into a JAR and you're done. + +To load a custom (3rd party) reporter use `ktlint --reporter=groupId:artifactId:version` / `ktlint --reporter=/path/to/custom-ktlint-reporter.jar` +(see `ktlint --help` for more). + ## Badge If you use ktlint in your project, consider including a badge in your readme to let people know that your code is checked by ktlint.