-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for 3rd-party reporters? #45
Comments
Would it work for you if I directly support https://github.com/mcassiano/ktlint-html-reporter (with the author's permission of course) as reporter for I could make it extensible with providers the way rule sets are, but I suspect it is a less common use case and I'm shooting for "simply works out of the box" for the most part with this gradle plugin. |
That would work for me, and I think it makes sense in this case. An html reporter would be super useful out of the box. |
Guys, dependencies {
ktlint "com.github.shyiko:ktlint:0.20.0"
ktlint "com.github.mcassiano:ktlint-html-reporter:master-SNAPSHOT"
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args "--reporter=html", "src/**/*.kt" # notice that no artifact=... is needed
} should work (same applies to Maven). By extension, https://github.com/jeremymailen/kotlinter-gradle#custom-rules can be used for the same purpose. |
Hey! I was going to publish this later on but there were some things I was trying to investigate further. I'm not sure I was doing something wrong but loading the reporter from jar was not working. My guess is that in line 378 the wrong id is being used to query the map (it's using the id passed on as an argument, which in this case is a path), when it should be using What I did to use this in a project was loading the jar as a ruleset (it only loads the jar) and then passing |
Oh, I see, you fixed the bug! Nice. |
Thanks! Configuring it now, and I'm considering elaborating on the solution to allow for a single report for all source sets, and/or a single report for multiple modules. Just to make configuring Jenkins a bit easier. Will update you if that ever happens :) |
See pinterest/ktlint#176.
The text was updated successfully, but these errors were encountered: