Repository navigation
Conversation
|
Here's a small optional test-only commit, directly on your current head. It combines keyword uppercasing with whitespace stripping or reindentation, using two quoted values containing backslash/LF, trailing spaces and CRLF. The words Two guards worth keeping: both quoted payloads remain exact, and the outside On Python 3.14.4, both new cases pass your source. The base transforms the outside keywords but loses both literal payloads. The unchanged keyword-case test passes on both. Focused Ruff checks pass; I haven't run the full suite, dialect/SQL-semantic checks, benchmarks, build or version/OS matrix. No SQL was executed. To run the added file in your tree: |
Signed-off-by: Casper Verbuyst <casperverbuyst@gmail.com>
Thanks! |
Formatting a quoted value containing a backslash followed by LF can remove whitespace and normalize line endings inside that value:
The assertion currently fails: the two spaces after
bdisappear and its CRLF becomes LF.SPLIT_REGEXuses\\.for quoted escapes, but.does not match LF. Enabling DOTALL keeps the complete quoted value together so the serializer only strips whitespace outside it.Added 32 regression cases for single/double quotes, LF/CR/CRLF, paired backslashes, and default/whitespace/reindent formatting, including keyword transformations. Ten fail before the fix. Independent SQLite checks preserve all 36 tested values after the fix; the original formatter changes eight.
pytest): 538 passed on each of Python 3.10–3.14; the baseline's two xfails and one xpass are unchangedruff check sqlparse/)