Add Konsist test Class with 'ContributeBinding' annotation should have allowed prefix and fix exissting issues.
Also remove annotation `DefaultPreferences`, we only have one implementation.
This commit is contained in:
parent
f886eab582
commit
3fa508f1fe
12 changed files with 54 additions and 52 deletions
|
|
@ -20,9 +20,11 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
|||
import com.bumble.appyx.core.node.Node
|
||||
import com.lemonappdev.konsist.api.Konsist
|
||||
import com.lemonappdev.konsist.api.ext.list.withAllParentsOf
|
||||
import com.lemonappdev.konsist.api.ext.list.withAnnotationNamed
|
||||
import com.lemonappdev.konsist.api.ext.list.withNameContaining
|
||||
import com.lemonappdev.konsist.api.ext.list.withNameEndingWith
|
||||
import com.lemonappdev.konsist.api.ext.list.withoutName
|
||||
import com.lemonappdev.konsist.api.ext.list.withoutNameStartingWith
|
||||
import com.lemonappdev.konsist.api.verify.assertEmpty
|
||||
import com.lemonappdev.konsist.api.verify.assertTrue
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
|
|
@ -92,4 +94,32 @@ class KonsistClassNameTest {
|
|||
.withoutName("MediaUploadHandlerImpl")
|
||||
.assertEmpty(additionalMessage = "Class implementing interface should have name not end with 'Impl' but start with 'Default'")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Class with 'ContributeBinding' annotation should have allowed prefix`() {
|
||||
Konsist.scopeFromProject()
|
||||
.classes()
|
||||
.withAnnotationNamed("ContributesBinding")
|
||||
.withoutName(
|
||||
"Factory",
|
||||
"TimelineController",
|
||||
)
|
||||
.withoutNameStartingWith(
|
||||
"Accompanist",
|
||||
"AES",
|
||||
"Android",
|
||||
"Database",
|
||||
"DBov",
|
||||
"Default",
|
||||
"DataStore",
|
||||
"FileExtensionExtractor",
|
||||
"KeyStore",
|
||||
"Matrix",
|
||||
"Noop",
|
||||
"Preferences",
|
||||
"Rust",
|
||||
"SharedPreferences",
|
||||
)
|
||||
.assertEmpty()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue