Skip to content

_bundles_config

rhiza_hooks._bundles_config

Read the project's .rhiza/template.yml configuration.

Helpers for extracting the bits of the rhiza config that the check-template-bundles hook needs: the raw mapping and the declared set of template names. Returning None signals "absent or unusable", which callers treat as "skip validation".

get_config_data(config_path)

Get the configuration from .rhiza/template.yml.

Aliases (repository/ref/profiles) are normalized to their canonical keys so downstream reads of template-repository / template-branch / templates work for both alias and canonical forms.

Parameters:

Name Type Description Default
config_path Path

Path to .rhiza/template.yml

required

Returns:

Type Description
dict[str, Any] | None

Configuration dictionary, or None if file not found or invalid

Source code in rhiza_hooks/_bundles_config.py
def get_config_data(config_path: Path) -> dict[str, Any] | None:
    """Get the configuration from .rhiza/template.yml.

    Aliases (``repository``/``ref``/``profiles``) are normalized to their
    canonical keys so downstream reads of ``template-repository`` /
    ``template-branch`` / ``templates`` work for both alias and canonical forms.

    Args:
        config_path: Path to .rhiza/template.yml

    Returns:
        Configuration dictionary, or None if file not found or invalid
    """
    result = load_yaml_mapping(config_path)
    if isinstance(result, YamlFailure):
        return None
    return normalize_config(result)