Skip to content

Commit d9d2fa8

Browse files
docs: add W014 to CHANGELOG and README, bump key numbers to 41/26
1 parent 19a3248 commit d9d2fa8

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ a deprecation window (see `GOVERNANCE.md` § Scope discipline).
1212

1313
### Added
1414

15+
- **W014 `case-without-else`** - warns when a statement contains a
16+
`CASE ... END` expression with no `ELSE` branch. Unmatched rows quietly
17+
return `NULL`, which often surprises callers who assumed the `WHEN`
18+
conditions were exhaustive. Fires when at least one `CASE`/`END` pair
19+
is present and no `ELSE` keyword appears in the statement. Suggests
20+
adding `ELSE NULL` for explicitness. Contributed by
21+
[@hellozzm](https://github.com/hellozzm)
22+
([#32](https://github.com/Pawansingh3889/sql-guard/pull/32)).
1523
- W023 `scalar-udf-in-where`: warns on `<schema>.<name>(...)` calls in
1624
`WHERE`/`HAVING`/`ON` clauses, the canonical T-SQL scalar-UDF
1725
anti-pattern. Built-ins (no schema prefix) are unaffected.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ One bad SQL query can delete production data, expose customer records, or bring
2424

2525
| | |
2626
|---|---|
27-
| Rules | 40 (10 errors, 25 warnings, 5 Python-source) |
27+
| Rules | 41 (10 errors, 26 warnings, 5 Python-source) |
2828
| Tests | 152 |
2929
| Coverage | 86% |
3030
| Scan speed | 0.08s across 200 files |
@@ -43,7 +43,7 @@ print(result.summary()) # "1 error, 0 warnings in 1 statement"
4343

4444
---
4545

46-
Fast, rule-based SQL linter. 40 rules (35 SQL + 5 Python), including SQL Server-focused rules for T-SQL shops. Inline disable, project config, git-changed-only mode, and SARIF output for GitHub Code Scanning. 500+ monthly downloads on PyPI.
46+
Fast, rule-based SQL linter. 41 rules (36 SQL + 5 Python), including SQL Server-focused rules for T-SQL shops. Inline disable, project config, git-changed-only mode, and SARIF output for GitHub Code Scanning. 500+ monthly downloads on PyPI.
4747

4848
Catches dangerous SQL before it reaches production -- DELETE without WHERE, UPDATE without WHERE, SQL injection patterns, SELECT *, and 20 more. Runs as a **CLI tool**, **pre-commit hook**, and **GitHub Action**.
4949

@@ -227,6 +227,7 @@ sql-sop list-rules # show every registered rule
227227
| W009 | `missing-semicolon` | Statement not terminated with `;` |
228228
| W010 | `commented-out-code` | `-- SELECT * FROM old_table` -- use version control |
229229
| W013 | `window-missing-partition` | `OVER ()` -- unpredictable results and unclear intent |
230+
| W014 | `case-without-else` | `CASE WHEN ... THEN ... END` -- unmatched rows return NULL |
230231
| W016 | `not-in-with-subquery` | `WHERE id NOT IN (SELECT ...)` -- silently returns 0 rows on NULL
231232
| W017 | `leading-wildcard-like` | `WHERE name LIKE '%smith'` -- non-SARGable, full scan |
232233
| W018 | `or-across-columns` | `WHERE a = 1 OR b = 2` -- defeats single-column indexes |

0 commit comments

Comments
 (0)