Created
June 10, 2019 10:46
-
-
Save photizzo/a5a22cb2c4d280fb706fd4234707c1c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repositories { | |
jcenter() | |
} | |
configurations { | |
ktlint | |
} | |
dependencies { | |
ktlint "com.pinterest:ktlint:0.33.0" | |
// additional 3rd party ruleset(s) can be specified here | |
// just add them to the classpath (e.g. ktlint 'groupId:artifactId:version') and | |
// ktlint will pick them up | |
} | |
task ktlint(type: JavaExec, group: "verification") { | |
description = "Check Kotlin code style." | |
classpath = configurations.ktlint | |
main = "com.pinterest.ktlint.Main" | |
args "src/**/*.kt" | |
// to generate report in checkstyle format prepend following args: | |
// "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml" | |
// see https://github.com/pinterest/ktlint#usage for more | |
} | |
check.dependsOn ktlint | |
task ktlintFormat(type: JavaExec, group: "formatting") { | |
description = "Fix Kotlin code style deviations." | |
classpath = configurations.ktlint | |
main = "com.pinterest.ktlint.Main" | |
args "-F", "src/**/*.kt" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment