load_yaml: Rename include directive to jw.include

The include directive was previously triggered by a bare "include"
key in YAML files.  This could collide with user-defined keys.

Rename it to "jw.include" so that:

    jw.include: file.yaml
    jw.include:
      - file1.yaml
      - file2.yaml

is used instead of just "include:".  This follows the convention
established by "jw.link" for link expansion markers.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-07-03 17:10:02 +02:00 • committed by janware DevOps
commit 57a75399a2
Signed by: DevOps
SSH key fingerprint: SHA256:cZiw7ExG5q3KAVm7Jse3rGITowu0VjgUgNMPbifmY8g

View file

@ -72,8 +72,8 @@ def _load_yaml(path: str | Path, optional: bool, seen: set[Path]) -> dict[str, A
if optional:
return {}
raise
includes = _normalize_include_specs(ret.get('include', []), path.parent)
ret.pop('include', None)
includes = _normalize_include_specs(ret.get('jw.include', []), path.parent)
ret.pop('jw.include', None)
included_all: dict[str, Any] = {}
for include in includes:
included_next = _load_yaml(include[1], optional = include[0], seen = seen)