Hi! Starting with konsist in my project where ther...
# konsist
r
Hi! Starting with konsist in my project where there is a module which is not included anywhere. Simple test fails because that un-used module has a ViewModel which ends with "Legacy". Any help on how should i ignore a module? or why Konsist is looking at that module?
Copy code
Konsist.scopeFromProject()
    .classes()
    .withAllParentsOf(ViewModel::class)
    .assertTrue { it.hasNameEndingWith("ViewModel") }
p
There are multiple possibilites to create a scope that decides which files are included (see https://docs.konsist.lemonappdev.com/writing-tests/koscope). You can e.g. create a module based scope like below
Copy code
Konsist.scopeFromModules(listOf("A", "B"))
❤️ 1
r
There is a long list of modules, would be better to add excluded modules
p
Have you tried it with Scope subtraction?
r
Interesting, how can i do that?
p
In the shared docs from above there is a section about scope subtraction. I have not tried it by my self, yet.
r
It works. That is a great help. Thank you 🙏 I'll keep exploring more 😊
👍 3