The diff self-test constructs its args object by hand as a types.SimpleNamespace with a hardcoded field list (tests/build_scripts/build_diff.py:124), separate from the build subparser. Because it bypasses argparse, it does not inherit argparse's defaults — so every time a new build flag is added, it's absent on this object until someone remembers to add it manually.
This already bit us: the PDF quality-gate flags (--no-check-glyphs / --check-overflow / --overflow-threshold-pt, #100) were present on the CLI path but missing from this namespace, raising AttributeError: 'types.SimpleNamespace' object has no attribute 'no_check_glyphs' in the diff self-test. Worked around in #103 by reading the flags via getattr with shared default constants, but the underlying drift risk remains.
Suggestion: derive the diff-test args from the same build subparser instead of a hand-maintained namespace — e.g. parse_args([...]) a synthetic argv, or seed defaults via parser.get_default(...), then override only the diff-specific fields (diff, output, no_docx, etc.). New flags would then be picked up automatically and this whole class of break goes away.
Non-blocking / cleanup.
The diff self-test constructs its
argsobject by hand as atypes.SimpleNamespacewith a hardcoded field list (tests/build_scripts/build_diff.py:124), separate from thebuildsubparser. Because it bypasses argparse, it does not inherit argparse's defaults — so every time a newbuildflag is added, it's absent on this object until someone remembers to add it manually.This already bit us: the PDF quality-gate flags (
--no-check-glyphs/--check-overflow/--overflow-threshold-pt, #100) were present on the CLI path but missing from this namespace, raisingAttributeError: 'types.SimpleNamespace' object has no attribute 'no_check_glyphs'in the diff self-test. Worked around in #103 by reading the flags viagetattrwith shared default constants, but the underlying drift risk remains.Suggestion: derive the diff-test args from the same
buildsubparser instead of a hand-maintained namespace — e.g.parse_args([...])a synthetic argv, or seed defaults viaparser.get_default(...), then override only the diff-specific fields (diff,output,no_docx, etc.). New flags would then be picked up automatically and this whole class of break goes away.Non-blocking / cleanup.