refactor: review fixes, DRY coverage, filter test nav

- Extract compute_coverage to common.py (was duplicated)
- Filter test cores from nav and emulator index
- Use absolute URL for README download links
- Consistent page titles with site name suffix
- Safer mkdocs.yml nav rewrite with regex
- Build all_platform_names once in gap analysis
This commit is contained in:
Abdessamad Derraz
2026-03-18 11:05:13 +01:00
parent e218763500
commit 54c0f1d27e
3 changed files with 40 additions and 59 deletions

View File

@@ -217,6 +217,27 @@ def resolve_local_file(
return None, "not_found"
def compute_coverage(platform_name: str, platforms_dir: str, db: dict) -> dict:
"""Compute BIOS coverage for a platform using verify logic."""
from verify import verify_platform
config = load_platform_config(platform_name, platforms_dir)
result = verify_platform(config, db)
present = result["ok"] + result["untested"]
pct = (present / result["total"] * 100) if result["total"] > 0 else 0
return {
"platform": config.get("platform", platform_name),
"total": result["total"],
"verified": result["ok"],
"untested": result["untested"],
"missing": result["missing"],
"present": present,
"percentage": pct,
"mode": config.get("verification_mode", "existence"),
"details": result["details"],
"config": config,
}
def safe_extract_zip(zip_path: str, dest_dir: str) -> None:
"""Extract a ZIP file safely, preventing zip-slip path traversal."""
dest = os.path.realpath(dest_dir)