Implement the main logic

This commit is contained in:
Sven van Heugten 2026-03-05 17:53:56 +01:00
parent 0aee4d44a5
commit 28e5f45598
No known key found for this signature in database
GPG key ID: D612F88666F4F660

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import re
import sys
@ -18,7 +19,8 @@ def should_include_change(change_lines: list[str], search: str, replace: str) ->
added_lines.append(line[1:])
continue
raise ValueError("Unexpected non-change line in change block.")
return True
transformed_removed = [re.sub(search, replace, line) for line in removed_lines]
return transformed_removed == added_lines
def should_include_hunk(hunk_text: str, search: str, replace: str) -> bool: