-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
57 lines (49 loc) · 1.32 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
53
54
55
56
57
import com.diffplug.gradle.spotless.FormatExtension
plugins {
id("dependency-update")
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.kotlinx.serialization) apply false
alias(libs.plugins.spotless)
}
installGitHooks()
allprojects {
group = "moe.sdl.commons"
version = "0.2.0"
repositories {
mavenCentral()
google()
}
}
spotless {
fun FormatExtension.excludes() {
targetExclude("**/build/", "**/generated/", "**/resources/")
}
fun FormatExtension.common() {
trimTrailingWhitespace()
lineEndings = com.diffplug.spotless.LineEnding.UNIX
endWithNewline()
}
val ktlintConfig = mapOf(
"ij_kotlin_allow_trailing_comma" to "true",
"ij_kotlin_allow_trailing_comma_on_call_site" to "true",
"trailing-comma-on-declaration-site" to "true",
"trailing-comma-on-call-site" to "true",
"ktlint_standard_no-wildcard-imports" to "disabled",
"ktlint_standard_filename" to "disabled",
"ktlint_disabled_import-ordering" to "disabled",
)
kotlin {
target("**/*.kt")
indentWithSpaces(2)
excludes()
common()
ktlint(libs.versions.ktlint.get()).editorConfigOverride(ktlintConfig)
}
kotlinGradle {
target("**/*.gradle.kts")
indentWithSpaces(2)
excludes()
common()
ktlint(libs.versions.ktlint.get()).editorConfigOverride(ktlintConfig)
}
}