GeezerVison is showing github.com — codegen should error on unknown XML attributes in tags · Issue #821 · DFHack/df-structures
codegen should error on unknown XML attributes in tags #821
Description
I recently typoed typename for type-name in a structure definition. codegen silently accepted this erroneous definition instead of warning or erroring.
Activity
lethosor commented on Jan 23, 2025
Echoing Discord: this is hard because
- we don't have an exhaustive list of allowed attributes in codegen already
- some attributes have defaults (whether they should is another matter...)
maybe the answer is to do schema validation before ingesting files, if we can do that easily from perl.
quietust commented on Aug 7, 2025
The xmllint tool appears to be capable of catching those errors - whenever I do structure updates, I run this script to verify them first:
#!/bin/sh
xmllint --schema data-definition.xsd --noout df.*.xml 2>&1 | grep -v validates
./codegen.pl
git status
lethosor commented on Aug 8, 2025
And we run that in CI:
|
xmllint --schema data-definition.xsd --noout df.*.xml symbols.xml 2>&1 | tee xmllint.out; status=${PIPESTATUS[0]} |
quietust commented on Aug 8, 2025
Indeed - that's where I got it from (though I also filter out the "validates" lines so that the output is empty if there are no problems).
Metadata
Metadata
Development
No branches or pull requestsIssue actions