Capabilities / Validation

ValidationResult

class teksi_hooks.capabilities.validation.ValidationResult(_findings=<factory>)[source]

Collects validation findings produced during hook execution.

The internal finding list is mutable so validators can append findings. Consumers receive an immutable tuple through the findings property.

Parameters:

_findings (list[ValidationFinding])

property findings: tuple[ValidationFinding, ...]

Return collected validation findings as an immutable tuple.

add(severity, message)[source]

Add a validation finding.

Parameters:
  • severity (Severity)

  • message (str)

Return type:

None

error(message)[source]

Add an error finding.

Parameters:

message (str)

Return type:

None

warning(message)[source]

Add a warning finding.

Parameters:

message (str)

Return type:

None

info(message)[source]

Add an informational finding.

Parameters:

message (str)

Return type:

None

has(severity)[source]

Return whether at least one finding with the given severity exists.

Parameters:

severity (Severity)

Return type:

bool

property has_errors: bool

Return whether at least one error finding exists.

Fields

_findings

Type: list[ValidationFinding]