-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
52 lines (51 loc) · 2.22 KB
/
build.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
43
44
45
46
47
48
49
50
51
52
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.android.junit5) apply false
alias(libs.plugins.android.hilt) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.kotlin.serialization) apply false
}
allprojects {
if (this == rootProject) {
return@allprojects
}
apply<com.diffplug.gradle.spotless.SpotlessPlugin>()
extensions.configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**/*.kt")
ktlint("0.46.1").editorConfigOverride(
mapOf(
"ktlint_code_style" to "android",
"ij_kotlin_allow_trailing_comma" to true,
"max_line_length" to "120",
// These rules were introduced in ktlint 0.46.0 and should not be
// enabled without further discussion. They are disabled for now.
// See: https://github.com/pinterest/ktlint/releases/tag/0.46.0
"disabled_rules" to
"filename," +
"annotation,annotation-spacing," +
"argument-list-wrapping," +
"double-colon-spacing," +
"enum-entry-name-case," +
"multiline-if-else," +
"no-empty-first-line-in-method-block," +
"package-name," +
"trailing-comma," +
"spacing-around-angle-brackets," +
"spacing-between-declarations-with-annotations," +
"spacing-between-declarations-with-comments," +
"unary-op-spacing"
)
)
licenseHeaderFile(rootProject.file("copyright.kt"))
}
format("kts") {
target("**/*.kts")
targetExclude("**/build/**/*.kts")
licenseHeaderFile(rootProject.file("copyright.kt"), "(^(?![\\/ ]\\*).*$)")
}
}
}