Commit be53bcd
feat(linter): expand linter from 10 to 30 rules — safety, performance, naming (#445)
* docs: add Q2 2026 roadmap design spec from multi-persona audit
Full-project audit using 5 parallel analytical personas (Performance,
SQL Compatibility, API/DX, Competitive, Community). Synthesizes into
prioritized P0–P3 roadmap covering: HN launch, query fingerprinting,
linter expansion to 30 rules, DML transforms, C binding hardening,
live DB schema introspection, SQL transpilation, CONNECT BY, OTel,
GORM integration, and advisor expansion.
Corresponding GitHub issues: #442–#460
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: add Q2 2026 implementation plans for all roadmap items
12 implementation plans covering all prioritized GitHub issues:
P0 (Critical):
- 2026-03-29-sentry-fixes.md (#434, #437) — fix Sentry noise filters
- 2026-03-29-openssf-scorecard.md (#443) — security scorecard badge
P1 (High Priority):
- 2026-03-29-query-fingerprinting.md (#444) — SQL normalization + SHA-256 fingerprints
- 2026-03-29-linter-expansion.md (#445) — L011-L030 safety/performance/naming rules
- 2026-03-29-dml-transforms.md (#446) — SET clause and RETURNING transforms
- 2026-03-29-cbinding-hardening.md (#447) — C binding coverage + stress tests
- 2026-03-29-advisor-expansion.md (#453) — OPT-009 through OPT-020 advisor rules
P2 (Medium Priority):
- 2026-03-29-sql-parser-additions.md (#450, #454, #455, #456) — DDL formatter, CONNECT BY, SAMPLE, PIVOT/UNPIVOT
- 2026-03-29-schema-introspection.md (#448) — live DB schema introspection (Postgres, MySQL, SQLite)
- 2026-03-29-integrations.md (#451, #452) — OpenTelemetry + GORM sub-modules
- 2026-03-29-sql-transpilation.md (#449) — SQL dialect transpilation API
P3 (Low Priority):
- 2026-03-29-p3-items.md (#458, #459, #460) — CLI watch registration, pool stats, JSON functions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(linter): add safety (L011-L015), performance (L016-L023), naming (L024-L030) rules (#445)
Expand linter from 10 to 30 rules across three new sub-packages:
Safety (L011-L015):
- L011: DELETE without WHERE (error)
- L012: UPDATE without WHERE (error)
- L013: DROP without IF EXISTS (warning)
- L014: TRUNCATE TABLE warning
- L015: SELECT INTO OUTFILE/DUMPFILE (error, text-level)
Performance (L016-L023):
- L016: SELECT * (warning)
- L017: Missing WHERE on full-table SELECT (warning)
- L018: Leading wildcard LIKE '%...' (warning)
- L019: NOT IN (subquery) NULL risk (warning)
- L020: Correlated subquery in SELECT list / N+1 (warning)
- L021: OR instead of IN for same column (warning)
- L022: Function on indexed column in WHERE (warning)
- L023: Implicit cross join via comma tables (warning)
Naming/style (L024-L030):
- L024: Table alias required in multi-table queries (warning)
- L025: Reserved keyword used as identifier (warning)
- L026: Implicit column list in INSERT (warning)
- L027: UNION instead of UNION ALL (warning)
- L028: LIMIT without ORDER BY (warning)
- L029: EXISTS/IN subquery can be a JOIN (warning)
- L030: DISTINCT on many columns (warning)
All rules: AST-based where possible, visitor pattern for deep traversal,
no auto-fix for destructive/semantic changes, TDD with violation and
no-violation test cases, race-detector clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(linter): address PR #467 review feedback
- Add DropSequenceStatement case arm to L013 (drop_without_condition)
- Extend function_on_column visitor to traverse HAVING clauses and CTEs
- Remove unnecessary join := join copy in range loop
- Use neutral location instead of misleading sel.Pos in reserved_keyword_identifier
- Keep OR-to-IN threshold at 3 (consistent with existing tests)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini-2655.local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 43ccdf5 commit be53bcd
File tree
27 files changed
+2939
-0
lines changed- pkg/linter
- rules
- naming
- performance
- safety
27 files changed
+2939
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
242 | 267 | | |
243 | 268 | | |
244 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments