From 96e1d6f8c25f1b584e11f6a5971ccdd76cf6b6a7 Mon Sep 17 00:00:00 2001 From: Pawan Singh Kapkoti <42340841+Pawansingh3889@users.noreply.github.com> Date: Sat, 2 May 2026 13:17:24 +0100 Subject: [PATCH 1/2] release: v0.7.0 contracts pack, schema-snapshot, validate-contract --- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 4 ++++ README.md | 10 +++++----- ROADMAP.md | 11 ++++++++--- pyproject.toml | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b4ccb6..5067eb2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: # Runs sql-sop on the project's own fixtures + any staged .sql files # so a regression in a rule is caught before it ships. - repo: https://github.com/Pawansingh3889/sql-guard - rev: v0.6.2 + rev: v0.7.0 hooks: - id: sql-sop args: [--severity, error] diff --git a/CHANGELOG.md b/CHANGELOG.md index ae58292..df28f16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ a deprecation window (see `GOVERNANCE.md` § Scope discipline). ## [Unreleased] +## [0.7.0] - 2026-05-02 + +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. + ### Added - **W014 `case-without-else`** - warns when a `CASE ... END` block has diff --git a/README.md b/README.md index ec0510b..0d71962 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ One bad SQL query can delete production data, expose customer records, or bring | | | |---|---| -| Rules | 43 (10 errors, 28 warnings, 5 Python-source) | -| Tests | 152 | +| Rules | 43 (10 errors, 28 warnings, 5 Python-source); 48 with `--contract` | +| Tests | 210 | | Coverage | 86% | | Scan speed | 0.08s across 200 files | | PyPI downloads | 500+/month | -| Version | 0.6.2 | +| Version | 0.7.0 | ### Fluent API (v0.2.0) @@ -43,7 +43,7 @@ print(result.summary()) # "1 error, 0 warnings in 1 statement" --- -Fast, rule-based SQL linter. 43 rules (38 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. +Fast, rule-based SQL linter. 43 rules (38 SQL + 5 Python), with an optional Contracts pack (5 schema-aware rules) when you supply `--contract path.yml`. 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. 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**. @@ -132,7 +132,7 @@ You want both. # .pre-commit-config.yaml repos: - repo: https://github.com/Pawansingh3889/sql-guard - rev: v0.6.2 + rev: v0.7.0 hooks: - id: sql-guard args: [--severity, error] # only block on errors locally diff --git a/ROADMAP.md b/ROADMAP.md index cfe977a..5a1e68c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,13 +2,18 @@ This is the maintainer's working roadmap. It tells you what's likely to land in upcoming releases, what's deliberately out of scope, and where contributions are most welcome. It's a living document — open an issue to discuss anything that surprises you. -Last updated: 2026-04-27. +Last updated: 2026-05-02. ## Current release -**v0.6.x** is in maintenance. Headline features as of v0.6.1 on PyPI: 38 rules (33 SQL + 5 Python), T-SQL safety pack (T001-T005), migration guards, inline `-- sql-guard: disable=...` directives, `.sql-guard.yml` config, `--changed-only` flag, SARIF 2.1.0 output for GitHub Code Scanning, libCST scanner for Python source. +**v0.7.0** is the current PyPI release. Headline additions over v0.6.x: -`main` is at 39 rules after [W013 window-without-partition](https://github.com/Pawansingh3889/sql-guard/pull/21) merged 2026-04-26. **v0.6.2 patch release pending** to ship W013 to PyPI users. +- **Contracts pack (C001-C005)** — schema-aware linting against a YAML data contract. Opt-in via `--contract path.yml`; silent without it. +- **`schema-snapshot` subcommand** — bootstrap a contract from a live database via SQLAlchemy introspection. Requires the `[snapshot]` extra. +- **`validate-contract` subcommand** — validate the contract YAML before running rules, CI-friendly. +- Three community-contributed rules: **W014 `case-without-else`** (@hellozzm), **W015 `join-function-on-column`** (@mvanhorn), **W022 `cross-join-explicit`** (@vibeyclaw). + +Total: 43 rules in the core registry (10 errors, 28 warnings, 5 Python-source), growing to 48 (12 errors, 31 warnings, 5 Python-source) when `--contract` is supplied. ## v0.7 — Performance Rules Pack diff --git a/pyproject.toml b/pyproject.toml index 343f948..1d76779 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "sql-sop" -version = "0.6.2" +version = "0.7.0" description = "Fast rule-based SQL linter. Pre-commit hook + GitHub Action + CLI." readme = "README.md" license = "MIT" From 1d896a7eed045f282d56dec0a84d241f5f3e5cdb Mon Sep 17 00:00:00 2001 From: Pawan Singh Kapkoti <42340841+Pawansingh3889@users.noreply.github.com> Date: Sat, 2 May 2026 13:24:46 +0100 Subject: [PATCH 2/2] docs(changelog): add Unreleased placeholder to satisfy pr-sop changelog-required gate --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df28f16..c42fb8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ a deprecation window (see `GOVERNANCE.md` § Scope discipline). ## [Unreleased] +_Nothing yet. Next release will track post-v0.7.0 work._ + ## [0.7.0] - 2026-05-02 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.