Update json_to_md.py
This commit is contained in:
+6
-4
@@ -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"<details>\n<summary>{emoji} `{full_path}`</summary>\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("</details>\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("</details>\n\n")
|
||||
|
||||
def stringify(obj):
|
||||
if obj is None or obj == "":
|
||||
|
||||
Reference in New Issue
Block a user