From af8fae68fe6832a3a2dda1cd3afce19d44575bdd Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Thu, 5 Mar 2026 19:23:00 +0100 Subject: [PATCH] Fix formatting --- bin/mechanicaldiff.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/mechanicaldiff.py b/bin/mechanicaldiff.py index cd11731..453f04f 100755 --- a/bin/mechanicaldiff.py +++ b/bin/mechanicaldiff.py @@ -4,14 +4,18 @@ import re import sys -def should_include_change(change_lines: list[str], search: str, replace: str) -> bool: +def should_include_change( + change_lines: list[str], search: str, replace: str +) -> bool: removed_lines = [] added_lines = [] phase = "minus" for line in change_lines: if line.startswith("-"): if phase != "minus": - raise ValueError("Non-consecutive '-' and '+' lines in change block.") + raise ValueError( + "Non-consecutive '-' and '+' lines in change block." + ) removed_lines.append(line[1:]) continue if line.startswith("+"): @@ -19,7 +23,9 @@ 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.") - transformed_removed = [re.sub(search, replace, line) for line in removed_lines] + transformed_removed = [ + re.sub(search, replace, line) for line in removed_lines + ] return transformed_removed == added_lines