Refrain from running spotless on weblate files

Those are akin to generated files and are likely to not follow our formatting

(cherry picked from commit 32d2c2ac1bc224cbda2f09a4023d7d120ea0e954)

# Conflicts:
#	buildSrc/src/main/kotlin/mihon.code.lint.gradle.kts
This commit is contained in:
AntsyLich 2024-10-13 23:02:35 +06:00 committed by Jobobby04
parent db907cf270
commit cde3002355

View File

@ -6,6 +6,18 @@ plugins {
val libs = the<LibrariesForLibs>() val libs = the<LibrariesForLibs>()
val xmlFormatExclude = buildList(2) {
add("**/build/**/*.xml")
projectDir
.resolve("src/commonMain/moko-resources")
.takeIf { it.isDirectory }
?.let(::fileTree)
?.matching { exclude("/base/**") }
?.let(::add)
}
.toTypedArray()
spotless { spotless {
kotlin { kotlin {
target("**/*.kt", "**/*.kts") target("**/*.kt", "**/*.kts")
@ -27,9 +39,7 @@ spotless {
} }
format("xml") { format("xml") {
target("**/*.xml") target("**/*.xml")
targetExclude("**/build/**/*.xml") targetExclude(*xmlFormatExclude)
// weblate seems to have its own line endings
targetExclude("**/moko-resources/**/*.xml")
trimTrailingWhitespace() trimTrailingWhitespace()
endWithNewline() endWithNewline()
} }