From 14a0ba41748218e77568d68d9ca62644df4de891 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 25 Aug 2026 20:09:55 +0200 Subject: [PATCH] load_yaml: Document block-list form of optional marker The optional marker is a leading dash in the include spec, but in a YAML block list the leading dash is the list syntax and is consumed by the YAML parser before load_yaml() sees the spec. An include written as a plain list item "- file" is therefore required, not optional, and a missing file raises, even though the dash reads like the optional marker. Note in the module docstring that in a block list the item itself must carry the marker, as in "- -file.yaml" or the quoted form "- "-file.yaml"". Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2 Signed-off-by: Jan Lindemann --- src/python/jw/util/load_yaml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python/jw/util/load_yaml.py b/src/python/jw/util/load_yaml.py index a4c3f3c..eead98d 100644 --- a/src/python/jw/util/load_yaml.py +++ b/src/python/jw/util/load_yaml.py @@ -6,7 +6,9 @@ supports three extensions: - ``jw.include`` — deep-merges other YAML files into the document, either at the root or at a dot-separated target path. A leading ``-`` marks the include as optional (a missing file contributes - nothing). File names may use glob characters (``*``, ``?``, + nothing). In a YAML block list the list dash is not the marker; + the item itself must carry it, as in ``- -file.yaml`` or + ``- "-file.yaml"``. File names may use glob characters (``*``, ``?``, ``[...]``); all matches are included in lexical order, and a non-optional glob that matches no files raises ValueError. A spec that starts with a glob character such as ``*`` or ``[`` must be