Ali Kabiri
02/26/2025, 10:23 AMMutableSharedFlow
in my code.
An example in simple words: MutableSharedFlow()
is correct, but MutableSharedFlow(replay = 1)
is incorrect.
To test the filtering of non-default calls, I wrote the following code:
val sut = Konsist.scopeFromProject()
.files
.withTextMatching(""".*MutableSharedFlow.*\(.+\)""".toRegex())
println(sut.size)
However, the result of sut.size
is zero, but there are more than 10 occurrences in my files.
I am curious to know if that is the right way to use regular expressions with Konsist because I couldn't find any examples of it in the docs.
Could anyone help me with using regular expressions and Konsist?Ali Kabiri
02/26/2025, 10:44 AMval regex = Regex(""".*MutableSharedFlow.*\(.+\)""")
val sut = Konsist.scopeFromProject()
.files
.filter { file ->
regex.containsMatchIn(file.text)
}