KontureFileScope

Represents a scope containing a set of Kotlin files for checking file-level rules.

Constructors

Link copied to clipboard
constructor(files: List<FileDeclaration>)

Types

Link copied to clipboard
object Companion

Factory methods for constructing file scopes.

Properties

Link copied to clipboard

Filter or assertion criteria for files.

Functions

Link copied to clipboard

Asserts that file names in this scope match their primary class names.

Link copied to clipboard
fun KontureFileScope.assertHasKDoc(additionalMessage: String? = null)

Asserts that files in this scope have KDoc documentation.

Link copied to clipboard

Asserts that all file declarations in the scope have names ending with any of the specified suffixes.

Link copied to clipboard

Asserts that all file declarations in the scope have names matching any of the specified glob patterns.

Link copied to clipboard

Asserts that all file declarations in the scope have names starting with any of the specified prefixes.

Link copied to clipboard
fun KontureFileScope.assertNotResideInAModule(modulePath: String, graph: ProjectGraph = Konture.projectGraph)

Filter or assertion criteria for assert not reside in a module.

Link copied to clipboard
fun KontureFileScope.assertNoWildcardImports(additionalMessage: String? = null)

Asserts that no file in this scope contains wildcard imports.

Link copied to clipboard
fun KontureFileScope.assertOnlyOneClassPerFile(additionalMessage: String? = null)

Asserts that files in this scope contain at most one class.

Link copied to clipboard
fun KontureFileScope.assertResideInAModule(modulePath: String, graph: ProjectGraph = Konture.projectGraph)

Filter or assertion criteria for assert reside in a module.

Link copied to clipboard
fun KontureFileScope.assertResideInAPackage(vararg packagePatterns: String)

Asserts that all file declarations in the scope reside in packages matching any of the specified patterns. Matches using standard Kotlin package wildcard matching (e.g. "..domain..").

Link copied to clipboard
fun KontureFileScope.assertTrue(additionalMessage: String? = null, predicate: (FileDeclaration) -> Boolean)

Asserts that all files in this scope satisfy predicate.

Link copied to clipboard

Filters files in this scope to include only those containing class fqName.

Filters files in this scope to include only those containing class type.

Link copied to clipboard

Filter or assertion criteria for have name ending with.

Link copied to clipboard

Filter or assertion criteria for have name starting with.

Link copied to clipboard

Filters this file selector to include files residing in packages matching the specified pattern.

Link copied to clipboard

Filter or assertion criteria for minus.

Link copied to clipboard

Filter or assertion criteria for plus.

Link copied to clipboard

Filter or assertion criteria for reside in a package.

Link copied to clipboard

Returns a fluent assertion scope for sequential assertions on this FileSelector.

Link copied to clipboard

Filters files in this scope to include only those with import matching importPath.

Filters files in this scope to include only those with import of class type.

Link copied to clipboard
fun KontureFileScope.withModule(modulePath: String, graph: ProjectGraph = Konture.projectGraph): KontureFileScope

Filter or assertion criteria for with module.

Link copied to clipboard

Filters this file selector to include files whose names match the specified pattern.

Link copied to clipboard

Filter or assertion criteria for with name matching.