Merge pull request #5503 from element-hq/feature/bma/immutableCleanup

Do some cleanup on our immutable annotation usage
This commit is contained in:
Benoit Marty 2025-10-10 17:42:26 +02:00 committed by GitHub
commit 3fb110d991
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
73 changed files with 178 additions and 107 deletions

View file

@ -7,8 +7,12 @@
package io.element.android.tests.konsist
import androidx.compose.runtime.Immutable
import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.withAnnotationOf
import com.lemonappdev.konsist.api.ext.list.withNameEndingWith
import com.lemonappdev.konsist.api.ext.list.withoutName
import com.lemonappdev.konsist.api.verify.assertEmpty
import com.lemonappdev.konsist.api.verify.assertFalse
import org.junit.Test
@ -60,4 +64,14 @@ class KonsistImmutableTest {
it.text.contains(".toPersistentMap()")
}
}
@Test
fun `Immutable annotation is not used on sealed interface for Presenter Events`() {
Konsist
.scopeFromProduction()
.interfaces()
.withNameEndingWith("Events")
.withAnnotationOf(Immutable::class)
.assertEmpty()
}
}