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:
parent
d7454341e8
commit
57a75399a2
1 changed files with 20 additions and 14 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue