forked from duckduckgo/Android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathktlint.gradle
More file actions
31 lines (25 loc) · 804 Bytes
/
Copy pathktlint.gradle
File metadata and controls
31 lines (25 loc) · 804 Bytes
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
/*
* Copyright © 2020 NHSX. All rights reserved.
*/
configurations.create("ktlint")
dependencies {
ktlint "com.pinterest:ktlint:0.36.0"
}
ext.exclusions = "import-ordering, no-wildcard-imports, no-blank-line-before-rbrace"
task("ktlint", type: JavaExec) {
group = "verification"
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
classpath = configurations["ktlint"]
args = ["--disabled_rules=$exclusions", "src/**/*.kt"]
}
task("ktlintFormat", type: JavaExec) {
group = "formatting"
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
classpath = configurations["ktlint"]
args = ["--disabled_rules=$exclusions", "-F", "src/**/*.kt"]
}
afterEvaluate {
tasks["check"].dependsOn("ktlint")
}