text_lint.schema.Schema

class text_lint.schema.Schema(schema_path: str, interpolate: bool)[Quellcode]

Bases: object

A text file schema file.

__init__(schema_path: str, interpolate: bool) None[Quellcode]

Initialize Schema instances.

Parameter:
  • schema_path (str) – The path to file containing the schema YAML.

  • interpolate (bool) – Controls rendering of environment variables.

create_exception(description: str, operation_definition: AliasYamlOperation | None = None) SchemaError[Quellcode]

Create a properly formatted schema error exception.

Parameter:
  • description (str) – A description of the schema error encountered.

  • operation_definition (AliasYamlOperation | None) – Any YAML config associated with the error.

Rückgabe:

The exception instance.

Rückgabetyp:

SchemaError

load_assertions() List[AssertionBase][Quellcode]

Create assertion operations from the schema’s YAML content.

Rückgabe:

A list of assertion operation instances.

Rückgabetyp:

List[AssertionBase]

load_validators() List[ValidatorBase][Quellcode]

Create validator operations from the schema’s YAML content.

Rückgabe:

A list of validator operation instances.

Rückgabetyp:

List[ValidatorBase]