forked from opensrp/fhircore
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathktlint.gradle.kts
42 lines (38 loc) · 1.36 KB
/
ktlint.gradle.kts
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
39
40
41
42
val ktlint by configurations.creating
val ktlintCheck by tasks.registering(JavaExec::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check Kotlin code style"
classpath = ktlint
mainClass.set("com.pinterest.ktlint.Main")
// see https://pinterest.github.io/ktlint/install/cli/#command-line-usage for more information
args(
"--editorconfig=../ktlint.editorconfig",
"**/*.kt",
"**/*.kts"
)
}
tasks.register<JavaExec>("ktlintFormat") {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check Kotlin code style and format"
classpath = 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",
"**/*.kt",
"**/*.kts"
)
}
tasks.register<JavaExec>("ktlintGenerateEditorConfig") {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check Kotlin code style and format"
classpath = 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(
"generateEditorConfig",
"--code-style=ktlint_official"
)
}