_bundles_validate¶
rhiza_hooks._bundles_validate
¶
Structural validation of a template-bundles document.
These functions operate on an already-loaded mapping (see
:mod:rhiza_hooks._bundles_fetch for how the document is obtained) and report
problems as lists of human-readable error strings. They never perform I/O,
except :func:validate_template_bundles, which is a thin convenience wrapper
that loads a local file and then validates it.
validate_selected_bundles(templates, bundles, missing_message)
¶
Validate that each requested template exists in bundles and is well-formed.
Shared by the local-file and remote-fetch paths; they differ only in the
"not found" wording, supplied via missing_message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
templates
|
set[str]
|
Template names requested in the rhiza config. |
required |
bundles
|
dict[Any, Any]
|
The |
required |
missing_message
|
Callable[[str], str]
|
Builds the error string for a template absent from |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
List of error messages (empty if every requested template is valid). |
Source code in rhiza_hooks/_bundles_validate.py
validate_template_bundles(bundles_path, templates_to_check=None)
¶
Validate template bundles configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bundles_path
|
Path
|
Path to template-bundles.yml |
required |
templates_to_check
|
set[str] | None
|
Optional set of template names to validate. If None, validate all. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[bool, list[str]]
|
Tuple of (success, error_messages) |
Source code in rhiza_hooks/_bundles_validate.py
validate_top_level_fields(data)
¶
Validate required top-level fields.