Validate UI XML in lint, and fix the two files that failed it #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/ui-xml-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
XML forbids a double hyphen inside a comment. Both
games/_template/ui/Global.xmland Hanabi UI used one as a dash, in the same prose style the Lua files use, so both were invalid — and because the template was wrong, every game copied from it would have inherited the problem.The failure mode is what makes this worth a lint gate rather than just a fix. TTS pushes UI XML as a channel separate from the Lua script and fails it separately: the panel silently never appears while the Lua half loads and reports itself perfectly healthy. Chat carries one red line and then scrolls away.
Found by pasting Hanabi UI into a live table and getting an engine with no buttons.
tools/check_ui_xml.pyparses everygames/*/ui/*.xmland is wired intomake lint. TTS accepts several top-level elements where XML insists on exactly one root, so each file is wrapped before parsing. The checker also notices a stray--and says so explicitly, because not well-formed (invalid token) is not a useful thing to read at position 32 of a comment.Verified both directions: lint passes on the corrected files, and reintroducing a double hyphen fails it with exit 2.