From 156ab5307f5d5b87582ef7142e68abab38136299 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Thu, 10 Jul 2025 14:42:23 +0200 Subject: [PATCH] Update json_to_md.py --- json_to_md.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/json_to_md.py b/json_to_md.py index b2908204..ede12ebe 100644 --- a/json_to_md.py +++ b/json_to_md.py @@ -29,7 +29,6 @@ def build_tree(collectors): def write_tree(f, tree, path=""): for name, content in tree.items(): if not isinstance(content, dict): - # On ignore les feuilles ou erreurs de structure continue full_path = f"{path}/{name}" if path else name @@ -37,6 +36,7 @@ def write_tree(f, tree, path=""): emoji = "✅" if outcome == "passed" else "❌" f.write(f"
\n{emoji} `{full_path}`\n\n") + f.write(f"- **outcome:** `{outcome}`\n") result = content.get("result") @@ -53,10 +53,12 @@ def write_tree(f, tree, path=""): else: f.write("- **result:** `None`\n") - f.write("
\n\n") - # Appelle récursif pour les sous-dossiers - write_tree(f, content, full_path) + # 🔁 Appel récursif pour explorer les sous-dossiers + subdirs = {k: v for k, v in content.items() if isinstance(v, dict) and k not in ["outcome", "result"]} + if subdirs: + write_tree(f, subdirs, full_path) + f.write("\n\n") def stringify(obj): if obj is None or obj == "":