diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-10-20 18:36:54 +0200 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-10-20 18:36:54 +0200 |
| commit | f466977249d9ac10fe8b75180c30cb90dbcc22ca (patch) | |
| tree | f346500d39d077aaaeb350e0e99647a4d6e6367c /docker | |
| parent | 479d7ba2e843d5ea93979f2eed68f4d38d146c25 (diff) | |
build(lint): validate resource XML against the SDK schema and cross-check the settings form
tools/check_resources.py checks every resource file against the SDK's
resources.xsd and that settings, properties and strings agree. Adds the
pure-Python, MIT-licensed xmlschema to the dev image.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/requirements.in | 3 | ||||
| -rw-r--r-- | docker/requirements.txt | 8 | ||||
| -rwxr-xr-x | docker/scripts/lint.sh | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/docker/requirements.in b/docker/requirements.in index 787d84f..d344f23 100644 --- a/docker/requirements.in +++ b/docker/requirements.in @@ -19,6 +19,9 @@ segno>=1.6 pdf417gen>=0.7 ppf-datamatrix>=0.2 aztec-code-generator>=0.11 +# Validates the resource XML (settings, properties, strings) against the +# SDK's resources.xsd (M7). Pure Python, MIT licensed. +xmlschema>=3 # Screenshot handling (crop, compare, scale before decoding). pillow>=10 # Lint and type-check the Python tools. diff --git a/docker/requirements.txt b/docker/requirements.txt index fe24646..c3574c6 100644 --- a/docker/requirements.txt +++ b/docker/requirements.txt @@ -63,6 +63,10 @@ aztec-code-generator==0.12 \ --hash=sha256:b8b498b5b93378e9c99226a7fada8811e41be33aa20973398d5eeebd19629909 \ --hash=sha256:e27db502c081d0336406bb587ddfe837a8b0a5d44835522f1f21f470c964706b # via -r requirements.in +elementpath==5.1.4 \ + --hash=sha256:3c912a9c41311ac5244c038867670d7c0b0fec0e444813608e5b846dbb3428ac \ + --hash=sha256:5ec8d7bb44b16c98414a6a95e20cb150f3cbfc3cac65edc14773288c7a937376 + # via xmlschema exceptiongroup==1.3.1 \ --hash=sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219 \ --hash=sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598 @@ -561,6 +565,10 @@ typing-extensions==4.16.0 \ # via # exceptiongroup # mypy +xmlschema==4.3.2 \ + --hash=sha256:cf5c970a30f6ebcb3da35260e694704cc0b6794d8ace46125bb2a95e38ed9307 \ + --hash=sha256:f3b33a21a2b2cdc404ddc3fb599d8bc1dee90b155d547370672e6e684746b8d6 + # via -r requirements.in zxing-cpp==3.1.1 \ --hash=sha256:0343458a0fdf3f99c9dcff74dd09be6bae5d0d87a2f99de7876014317b939996 \ --hash=sha256:037cbcaeb0cb12497fc15ced23f6b778fce8a6a1d1bbffddbffd004c6225744d \ diff --git a/docker/scripts/lint.sh b/docker/scripts/lint.sh index 998b2b9..4cca4d8 100755 --- a/docker/scripts/lint.sh +++ b/docker/scripts/lint.sh @@ -7,6 +7,8 @@ # 1. tools/lint_project.py: project rules (headers, no logging, no network, ...) # 2. ruff (lint + formatting) and mypy --strict on the Python tools # 3. tools/gen_products.py --check: the manifest's products meet the targets +# tools/check_resources.py: resource XML valid against the SDK's +# resources.xsd; settings, properties and strings agree # 4. Debug and release builds with strict type checking (-l 3) on each device; # build-app.sh fails on any compiler warning. set -euo pipefail @@ -26,6 +28,10 @@ ruff format --check /work/tools /work/spike log "product list" python3 /work/tools/gen_products.py --check +log "resource XML against the SDK schema, settings cross-check" +ciq_require_sdk +python3 /work/tools/check_resources.py /work + for device in "$@"; do build-app.sh debug "${device}" build-app.sh release "${device}" |
