review.formats.validate(kind, data, where='')
Check data against the table of kind.
Parameters
| 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
|
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`