Repository navigation
fix(testing): keep Rule case offsets on Windows, and show an email Rule in the README - #12
Merged
Merged
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-01a18b8a-340f-717d-9ca7-6dcf564a065a Co-authored-by: Kevin Longe <kvlonge@gmail.com>
Deploying sqlclean with
|
| Latest commit: |
a6b4385
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f9295f2d.sqlclean.pages.dev |
| Branch Preview URL: | https://docs-readme-email-rule.sqlclean.pages.dev |
…and split the speed table The README Rule now flags an email comparison unless both sides are LOWER(...) or a lower-case string literal, so LOWER(email) compared with a mixed-case literal is reported. A test runs the README's code block through evaluate_rule. The speed table separates the competitor comparison from SQLClean's other configurations and drops the ratio column. Co-authored-by: Kevin Longe <kvlonge@gmail.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a18b8a-340f-717d-9ca7-6dcf564a065a Co-authored-by: Kevin Longe <kvlonge@gmail.com>
evaluate_rule piped the case SQL to the native executable in text mode, which on Windows turned each newline into CRLF, so statement text and finding offsets drifted by one character per line. Send UTF-8 bytes. Amp-Thread-ID: https://ampcode.com/threads/T-01a18b8a-340f-717d-9ca7-6dcf564a065a Co-authored-by: Kevin Longe <kvlonge@gmail.com>
kvlonge
added a commit
that referenced
this pull request
Oct 31, 2026
…le in the README (#12) * docs: show a case-insensitive email Rule in the README example and demo Co-authored-by: Kevin Longe <kvlonge@gmail.com> * docs: require normalized operands in the README email Rule, test it, and split the speed table The README Rule now flags an email comparison unless both sides are LOWER(...) or a lower-case string literal, so LOWER(email) compared with a mixed-case literal is reported. A test runs the README's code block through evaluate_rule. The speed table separates the competitor comparison from SQLClean's other configurations and drops the ratio column. Co-authored-by: Kevin Longe <kvlonge@gmail.com> * docs: move the README quick start before the speed tables Co-authored-by: Kevin Longe <kvlonge@gmail.com> * fix(testing): keep Rule case offsets right on Windows evaluate_rule piped the case SQL to the native executable in text mode, which on Windows turned each newline into CRLF, so statement text and finding offsets drifted by one character per line. Send UTF-8 bytes. Co-authored-by: Kevin Longe <kvlonge@gmail.com> ---------
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.
Why
The README's custom Rule example only matched a
tmp_prefix, and its speed table mixed competitors with SQLClean configurations under an ambiguous ratio column.Changes
XSQCTEAM001, a team convention: an=or<>on a column inEMAIL_COLUMNS(bare orLOWER(email)) passes only when both sides areLOWER(...)or a lower-case string literal. It readsstatement.polyglot_ast()(thesqlclean[ast]extra), infers no types and only reports. Known limit:LOWER(TRIM(email))is not recognised.= NULL(unsafe fix);fixremoves the CTE;--unsafe-fixesrewritesIS NULL; the email finding stays.test_readme_rule.pyruns the README's code block throughevaluate_ruleacross 9 cases.polyglot-sql-chiojoins the dev group so CI can run it.sqlclean.testingsent case SQL in text mode, so Windows turned newlines into CRLF and shifted offsets on multi-line cases. It now sends UTF-8 bytes; a multi-line harness case covers it.Verification
make verifyandfensu checkpass; the previous README Rule fails 2 of the new cases.<picture>and shows the light fallback, legible on white.