Use patched Konsist version (forked, 0.18.0) (#7719)

* Use a patched fork of Konsist

The patch contains code to ignore hidden folders in the root project: by default, Konsist scans *every single file* in the root directory except for a few exceptions, and hidden folders were not a part of that.

That means `.git`, `.github`, etc. would be scanned to for no good reason and even worse,  hidden folders used for worktrees would get scanned too, so Konsist would end up scanning the same project with small variations several times and OOMing / taking ages to finish.

* Make `Immutable/Stable` annotation check more performant. Also, fix case that was previously not found
This commit is contained in:
Jorge Martin Espinosa
2026-09-16 11:27:44 +02:00
committed by GitHub
parent 35af1fca48
commit c3f128b6f0
4 changed files with 6 additions and 8 deletions
@@ -107,6 +107,7 @@ sealed interface LoadedDetails {
) : LoadedDetails
}
@Immutable
sealed interface JoinAuthorisationStatus {
data object None : JoinAuthorisationStatus
data class IsInvited(val inviteData: InviteData, val inviteSender: InviteSender?) : JoinAuthorisationStatus
+1 -1
View File
@@ -168,7 +168,7 @@ test_arch_core = "androidx.arch.core:core-testing:2.2.0"
test_junit = "junit:junit:4.13.2"
test_runner = "androidx.test:runner:1.7.0"
test_mockk = "io.mockk:mockk:1.14.11"
test_konsist = "com.lemonappdev:konsist:0.17.3"
test_konsist = "com.github.jmartinesp:konsist:0.18.0"
test_turbine = "app.cash.turbine:turbine:1.2.1"
test_truth = "com.google.truth:truth:1.4.5"
test_parameter_injector = "com.google.testparameterinjector:test-parameter-injector:1.22"
+2
View File
@@ -23,6 +23,8 @@ dependencyResolutionManagement {
includeModule("com.github.matrix-org", "matrix-analytics-events")
// Required transitively by androidx.media3:media3-exoplayer-midi for MIDI playback.
includeModule("com.github.philburk", "jsyn")
// This is a fork of Konsist that skips hidden folders and files, which otherwise can cause performance issues.
includeModule("com.github.jmartinesp", "konsist")
}
}
// Check for official Android-related packages only in Google's maven repo
@@ -76,6 +76,7 @@ class KonsistArchitectureTest {
.withSealedModifier()
.withoutAnnotationOf(Immutable::class, Stable::class)
.map { it.fullyQualifiedName }
.toSet()
Konsist.scopeFromProject()
.functions()
.withAnnotationOf(Composable::class)
@@ -85,13 +86,7 @@ class KonsistArchitectureTest {
return@all if (type.startsWith("@") || type.contains("->") || type.startsWith("suspend")) {
true
} else {
val typePackage = param.type.sourceDeclaration?.let { declaration ->
declaration.asTypeParameterDeclaration()?.packagee
?: declaration.asExternalDeclaration()?.packagee
?: declaration.asClassOrInterfaceDeclaration()?.packagee
?: declaration.asKotlinTypeDeclaration()?.packagee
?: declaration.asObjectDeclaration()?.packagee
}?.name
val typePackage = param.type.packagee?.name
if (typePackage == null) {
false
} else {