Environment
Reproduction
example.py:
class Example:
def first(self) -> None:
pass
def target(self) -> None:
pass
def after(self) -> None:
pass
replacement.py:
def target(self) -> None:
print("replacement")
Run:
identedit patch example.py \
--symbol Example.target \
--replace \
--text-file replacement.py
identedit reports:
{
"summary": {
"files_modified": 1,
"operations_applied": 1,
"operations_failed": 0
},
"transaction": {
"mode": "all_or_nothing",
"status": "committed"
}
}
The result is syntactically invalid:
class Example:
def first(self) -> None:
pass
def target(self) -> None:
print("replacement")
def after(self) -> None:
pass
python -m py_compile example.py raises IndentationError.
Expected
Either:
- normalize a method replacement snippet relative to the target container, or
- reject the indented snippet without modifying the file.
At minimum, structural patch application should parse-check the resulting file and roll back instead of reporting a committed all-or-nothing transaction for invalid syntax.
Environment
Reproduction
example.py:replacement.py:Run:
identedit reports:
{ "summary": { "files_modified": 1, "operations_applied": 1, "operations_failed": 0 }, "transaction": { "mode": "all_or_nothing", "status": "committed" } }The result is syntactically invalid:
python -m py_compile example.pyraisesIndentationError.Expected
Either:
At minimum, structural patch application should parse-check the resulting file and roll back instead of reporting a committed all-or-nothing transaction for invalid syntax.