mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
Merge pull request #3585 from rommapp/add-test-data-generator
Add test data generator script
This commit is contained in:
@@ -64,6 +64,7 @@ These live in `.claude/skills/` and carry the detailed rules. Invoke the one tha
|
||||
**Keep comments short.** Comments should be concise, and focus on the "why" rather than the "what" (the code itself is the "what"). Avoid long paragraphs; break them into multiple lines or sentences.
|
||||
**Never commit secrets.** Never commit secrets (API keys, passwords, tokens, etc.) to the repo. Use environment variables or secret management tools instead.
|
||||
**Don't explain a change.** Avoid comments that explain why a change was made to the code. Focus instead on the current behaviour of the code and how it works.
|
||||
**Python tools live in `backend/tools/`.** Standalone dev/test utilities and scripts (not part of the app runtime) go in `backend/tools/`, not scattered across `backend/`.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
# uv run python -m utils.generate_supported_platforms
|
||||
#!/usr/bin/env python3
|
||||
"""Print the supported-platforms table (Markdown) for the docs.
|
||||
|
||||
Walks every UniversalPlatformSlug, collects each metadata provider's
|
||||
platform mapping, and emits a Markdown table (with provider link icons) to
|
||||
stdout for pasting into the documentation.
|
||||
|
||||
Run from the backend directory:
|
||||
|
||||
uv run python -m tools.generate_supported_platforms
|
||||
"""
|
||||
|
||||
from typing import TypedDict
|
||||
from urllib.parse import quote
|
||||
|
||||
1503
backend/tools/generate_test_data.py
Normal file
1503
backend/tools/generate_test_data.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Diagnose a malformed XML file: bad encoding, invalid chars, parse errors.
|
||||
|
||||
Reads the file in chunks to surface UTF-8 issues, then runs SAX and
|
||||
ElementTree parsing to report the location of structural errors, with a few
|
||||
lines of context around each one.
|
||||
|
||||
Run from the backend directory:
|
||||
|
||||
uv run tools/xml_diagnostics.py <xml_file>
|
||||
"""
|
||||
|
||||
import sys
|
||||
from xml.sax.handler import ContentHandler # nosec
|
||||
|
||||
@@ -79,6 +91,6 @@ def diagnose_xml(filename):
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python script.py <xml_file>")
|
||||
print("Usage: uv run tools/xml_diagnostics.py <xml_file>")
|
||||
sys.exit(1)
|
||||
diagnose_xml(sys.argv[1])
|
||||
|
||||
Reference in New Issue
Block a user