My use case is to make sure the properties exposed...
# konsist
m
My use case is to make sure the properties exposed from few classes are of immutable.
m
Not sure if this idea helps, but what about checking those specific types (no matter where they are defined) to be immutable? Something like this?
Copy code
Konsist
            .scopeFromProject()
            .classes()
            .withModifier(KoModifier.DATA)
            .withNameEndingWith("ViewState")
            .assertTrue {
                it.hasAnnotationWithName("Immutable")
            }
m
I.e LiveData vs mutabeLivedata
We don't explicitly add annotation here so unsure if konsist will parse it that way. I will try your code BTW to see how this works
The base class has the information I require but it's internal in the library so can't access it
😕 1