mustNot

abstract fun <T : KoBaseProvider> List<T>.mustNot(predicate: (T) -> Boolean)(source)

Rejects the elements of this list that predicate answers true for.

The exact inverse of must, written separately because must { !it.hasX } reads as a double negative at the call site and the report cannot tell the two apart.

Example 1: no use case depends on the Android framework

"does not depend on Android".konsist {
files.mustNot { file -> file.imports.any { it.name.startsWith("android.") } }
}

Parameters

predicate

what must not hold. true rejects the element, false keeps it.