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, and // comments in Java files once a repository opts Java in.
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.39.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| repostyle-0.39.0.tar.gz | 303.0 kB | With provenance | Details for repostyle-0.39.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| repostyle-0.39.0-py3-none-any.whl | Python 3 | none | any | Details for repostyle-0.39.0-py3-none-any.whl |
Total release size: 576.0 kB
Release files / repostyle-0.39.0.tar.gz
| Download URL | repostyle-0.39.0.tar.gz |
|---|---|
| Size | 303.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85d4751ba9b8b7de73dd91048a46ad9ba258ff2a6677af99d2e5653e2a4c1716
|
|
BLAKE2b-256 checksum How to use checksums |
40daf082c6b73c491c14432491ed39be45c43254e0bb441ca53451ab532cc1fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 20, 2026.
Transparency logRelease files / repostyle-0.39.0-py3-none-any.whl
| Download URL | repostyle-0.39.0-py3-none-any.whl |
|---|---|
| Size | 272.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
deac5c15f1c2297e6cdaf073743d320e58aeee1ec011fc317fd05a569a86c0ce
|
|
BLAKE2b-256 checksum How to use checksums |
ee2d4f786ac04664c2310d7932a6fdaa46f503a7660dd5f2fd92da817b3f02bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 20, 2026.
Transparency logSecurity for repostyle 0.39.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.
Attestation for repostyle-0.39.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 Nov 20, 2026.
Transparency logA 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.