Refine Spotless configuration to avoid wildcards

pull/1837/head
OTVENTURES\Amal.Sakr 6 months ago committed by OTVENTURES\Amal.Sakr
parent b64f5a7c04
commit c6312a7fdb

@ -33,8 +33,8 @@ rootProject {
apply<com.diffplug.gradle.spotless.SpotlessPlugin>() apply<com.diffplug.gradle.spotless.SpotlessPlugin>()
extensions.configure<com.diffplug.gradle.spotless.SpotlessExtension> { extensions.configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin { kotlin {
target("**/*.kt") target("src/**/*.kt")
targetExclude("**/build/**/*.kt") targetExclude("**/build/**")
ktlint(ktlintVersion).editorConfigOverride( ktlint(ktlintVersion).editorConfigOverride(
mapOf( mapOf(
"android" to "true", "android" to "true",
@ -44,13 +44,13 @@ rootProject {
} }
format("kts") { format("kts") {
target("**/*.kts") target("**/*.kts")
targetExclude("**/build/**/*.kts") targetExclude("**/build/**")
// Look for the first line that doesn't have a block comment (assumed to be the license) // Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)") licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
} }
format("xml") { format("xml") {
target("**/*.xml") target("src/**/*.xml")
targetExclude("**/build/**/*.xml") targetExclude("**/build/**")
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml) // Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])") licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
} }

Loading…
Cancel
Save