-
Notifications
You must be signed in to change notification settings - Fork 265
Remove the need to have separate spotless config #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,35 @@ plugins { | |
| alias(libs.plugins.crashlytics) apply false | ||
| alias(libs.plugins.android.test) apply false | ||
| alias(libs.plugins.baselineprofile) apply false | ||
| alias(libs.plugins.spotless) apply false | ||
| } | ||
|
|
||
|
|
||
| subprojects { | ||
| apply(plugin = "com.diffplug.spotless") | ||
| extensions.configure<com.diffplug.gradle.spotless.SpotlessExtension> { | ||
| kotlin { | ||
| target("**/*.kt") | ||
| targetExclude("**/build/**/*.kt") | ||
| ktlint(libs.versions.ktlint.get()).editorConfigOverride( | ||
| mapOf( | ||
| "android" to "true", | ||
| "ktlint_standard_property-naming" to "disabled" | ||
| ), | ||
| ) | ||
| licenseHeaderFile(rootProject.file("spotless/copyright.kt")) | ||
| } | ||
| kotlinGradle { | ||
| target("**/*.kts") | ||
| targetExclude("**/build/**/*.kts") | ||
| // Look for the first line that doesn't have a block comment (assumed to be the license) | ||
| licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can reuse the license config for both kt and kts files. ktlint() should also be applied for kts. |
||
| } | ||
| format("xml") { | ||
| target("**/*.xml") | ||
| targetExclude("**/build/**/*.xml") | ||
| // Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml) | ||
| licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])") | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -38,6 +38,7 @@ ksp = "2.1.20-1.0.32" | |||||
| kotlinxCoroutines = "1.10.2" | ||||||
| kotlinxSerialization = "2.1.20" | ||||||
| kotlinxSerializationJson = "1.8.1" | ||||||
| ktlint = "1.5.0" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, this could be refed by a dependency, so that the version will be tracked and updated by automatons like @renovate-bot. |
||||||
| lifecycleRuntimeKtx = "2.8.7" | ||||||
| lifecycleViewmodelNavigation3 = "1.0.0-SNAPSHOT" | ||||||
| loggingInterceptor = "5.0.0-alpha.14" | ||||||
|
|
@@ -49,6 +50,7 @@ poseDetection = "18.0.0-beta5" | |||||
| profileinstaller = "1.4.1" | ||||||
| retrofit = "2.11.0" | ||||||
| robolectric = "4.14.1" | ||||||
| spotless = "7.0.2" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| startup = "1.2.0" | ||||||
| runner = "1.6.2" | ||||||
| uiTextGoogleFonts = "1.8.0" | ||||||
|
|
@@ -142,3 +144,4 @@ serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref | |||||
| android-test = { id = "com.android.test", version.ref = "agp" } | ||||||
| baselineprofile = { id = "androidx.baselineprofile", version.ref = "baselineprofile" } | ||||||
| composeScreenshot = { id = "com.android.compose.screenshot", version = "0.0.1-alpha09" } | ||||||
| spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule looks invalid for now.