Skip to main content

repostyle

repostyle enforces repository conventions that ruff cannot express. It ships 67 RSnnn rules, a shared ruff configuration, and optional hooks for the house lint gate suite.

The linter has no runtime dependencies. Most rules inspect Python with the standard-library AST and tokenizer. Comment rules also inspect # comments in TOML, YAML, and shell files.

Install

pip install repostyle
pip install "repostyle[gates]" # Include the pinned third-party gate tools.

Run it without installing with uvx repostyle ..

Add the pre-commit hook

repos:
  - repo: https://github.com/gradienthealth/repostyle
    rev: repostyle-vX.Y.Z # Pin the latest release tag.
    hooks:
      - id: repostyle

The hook checks staged Python, Markdown, TOML, YAML, and shell files. A repo can select rules and tune their behavior in pyproject.toml:

[tool.repostyle]
select = ["RS001", "RS004", "RS005", "RS009", "RS010"]
ignore = []
error = ["RS034"]
warnings-as-errors = false

An absent or empty table enables every rule. select minus ignore determines the enabled set. error promotes specific advisory rules, while warnings-as-errors promotes every warning.

Common commands

repostyle .                         # Check a tree.
repostyle --fix .                   # Apply safe mechanical fixes.
repostyle --no-baseline .           # Include grandfathered findings.
repostyle --write-baseline .        # Record an inherited backlog.
repostyle --update-baseline .       # Remove fixed debt from the record.
repostyle explain RS010             # Show one rule's guidance.
repostyle explain --all             # Show every rule card.

--fix returns a non-zero status when it changes a file so pre-commit can stop for review and restaging.

Documentation

Guide Use it for
Rule reference Rule ids, severities, scope, and ruff overlap.
Configuration Selection, baselines, exclusions, suppressions, fixers, and per-rule settings.
Gate suite The shared ruff base and optional third-party hooks.
Judgment conventions Review decisions that a linter cannot make.
Google Cloud naming Resource identifiers and current product names.
Development Local setup, architecture, testing, and releases.

A finding carries the short remediation. Run repostyle explain RSnnn when a rule needs rationale or examples.

License

Apache-2.0. See LICENSE.

Metadata

Release files for repostyle 0.36.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repostyle 0.36.0
File Size Uploaded Provenance Actions
repostyle-0.36.0.tar.gz 239.9 kB With provenance Details for repostyle-0.36.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for repostyle 0.36.0
File Interpreter ABI Platform Actions
repostyle-0.36.0-py3-none-any.whl Python 3 none any Details for repostyle-0.36.0-py3-none-any.whl

Total release size: 451.9 kB

Release files / repostyle-0.36.0.tar.gz

Download URL repostyle-0.36.0.tar.gz
Size 239.9 kB
Tags Source
SHA-256 checksum
How to use checksums
db1692a416efbf20cfa4545dcc0720232ce1c9357df3e547db6cabc240866192
BLAKE2b-256 checksum
How to use checksums
ede615b9b5a4bac1540af58800171b13e7df46c3586365861d7f163d580e50d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / repostyle-0.36.0-py3-none-any.whl

Download URL repostyle-0.36.0-py3-none-any.whl
Size 212.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b9c46d79db63eade326eacae5149a771f47fac7a3d2ccd4413ea90cc357ca70
BLAKE2b-256 checksum
How to use checksums
eb2fb7a4733afa385153a55342f3ff88d67125a875aceb33f9effe42ab5249fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Security for repostyle 0.36.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for repostyle-0.36.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page