-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathktlint.gradle
executable file
·38 lines (33 loc) · 1.07 KB
/
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
33
34
35
36
37
38
repositories {
mavenCentral()
}
configurations {
ktlint
}
dependencies {
ktlint('com.pinterest:ktlint:0.50.0') {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
}
}
tasks.register("ktlint", JavaExec) {
group = "QuoteUnquote"
description = "Check Kotlin code style."
classpath = configurations.ktlint
mainClass.set('com.pinterest.ktlint.Main')
// see https://pinterest.github.io/ktlint/install/cli/#command-line-usage for more information
args "src/**/*.kt", "**.kts", "!**/build/**"
}
tasks.named("check") {
dependsOn tasks.named("ktlint")
}
tasks.register("ktlintFormat", JavaExec) {
group = "QuoteUnquote"
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
mainClass.set('com.pinterest.ktlint.Main')
jvmArgs "--add-opens=java.base/java.lang=ALL-UNNAMED"
// see https://pinterest.github.io/ktlint/install/cli/#command-line-usage for more information
args "-F", "src/**/*.kt", "**.kts", "!**/build/**"
}