should

Asserts rules on filtered classes using a lambda block that provides a ClassDeclarationShouldContext receiver.

This function supports both:

  1. Imperative assertions: blocks containing explicit checks or assertions (e.g. assertAnnotationOf("MyAnnotation")).

  2. Declarative matching: blocks returning a Boolean predicate (e.g. isInterface). If the block returns false, a violation is recorded automatically.

Return

This ClassesRuleBuilder with the assertion registered.

Parameters

assertion

The assertion block containing class validation rules or boolean predicate.


Asserts rules on filtered files using a lambda block that provides a FileDeclarationShouldContext receiver. Supports both imperative assertions and Boolean predicate matches.

Return

This FilesRuleBuilder with the assertion block registered.

Parameters

assertion

The assertion block containing file validation rules or boolean predicate.


Asserts rules on filtered functions using a lambda block that provides a FunctionDeclarationShouldContext receiver. Supports both imperative assertions and Boolean predicate matches.

Return

This FunctionsRuleBuilder with the assertion block registered.

Parameters

assertion

The assertion block containing function validation rules or boolean predicate.


Asserts rules on filtered modules using a lambda block that provides a ModuleShouldContext receiver. Supports both imperative assertions and Boolean predicate matches.

Return

This ModulesRuleBuilder with the assertion block registered.

Parameters

assertion

The assertion block containing module validation rules or boolean predicate.


Asserts rules on filtered properties using a lambda block that provides a PropertyDeclarationShouldContext receiver. Supports both imperative assertions and Boolean predicate matches.

Return

This PropertiesRuleBuilder with the assertion block registered.

Parameters

assertion

The assertion block containing property validation rules or boolean predicate.