From 202746d34d3340d769e795f2e6ac6fcd8c666607 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 18 Jun 2026 17:19:03 +0700 Subject: 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
Size table 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 --- tools/metrics.py | 4 ++-- 1 file 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}", "", "
Size table", ""] md_lines.extend(render_combine_table(json_data, sort_order)) - md_lines.append("") + md_lines.extend(["", "
", ""]) if json_data.get("file_list"): md_lines.extend(["
", "Input files", ""]) -- cgit v1.3.1