From 6d74b4e3c15d0b677247ce02c459095d3cf03fc5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 10 May 2025 08:31:27 +0200 Subject: [PATCH] tools/gen-cpydiff.py: Ensure every item has at least 2 TOC levels. Previously, the navigation ended up messy when the (long) description of the item became used as a 2nd level header, meaning that it was placed in the navigation. Check for this when generating cpydiff so that new cases don't sneak in unnoticed. Signed-off-by: Jeff Epler --- tools/gen-cpydiff.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/gen-cpydiff.py b/tools/gen-cpydiff.py index 278023a4bd..3bb928090b 100644 --- a/tools/gen-cpydiff.py +++ b/tools/gen-cpydiff.py @@ -219,6 +219,8 @@ def gen_rst(results): class_ = [] for output in results: section = output.class_.split(",") + if len(section) < 2: + raise SystemExit("Each item must have at least 2 categories") for i in range(len(section)): section[i] = section[i].rstrip() if section[i] in CLASSMAP: