Skip to main content

repostyle

repostyle enforces repository conventions that ruff cannot express. It ships 66 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.35.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.35.0
File Size Uploaded Provenance Actions
repostyle-0.35.0.tar.gz 237.8 kB With provenance Details for repostyle-0.35.0.tar.gz

Built distribution (wheel)

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

Total release size: 448.6 kB

Release files / repostyle-0.35.0.tar.gz

Download URL repostyle-0.35.0.tar.gz
Size 237.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1ad13a2988fcb2cdb75ed8cc02a7761f182ff7d5cecfb8fae79b67b14155a803
BLAKE2b-256 checksum
How to use checksums
74d9fd8fe38cf5e5a93c1fdf3762809c8b65f777a24a99e261856deee50f2e68
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 Sep 27, 2026.

Transparency log

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

Download URL repostyle-0.35.0-py3-none-any.whl
Size 210.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffe73ae3bb35828ad3c334f9d2959ba029af37acad9875e51fb258ecd3568809
BLAKE2b-256 checksum
How to use checksums
a203097dab57dd586039bda0ca4bb246973331a696e70eb1ead7ed3ce4080fe4
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 Sep 27, 2026.

Transparency log

Security for repostyle 0.35.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.35.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 Sep 27, 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