-
Notifications
You must be signed in to change notification settings - Fork 0
/
ktlint.gradle
32 lines (27 loc) · 882 Bytes
/
ktlint.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* See https://github.com/pinterest/ktlint#usage for more
*/
configurations {
ktlint
}
dependencies {
ktlint 'com.pinterest:ktlint:0.36.0'
// additional 3rd party ruleset(s) can be specified here
// just add them to the classpath (ktlint 'groupId:artifactId:version') and
// ktlint will pick them up
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt",
"--reporter=plain",
"--reporter=json,output=${buildDir}/reports/ktlint/ktlint.json"
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}