Skip to main content

review.formats.validate

review.formats.validate(kind, data, where='')

Check data against the table of kind.

Parameters

Name Type Description Default
kind str One of KINDS. required
data dict[str, object] The parsed or the built file, with format or without it. required
where str A prefix for messages, usually the file name. ''

Raises

Name Type Description
ConfigurationError If the kind is unknown, or a key is missing, unknown or of the wrong type, or a word is outside its vocabulary.

Examples

from babregen._tools import ConfigurationError
from babregen.review.formats import validate

try:
    validate("proposal-check", {"run": "x", "colour": "red"})
except ConfigurationError as exc:
    print(exc)
proposal-check: unknown key `colour`