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: |
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 30 regression cases for single/double quotes, LF/CR/CRLF, paired backslashes, and default/whitespace/reindent formatting. Eight fail before the fix. Independent SQLite checks preserve all 36 tested values after the fix; the original formatter changes eight.
pytest): 536 passed on each of Python 3.12, 3.13 and 3.14; the baseline's two xfails and one xpass are unchangedruff check sqlparse/)