fix: dash source-backed cell without profiles

This commit is contained in:
Abdessamad Derraz committed 2026-08-07 18:28:50 +02:00
1 parent a19f36beb3
commit bf5863b9b8
3 files changed
+21 -14

No files matched your search

+10 -7
View File
@@ -273,15 +273,17 @@ def generate_readme(db: dict, platforms_dir: str) -> str:
for name, cov in sorted(coverages.items(), key=lambda x: x[1]["platform"]):
pct = f"{cov['percentage']:.1f}%"
gt = cov["ground_truth"]
gt_pct = (
f"{gt['with_validation'] / gt['total'] * 100:.0f}%"
if gt["total"]
else "0%"
)
if not gt.get("applicable", True):
gt_cell = "-"
elif gt["total"]:
gt_pct = f"{gt['with_validation'] / gt['total'] * 100:.0f}%"
gt_cell = f"{gt['with_validation']}/{gt['total']} ({gt_pct})"
else:
gt_cell = "0/0"
lines.append(
f"| {cov['platform']} | {cov['present']}/{cov['total']} ({pct}) | "
f"{cov['verified']} | {cov['untested']} | {cov['missing']} | "
f"{gt['with_validation']}/{gt['total']} ({gt_pct}) |"
f"{gt_cell} |"
)
lines.extend(
@@ -291,7 +293,8 @@ def generate_readme(db: dict, platforms_dir: str) -> str:
" using that platform's own verification mode.",
"Source-backed counts the files whose expectations were also read"
" from an emulator's source code; the rest rely on the platform"
" list alone.",
" list alone. A dash means no profiled emulator applies to the"
" platform, whose own source is then the only authority.",
"Where platform lists and emulator source code disagree, the"
f" differences are tracked in the [gap analysis]({SITE_URL}gaps/).",
"",
+10 -7
View File
@@ -1539,11 +1539,13 @@ def generate_gap_analysis(
else str(u)
)
gt = cov["ground_truth"]
gt_pct = (
f"{gt['with_validation'] / gt['total'] * 100:.0f}%"
if gt["total"]
else "0%"
)
if not gt.get("applicable", True):
gt_cell = "-"
elif gt["total"]:
gt_pct = f"{gt['with_validation'] / gt['total'] * 100:.0f}%"
gt_cell = f"{gt['with_validation']}/{gt['total']} ({gt_pct})"
else:
gt_cell = "0/0"
lines.append(
f"| [{display}](platforms/{pname}.md) "
f"| {cov['total']} "
@@ -1551,7 +1553,7 @@ def generate_gap_analysis(
f"| {untested_str} "
f"| {missing_str} "
f"| {cov['mode']} "
f"| {gt['with_validation']}/{gt['total']} ({gt_pct}) |"
f"| {gt_cell} |"
)
lines.extend([
"",
@@ -1560,7 +1562,8 @@ def generate_gap_analysis(
"measure the repository against the file list each platform declares. "
"Source-backed counts the files whose expectations were also read "
"from an emulator's source code; the rest rely on the platform list "
"alone.",
"alone. A dash means no profiled emulator applies to the platform, "
"whose own source is then the only authority.",
"",
])
+1
View File
@@ -855,6 +855,7 @@ def verify_platform(
"with_validation": with_validation,
"platform_only": total - with_validation,
"total": total,
"applicable": bool(resolve_platform_cores(config, profiles)),
},
}