summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-06-18 17:19:03 +0700
committerhathach <[email protected]>2026-06-18 17:19:03 +0700
commit202746d34d3340d769e795f2e6ac6fcd8c666607 (patch)
tree03278523ac8911e7bd1d41cc6530a3956f255990
parent941d63e39a529593ee86caf7ea85e04839680d59 (diff)
ci(metrics): collapse Average Code Size Metrics table when no base
When no base metrics are available to compare against, the PR comment falls back to the combined "TinyUSB Average Code Size Metrics" report (build.yml copies metrics.md to metrics_compare.md). That posted the full per-example size table inline, cluttering the comment. Wrap the table in a <details><summary>Size table</summary> block so the heading stays visible but the detail is collapsed by default, matching the Size Difference Report's collapsible sections. Co-Authored-By: Claude Fable 5 <[email protected]>
-rw-r--r--tools/metrics.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/metrics.py b/tools/metrics.py
index d716cb2a5..0e29fc1ab 100644
--- a/tools/metrics.py
+++ b/tools/metrics.py
@@ -384,9 +384,9 @@ def render_combine_table(json_data, sort_order='name+'):
def write_combine_markdown(json_data, path, sort_order='name+', title="TinyUSB Average Code Size Metrics"):
"""Write averaged size data to a markdown file."""
- md_lines = [f"## {title}", ""]
+ md_lines = [f"## {title}", "", "<details><summary>Size table</summary>", ""]
md_lines.extend(render_combine_table(json_data, sort_order))
- md_lines.append("")
+ md_lines.extend(["", "</details>", ""])
if json_data.get("file_list"):
md_lines.extend(["<details>", "<summary>Input files</summary>", ""])