Repository navigation
Keep normalized whitespace in sync after filtering - #934
Open
JunaidAhamed-7777 wants to merge 1 commit into
Open
JunaidAhamed-7777 wants to merge 1 commit into
JunaidAhamed-7777 wants to merge 1 commit into
Conversation
JunaidAhamed-7777
marked this pull request as ready for review
October 13, 2026 17:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #547.
StripWhitespaceFilterchanges whitespace token values but leaves their cachednormalizedvalues unchanged. A tab collapsed to a space consequently failstoken.match(token.ttype, ' '), and regex matching also sees the original text.Update
normalizedwhen this filter changes the whitespace value. Regression tests cover leading/repeated whitespace, parentheses, and identifier lists, checking both literal and regex matching. All three cases fail before the fix.python -m pytest tests -q --tb=short --basetemp=../tmp-sqlparseon Python 3.14: 509 passed, 2 xfailed, 1 xpassed.git diff --checkpasses.Baseline comparison: unchanged base
60cdc649726bf1bc4f1b336050560b336da715ecreports 506 passed, 2 xfailed, 1 xpassed. Both base and final code unexpectedly passtests/test_regressions.py::test_issue484_comments_and_newlines; the three additional passing cases are the new whitespace regressions.AI-assisted using GPT-6; human review follows draft submission.