Skip to content

validate

trestle.core.commands.validate ¤

Trestle Validate Command.

Attributes¤

logger = logging.getLogger(__name__) module-attribute ¤

Classes¤

ValidateCmd ¤

Bases: CommandPlusDocs

Validate contents of a trestle model in different modes.

Source code in trestle/core/commands/validate.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class ValidateCmd(CommandPlusDocs):
    """Validate contents of a trestle model in different modes."""

    name = ARG_VALIDATE

    def _init_arguments(self) -> None:
        vfact.init_arguments(self)

    def _run(self, args: argparse.Namespace) -> int:
        try:
            log.set_log_level_from_args(args)

            mode_args = argparse.Namespace(mode=VAL_MODE_ALL)
            validator = vfact.validator_factory.get(mode_args)

            return validator.validate(args)
        except Exception as e:  # pragma: no cover
            return handle_generic_command_exception(e, logger, 'Error while validating contents of a trestle model')
Attributes¤
name = ARG_VALIDATE class-attribute instance-attribute ¤

Functions¤

handler: python