build(build-logic): fix Spotless targets for Kotlin scripts

The current Spotless configuration for Kotlin scripts uses multiple target() calls. According to the Spotless Javadoc: "When this method is called multiple times, only the last call has any effect."

Consequently, only files in 'build-logic/convention/*.kts' were being formatted, while root and 'build-logic' scripts were ignored.

This commit consolidates all patterns into a single target() call to ensure all intended Kotlin scripts are properly tracked.
pull/2094/head
Daniil Kamanin 4 days ago
parent d6abd6d3e5
commit bca801dced

@ -49,9 +49,7 @@ internal fun Project.configureSpotlessForRootProject() {
endWithNewline()
}
format("kts") {
target("*.kts")
target("build-logic/*.kts")
target("build-logic/convention/*.kts")
target("*.kts", "build-logic/*.kts", "build-logic/convention/*.kts")
// Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile(rootDir.resolve("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
endWithNewline()

Loading…
Cancel
Save