Custom SQL lint rules for Postgres migrations — sqlfluff + pygrep, pre-commit-friendly.
Project description
sarj-sql-lint
Custom SQL lint rules for Postgres migrations. AST-based via sqlfluff for the SARJ101 rule + zero-dependency pygrep regex hooks for migration-hygiene checks. Designed for pre-commit.
uv tool install sarj-sql-lint
Pre-commit
- repo: https://github.com/sarj-ai/linting
rev: sql-v0.1.0
hooks:
- id: sarj-enforce-timestamptz
files: '\.sql$'
- id: sarj-ban-postgres-enums
files: '\.sql$'
- id: sarj-ban-create-trigger
files: '\.sql$'
- id: sarj-prefer-text-over-varchar
files: '\.sql$'
CLI
sarj-sql-lint check --rule enforce-timestamptz svcs/db/db/migrations/*.sql
sarj-sql-lint list-rules
Diagnostic format is path:line:col: CODE message — Ruff-compatible.
Each rule's source under src/sarj_sql_lint/rules/ carries its own description and diagnostic message.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sarj_sql_lint-0.1.0.tar.gz.
File metadata
- Download URL: sarj_sql_lint-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed5a29a461c106becadecc1a217d7ebc428df37409904cc69f7f426c1cfe2d1d
|
|
| MD5 |
bf53127d46225814d04ac0e8dfb8b785
|
|
| BLAKE2b-256 |
489ea47c4e74f5702f1beb42819732ecc26784084705ebe8315eb320e6c9409d
|
File details
Details for the file sarj_sql_lint-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sarj_sql_lint-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8058bdccd19cd61a5deb04dd3fb7421323ee776dfe37bd31a23252df79926b8
|
|
| MD5 |
a61f48aaf0decd53d60b1820eee4e28d
|
|
| BLAKE2b-256 |
f7b029f15cdfa02f8234658e50d002b155cde7cf584b76c44c940b80149209eb
|