GRM-45: fix: generate self-contained SVG badges instead of shields.io JSON

shields.io can't fetch JSON from our self-hosted Gitea instance (not
publicly reachable), so badges showed "unknown". Switched to generating
self-contained SVG badge files that are served directly by Gitea's raw
file API — no external service needed.

Changes:
- generate_badges.py: Added render_svg() to produce shields.io-style
  SVG badges with gradient, rounded corners, and Verdana font
- Replaced xml.sax.saxutils.escape with a simple _xml_escape() to
  avoid bandit B406 warning (no defusedxml dependency needed)
- CI workflow: Push .svg files instead of .json to badges branch
- README.md and docs/index.md: Updated badge URLs to use raw SVG
  from the badges branch instead of shields.io endpoint

Also fixed:
- Coverage regex now handles 100% without decimal (was 100.00%)
- doc_coverage.py: Removed redundant % in pct variable that caused
  double-percent (100%%) in output

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Emil Simeonov
2026-06-22 00:50:22 +02:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 28b4acf323
commit 749b4d025f
5 changed files with 129 additions and 53 deletions
+1 -1
View File
@@ -202,6 +202,6 @@ jobs:
git checkout --orphan badges
git rm -rf .
cp -r .badges/* .
git add *.json
git add *.svg
git commit --no-verify -m "Update badges [skip ci]"
git push origin badges --force