From 63c12a634813169876333bf7cfabf6aea8c31340 Mon Sep 17 00:00:00 2001 From: cartland Date: Wed, 1 Oct 2025 10:02:11 -0700 Subject: [PATCH 1/2] Apply Spotless to root project and exclude spotless dir Apply the Spotless configuration to `allprojects` instead of `subprojects` so that the root project is also included. Exclude the `spotless/` directory from Kotlin and XML formatting to prevent the license header from being applied to itself. --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index bafd85c4..cc4d7876 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,12 +16,12 @@ plugins { alias(libs.plugins.spotless) apply false } -subprojects { +allprojects { apply(plugin = "com.diffplug.spotless") extensions.configure { kotlin { target("**/*.kt") - targetExclude("**/build/**/*.kt") + targetExclude("**/build/**/*.kt", "spotless/**/*.kt") val disabledRules = arrayOf( // These rules were introduced in ktlint 0.46.0 and should not be @@ -91,7 +91,7 @@ subprojects { } format("xml") { target("**/*.xml") - targetExclude("**/build/**/*.xml") + targetExclude("**/build/**/*.xml", "spotless/**/*.xml") // Look for the root tag or a tag that is a snippet licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[a-zA-Z])|( @@ -110,4 +126,4 @@ - \ No newline at end of file +