Skip to content

fix(testing): keep Rule case offsets on Windows, and show an email Rule in the README - #12

Merged
kvlonge merged 4 commits into
mainfrom
docs/readme-email-rule
Oct 31, 2026
Merged

kvlonge merged 4 commits into
mainfrom
docs/readme-email-rule

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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 in EMAIL_COLUMNS (bare or LOWER(email)) passes only when both sides are LOWER(...) or a lower-case string literal. It reads statement.polyglot_ast() (the sqlclean[ast] extra), infers no types and only reports. Known limit: LOWER(TRIM(email)) is not recognised.
  • Demo re-recorded with real output: check reports the unused CTE (safe fix), the email comparison and = NULL (unsafe fix); fix removes the CTE; --unsafe-fixes rewrites IS NULL; the email finding stays.
  • Test test_readme_rule.py runs the README's code block through evaluate_rule across 9 cases. polyglot-sql-chio joins the dev group so CI can run it.
  • Windows fix: sqlclean.testing sent 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.
  • Speed: a competitor table (0.81 s, 41.0 s, 919 s) with the caveat and methodology link, then a SQLClean configurations table (1.33 s, 2.27 s, 0.23 s cached). No ratio column; numbers unchanged.

Verification

  • make verify and fensu check pass; the previous README Rule fails 2 of the new cases.
  • GitHub Markdown API renders: dark mode loads the white logo, light mode the dark one. PyPI strips <picture> and shows the light fallback, legible on white.
  • Demo frames readable, no em dashes, hygiene check clean.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Deploying sqlclean with  Cloudflare Pages  Cloudflare Pages

Latest commit: a6b4385
Status: ✅  Deploy successful!
Preview URL: https://f9295f2d.sqlclean.pages.dev
Branch Preview URL: https://docs-readme-email-rule.sqlclean.pages.dev

View logs

…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>
@kvlonge kvlonge changed the title docs: show a case-insensitive email Rule in the README example and demo docs: show a case-insensitive email Rule in the README, test it, and split the speed table Oct 31, 2026
ampagent and others added 2 commits October 31, 2026 06:57
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 kvlonge changed the title docs: show a case-insensitive email Rule in the README, test it, and split the speed table fix(testing): keep Rule case offsets on Windows, and show an email Rule in the README Oct 31, 2026
@kvlonge
kvlonge merged commit 1585d41 into main Oct 31, 2026
17 checks passed
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>

---------
@kvlonge
kvlonge deleted the docs/readme-email-rule branch October 31, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants