text_lint.linter.states.validator.ValidatorState

class text_lint.linter.states.validator.ValidatorState(linter: Linter)[source]

Bases: StateBase

State for validator operations.

__init__(linter: Linter) None[source]

Initialize ValidatorState instances.

Parameters:

linter (Linter) – The linter instance being encapsulated.

fail(translated_description: str, translated_detail: str) None[source]

Raise an exception indicating an operation has failed.

Parameters:
  • translated_description (str) – A translated description of the failure.

  • translated_detail (str) – Translated details of the failure.

lookup_expression(lookup_expression: LookupExpression) AliasLookupResult[source]

Perform the given lookup expression.

Parameters:

lookup_expression (LookupExpression) – The lookup expression to execute.

Returns:

The calculated lookup result.

Return type:

AliasLookupResult

save(tree: ResultTree) None[source]

Save the given result tree.

Parameters:

tree (ResultTree) – The result tree to save in the result forest.