SlicesShould

Assertions that the slices derived by SlicesRuleBuilder must satisfy.

Constructors

Link copied to clipboard
constructor(builder: SlicesRuleBuilder)

Functions

Link copied to clipboard
fun allOf(vararg blocks: SlicesShould.() -> Unit): SlicesRuleBuilder

Asserts that slices satisfy all assertion blocks in blocks.

Link copied to clipboard
fun anyOf(vararg blocks: SlicesShould.() -> Unit): SlicesRuleBuilder

Asserts that slices satisfy at least one assertion block in blocks.

Link copied to clipboard

Asserts that the slices have no cyclic dependencies between them. Each detected cycle is reported as a path, e.g. payment -> billing -> payment.

Link copied to clipboard

Asserts that slices contain classes.

Link copied to clipboard

Asserts that slices contain classes in package matching packagePattern.

Asserts that slices contain classes in packages matching packagePatterns.

fun containClassesInPackage(vararg packagePatterns: String): SlicesRuleBuilder

Asserts that slices contain classes in packages matching vararg packagePatterns.

Link copied to clipboard

Asserts that slices contain classes with annotation annotationFqName.

Asserts that slices contain classes with annotations annotationFqNames.

Asserts that slices contain classes with annotation annotation.

fun containClassesWithAnnotation(vararg annotationFqNames: String): SlicesRuleBuilder

Asserts that slices contain classes with vararg annotations annotationFqNames.

Link copied to clipboard

Asserts that slices contain classes with annotation type parameter T.

Link copied to clipboard

Asserts that slices contain files.

Link copied to clipboard

Asserts that all classes in matching slices have one of the specified visibilities.

Link copied to clipboard

Asserts that all top-level functions in matching slices have one of the specified visibilities.

Link copied to clipboard

Asserts that all top-level properties in matching slices have one of the specified visibilities.

Link copied to clipboard
infix fun dependOnSlice(requiredSliceKey: String): SlicesRuleBuilder

Asserts that slices depend on the specified required slice.

Link copied to clipboard
infix fun dependOnSlices(requiredSliceKeys: List<String>): SlicesRuleBuilder

Asserts that slices depend on required slices in requiredSliceKeys.

fun dependOnSlices(vararg requiredSliceKeys: String): SlicesRuleBuilder

Asserts that slices depend on all specified required slices.

Link copied to clipboard
infix fun haveName(namePattern: String): SlicesRuleBuilder

Asserts that slices have key matching namePattern.

Link copied to clipboard
fun noneOf(vararg blocks: SlicesShould.() -> Unit): SlicesRuleBuilder

Asserts that slices satisfy none of the assertion blocks in blocks.

Link copied to clipboard

Fails for every call usage matching fqName in any file contained in the selected slices.

Fails for every call usage matching class kClass in any file contained in the selected slices.

Link copied to clipboard
inline fun <reified T : Any> SlicesShould.notCall(): SlicesRuleBuilder

Asserts that slices do not call members of type parameter T.

Link copied to clipboard

Asserts that slices do not contain class fqName.

Asserts that slices do not contain class type.

Link copied to clipboard

Asserts that slices do not contain the class specified by type parameter T.

Link copied to clipboard

Asserts that slices do not contain classes.

Link copied to clipboard

Asserts that slices do not contain classes in package matching packagePattern.

Link copied to clipboard

Asserts that slices do not contain classes with annotation annotationFqName.

Asserts that slices do not contain classes with annotation annotation.

Link copied to clipboard

Asserts that slices do not contain classes annotated with annotation type parameter T.

Link copied to clipboard

Asserts that slices do not contain files.

Link copied to clipboard

Asserts that no slice depends on any other slice — enforcing complete isolation between them. Every inter-slice dependency is reported.

Link copied to clipboard
infix fun notDependOnSlice(forbiddenSliceKey: String): SlicesRuleBuilder

Asserts that slices do not depend on the specified forbidden slice.

Link copied to clipboard
infix fun notDependOnSlices(forbiddenSliceKeys: List<String>): SlicesRuleBuilder
fun notDependOnSlices(vararg forbiddenSliceKeys: String): SlicesRuleBuilder

Asserts that slices do not depend on any of the specified forbidden slices.

Link copied to clipboard
infix fun notHaveName(namePattern: String): SlicesRuleBuilder

Asserts that slices do not have key matching namePattern.

Link copied to clipboard

Fails for every class reference usage matching fqName in any file contained in the selected slices.

Fails for every class reference usage matching kClass in any file contained in the selected slices.

Link copied to clipboard

Asserts that slices do not reference class type parameter T.

Link copied to clipboard

Asserts that slices do not reside in module modulePath.

Link copied to clipboard

Asserts that slices do not reside in modules modulePaths.

fun notResideInModules(vararg modulePaths: String): SlicesRuleBuilder

Asserts that slices do not reside in vararg modules modulePaths.

Link copied to clipboard

Asserts that slices depend only on the specified allowed slices.

fun onlyDependOnSlices(vararg allowedSliceKeys: String): SlicesRuleBuilder

Asserts that slices depend only on the specified allowed slices vararg.

Link copied to clipboard
infix fun resideInModule(modulePath: String): SlicesRuleBuilder

Asserts that slices reside in module modulePath.

Link copied to clipboard
infix fun resideInModules(modulePaths: List<String>): SlicesRuleBuilder

Asserts that slices reside in modules modulePaths.

fun resideInModules(vararg modulePaths: String): SlicesRuleBuilder

Asserts that slices reside in vararg modules modulePaths.

Link copied to clipboard
infix fun satisfy(description: String): SlicesRuleBuilder

Asserts that slices satisfy custom description description.

fun satisfy(id: String, description: String? = null, predicate: SatisfyContext<List<Slice>>.(List<Slice>) -> Boolean): SlicesRuleBuilder

Asserts that the derived slices satisfy a custom predicate within a SatisfyContext block identified by id and optional description.