Compute combined unified diff from two snapshot dicts.
(
old_files: Dict[str, str],
new_files: Dict[str, str],
)
| 942 | return _collect_files(skill_dir) |
| 943 | |
| 944 | def _compute_files_diff( |
| 945 | old_files: Dict[str, str], |
| 946 | new_files: Dict[str, str], |
| 947 | ) -> str: |
| 948 | """Compute combined unified diff from two snapshot dicts.""" |
| 949 | all_names = sorted(set(old_files) | set(new_files)) |
| 950 | parts: list[str] = [] |
| 951 | for name in all_names: |
| 952 | d = compute_unified_diff( |
| 953 | old_files.get(name, ""), |
| 954 | new_files.get(name, ""), |
| 955 | filename=name, |
| 956 | ) |
| 957 | if d: |
| 958 | parts.append(d) |
| 959 | return "\n".join(parts) |
| 960 | |
| 961 | def _collect_files(directory: Path) -> Dict[str, str]: |
| 962 | """Collect all text files in a directory (recursive). |
no test coverage detected