Skip to main content

Custom Python lint rules — AST-based, pre-commit-friendly, hypermodern defaults

Project description

sarj-python-lint

Custom Python lint rules via stdlib ast. Designed for pre-commit. For SQL rules see sarj-sql-lint.

uv tool install sarj-python-lint

Pre-commit

- repo: https://github.com/sarj-ai/standards
  rev: python-v0.2.0
  hooks:
    - id: sarj-no-sequential-await
    - id: sarj-inefficient-string-concat-in-loop
    - id: sarj-prefer-discriminated-union
    - id: sarj-prefer-str-enum
    - id: sarj-no-fat-try-blocks
    - id: sarj-pydantic-at-boundaries
    - id: sarj-prefer-class-row
    - id: sarj-prefer-timedelta-for-durations
    - id: sarj-prefer-struct-over-namedtuple
    - id: sarj-no-comment-cruft
    - id: sarj-no-fstring-in-log

CLI

sarj-python-lint check --rule no-sequential-await path/to/file.py
sarj-python-lint list-rules

Diagnostic format is path:line:col: CODE message — Ruff-compatible.

Suppression

Inline # sarj-noqa: SARJ00X — <reason> on the offending line.

Each rule's source under src/sarj_python_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_python_lint-0.7.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

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

sarj_python_lint-0.7.0-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file sarj_python_lint-0.7.0.tar.gz.

File metadata

  • Download URL: sarj_python_lint-0.7.0.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for sarj_python_lint-0.7.0.tar.gz
Algorithm Hash digest
SHA256 b110f85e26037523f3cb096b4340a9f842a3301937b9ff8bfea3092db5c1fae5
MD5 dc071e032fbe99720c36b82e2961ce43
BLAKE2b-256 e6bfd33622c5af24aa18886b663a2824b6a9be16aa59f2dde01655be9f2f2e45

See more details on using hashes here.

Provenance

The following attestation bundles were made for sarj_python_lint-0.7.0.tar.gz:

Publisher: release.yml on sarj-ai/standards

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sarj_python_lint-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sarj_python_lint-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf797147e31f5de3f03384e8a7664234142b28d728e351bdf1a805b9838661dd
MD5 444dc284d17443ec7e1cd8f1a9780c66
BLAKE2b-256 0c596bf77f2b3b7588da623dba359d4dee809346dacb0f5eb499fbd7b57b6f4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sarj_python_lint-0.7.0-py3-none-any.whl:

Publisher: release.yml on sarj-ai/standards

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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