Standardize backend/tools file headers

Give all three tools the same header shape: shebang, summary docstring, a
short detail paragraph, and a "Run from the backend directory:" command
block. Adds docstrings to generate_supported_platforms.py and
xml_diagnostics.py, which previously had none.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-06-23 22:05:52 -04:00
parent 183894c180
commit c87d880042
2 changed files with 25 additions and 2 deletions

View File

@@ -1,4 +1,15 @@
# uv run python -m tools.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

View File

@@ -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])