Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sarj_sql_lint-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sarj_sql_lint-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

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

Hashes for sarj_sql_lint-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed5a29a461c106becadecc1a217d7ebc428df37409904cc69f7f426c1cfe2d1d
MD5 bf53127d46225814d04ac0e8dfb8b785
BLAKE2b-256 489ea47c4e74f5702f1beb42819732ecc26784084705ebe8315eb320e6c9409d

See more details on using hashes here.

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

Hashes for sarj_sql_lint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8058bdccd19cd61a5deb04dd3fb7421323ee776dfe37bd31a23252df79926b8
MD5 a61f48aaf0decd53d60b1820eee4e28d
BLAKE2b-256 f7b029f15cdfa02f8234658e50d002b155cde7cf584b76c44c940b80149209eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page