Compare all files in two skill directories, return combined diff.
(old_dir: Path, new_dir: Path)
| 918 | return "".join(diff_lines) |
| 919 | |
| 920 | def compute_skill_diff(old_dir: Path, new_dir: Path) -> str: |
| 921 | """Compare all files in two skill directories, return combined diff.""" |
| 922 | old_files = _collect_files(old_dir) if old_dir.is_dir() else {} |
| 923 | new_files = _collect_files(new_dir) if new_dir.is_dir() else {} |
| 924 | |
| 925 | all_names = sorted(set(old_files) | set(new_files)) |
| 926 | parts: list[str] = [] |
| 927 | for name in all_names: |
| 928 | d = compute_unified_diff( |
| 929 | old_files.get(name, ""), |
| 930 | new_files.get(name, ""), |
| 931 | filename=name, |
| 932 | ) |
| 933 | if d: |
| 934 | parts.append(d) |
| 935 | return "\n".join(parts) |
| 936 | |
| 937 | def collect_skill_snapshot(skill_dir: Path) -> Dict[str, str]: |
| 938 | """Collect all text files in a skill directory. |
no test coverage detected