refactor(build): update Spotless config (#2516)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
pull/2517/head
James Rich 2025-07-23 14:45:46 -05:00 zatwierdzone przez GitHub
rodzic 35f5779483
commit c61d31c3b8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 14 dodań i 38 usunięć

Wyświetl plik

@ -118,18 +118,8 @@ android {
create("google") {
dimension = "default"
// Enable Firebase Crashlytics for Google Play builds
apply(
plugin =
libs.plugins.google.services
.get()
.pluginId,
)
apply(
plugin =
libs.plugins.firebase.crashlytics
.get()
.pluginId,
)
apply(plugin = libs.plugins.google.services.get().pluginId)
apply(plugin = libs.plugins.firebase.crashlytics.get().pluginId)
versionName = "${Configs.VERSION_NAME_BASE} ($versionCode) google"
}
}
@ -140,10 +130,7 @@ android {
}
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
named("debug") { isPseudoLocalesEnabled = true }
}
@ -178,12 +165,7 @@ kotlin {
// per protobuf-gradle-plugin docs, this is recommended for android
protobuf {
protoc {
artifact =
libs.protobuf.protoc
.get()
.toString()
}
protoc { artifact = libs.protobuf.protoc.get().toString() }
generateProtoTasks {
all().forEach { task ->
task.builtins {
@ -282,8 +264,8 @@ detekt {
val googleServiceKeywords = listOf("crashlytics", "google")
tasks.configureEach {
if (googleServiceKeywords.any { name.contains(it, ignoreCase = true) } &&
name.contains("fdroid", ignoreCase = true)
if (
googleServiceKeywords.any { name.contains(it, ignoreCase = true) } && name.contains("fdroid", ignoreCase = true)
) {
project.logger.lifecycle("Disabling task for F-Droid: $name")
enabled = false
@ -295,13 +277,13 @@ spotless {
kotlin {
target("src/*/kotlin/**/*.kt", "src/*/java/**/*.kt")
targetExclude("**/build/**/*.kt")
ktfmt()
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) }
ktlint("1.7.1").setEditorConfigPath("../config/spotless/.editorconfig")
licenseHeaderFile(rootProject.file("config/spotless/copyright.txt"))
}
kotlinGradle {
target("**/*.gradle.kts")
ktfmt()
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) }
ktlint("1.7.1").setEditorConfigPath("../config/spotless/.editorconfig")
}
}

Wyświetl plik

@ -1,15 +1,9 @@
[*.{kt,kts}]
ktlint_code_style = ktlint_official
ktlint_standard = enabled
ktlint_experimental = enabled
ktlint_custom_rule-set = enabled
ktlint_function_naming_ignore_when_annotated_with = Composable
root = true
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
ij_kotlin_packages_to_use_import_on_demand = unset
[*]
insert_final_newline = true
insert_final_newline = true
max_line_length=120
[*.{kt,kts}]
ktlint_code_style = intellij_idea
ktlint_function_naming_ignore_when_annotated_with = Composable