Load the JSON diff data from the corresponding file_diffs.json file.
(diff_log_path: Path)
| 17 | |
| 18 | |
| 19 | def load_diff_json(diff_log_path: Path) -> dict: |
| 20 | """Load the JSON diff data from the corresponding file_diffs.json file.""" |
| 21 | json_path = diff_log_path.parent / "file_diffs.json" |
| 22 | if not json_path.exists(): |
| 23 | return {} |
| 24 | |
| 25 | try: |
| 26 | with open(json_path, "r") as f: |
| 27 | return json.load(f) |
| 28 | except Exception as e: |
| 29 | print(f"Warning: Could not load JSON diff data: {e}") |
| 30 | return {} |
| 31 | |
| 32 | |
| 33 | def get_file_content(json_data: dict, file_path: str, snapshot_type: str = "after") -> str: |
no test coverage detected