From 15d8f0b43ca6766752967cfeaec47bd9d148447e Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:54:57 -0700 Subject: [PATCH] refactor: drop the output-neutral pad on the executed-literal recursion The call-detection restore splices into a fixed-position list, so its .ljust(end - start) holds that length invariant and a test guards it. The DML-scan recursion instead hands the undoubled literal to a fresh scan_region as its own region, whose length feeds nothing, so the pad only appends trailing spaces that shift no keyword and change no reported line. Drop it and the docstring clause that claimed it kept the offsets landing --- .../code_coverage_tests/check_migrations_no_data_rewrites.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/code_coverage_tests/check_migrations_no_data_rewrites.py b/tests/code_coverage_tests/check_migrations_no_data_rewrites.py index 39fdfe716cf..b3f60febaba 100644 --- a/tests/code_coverage_tests/check_migrations_no_data_rewrites.py +++ b/tests/code_coverage_tests/check_migrations_no_data_rewrites.py @@ -633,8 +633,7 @@ def scan_region( always counted against the whole document, so a statement nested in a dollar-quoted body reports its real file line and lines up with the markers read from that file. A single-quoted literal that `DO` or `EXECUTE` runs as SQL is undoubled before it is scanned, so a `--` or `/*` - in one of its nested strings blanks nothing and the statement after it stays visible, and it is - padded back to its span so the offsets still land.""" + in one of its nested strings blanks nothing and the statement after it stays visible.""" masked, bodies, literals = mask(region) executed = executed_names(masked) runnable = executed_literals(masked, literals, executed) @@ -649,7 +648,7 @@ def scan_region( if base <= start and end <= commands_end: yield from scan_region( document, - undouble(region[start:end]).ljust(end - start), + undouble(region[start:end]), migration, markers, offset + start,