From 8596f0d4a3712cad11b0169ad1ceacf5550bf85e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 20 Apr 2025 11:00:00 -0700 Subject: [PATCH] feat: Use json5 to load model metadata for lenient parsing --- scripts/clean_metadata.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/clean_metadata.py b/scripts/clean_metadata.py index 3f57bbfef..3466f683b 100644 --- a/scripts/clean_metadata.py +++ b/scripts/clean_metadata.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import json +import json5 from pathlib import Path @@ -28,8 +29,9 @@ def main(): return try: + # Use json5 for the aider metadata file as it might contain comments with open(aider_path, "r") as f: - aider_data = json.load(f) + aider_data = json5.load(f) except json.JSONDecodeError as e: print(f"Error decoding JSON from {aider_path}: {e}") return