You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix S001 false negatives on aliased / schema-qualified / multi-line FROM
The previous detection regex `\bFROM\s+(\w+\s*,\s*\w+)` only matched
when the comma came immediately after the first word after FROM. Most
real-world comma-joins missed it: aliased tables, schema-qualified
names, three-or-more-way joins, and multi-line layouts all slipped
through silently. Reproductions on main:
FROM orders o, customers c WHERE ... -> not flagged
FROM raw.orders, raw.customers WHERE ... -> not flagged
FROM o1, o2, o3 WHERE ... -> not flagged
FROM orders o,\n customers c\nWHERE ... -> not flagged
Replaces the regex with a paren-depth-aware scan: from each FROM
keyword, walk forward tracking parenthesis depth, stop at WHERE /
GROUP BY / ORDER BY / HAVING / LIMIT / explicit JOIN / UNION / EXCEPT
/ INTERSECT, and flag the first depth-0 comma. Strings and comments
are stripped first so commas inside them do not register.
Two suppression cases added:
- DELETE FROM is skipped (single-target DELETE; bare comma after
DELETE FROM is invalid syntax in most dialects)
- Comma followed by LATERAL is treated as a legitimate
Snowflake/Postgres lateral join, not flagged
This addresses #41 (the W027 comma-join request) — the rule already
existed as S001 but was not catching the patterns it claimed to
cover. Improving S001 in place avoids a duplicate W027.
* Add S001 regression tests for the false-negative cases
14 new tests under TestImplicitCrossJoin: aliases, schema-qualified
names, three-or-more-way joins, multi-line layout, comma-joins inside
CTEs, plus the suppression cases (function-call commas, subquery
commas, VALUES rows, LATERAL after comma, LEFT OUTER JOIN, string
literals with commas, DELETE FROM, comments between tables). Each
case has a one-line comment explaining what it pins down.
Total tests in this class go from 3 to 17. Full suite stays at 226
passing.
* Document S001 fix in CHANGELOG under [Unreleased]
* style: pre-commit auto-fixes
[pre-commit.ci] auto-applied fixes from configured hooks
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
`EXCEPT` / `INTERSECT`, flagging the first depth-0 comma. Strings
37
+
and comments are stripped first. `DELETE FROM` is skipped.
38
+
`, LATERAL ...` is recognised as a legitimate
39
+
Snowflake/Postgres lateral join and not flagged. Resolves #41
40
+
(the W027 comma-join request was a duplicate of S001).
41
+
26
42
## [0.7.0] - 2026-05-02
27
43
28
44
Headline release: schema-aware linting via the new **Contracts pack**, three community-contributed rules (W014 / W015 / W022), and the `schema-snapshot` and `validate-contract` subcommands. Core registry is 43 rules (10 errors, 28 warnings, 5 Python-source). With `--contract` enabled the registry grows to 48 rules (12 errors, 31 warnings, 5 Python-source). Without `--contract` behaviour is identical to v0.6.x and there are no breaking changes.
@@ -219,7 +235,7 @@ Headline release: schema-aware linting via the new **Contracts pack**, three com
219
235
-`test_duration_tracked` no longer fails on fast hardware where
220
236
`time.perf_counter` resolution is coarser than the scan duration.
221
237
Assertion relaxed from `> 0` to `>= 0` with an explicit float type check.
222
-
- Added W014: warn on OVER() without ORDER BY / PARTITION BY to flag non-deterministic window
238
+
- Added W014: warn on OVER() without ORDER BY / PARTITION BY to flag non-deterministic window
0 commit comments