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, 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.38.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.38.0
File Size Uploaded Provenance Actions
repostyle-0.38.0.tar.gz 290.6 kB With provenance Details for repostyle-0.38.0.tar.gz

Built distribution (wheel)

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

Total release size: 552.8 kB

Release files / repostyle-0.38.0.tar.gz

Download URL repostyle-0.38.0.tar.gz
Size 290.6 kB
Tags Source
SHA-256 checksum
How to use checksums
51b25b1a54add941ab89560e42e942b19c6731cbc69e4c4f59692492ee98342d
BLAKE2b-256 checksum
How to use checksums
1078a64eaaad8047b645b59e8d946c6496f5f7c9435996f09a650bda5569341f
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 13, 2026.

Transparency log

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

Download URL repostyle-0.38.0-py3-none-any.whl
Size 262.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
050ac4e0ca19da1bf6bb5b493973d22d25778f0b0c4ae93815ce52d0a31c22fb
BLAKE2b-256 checksum
How to use checksums
6cabe7a19b85b777785779aa1e16e16c3609e54570428d68b53b6a4d53264a71
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 13, 2026.

Transparency log

Security for repostyle 0.38.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.38.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 13, 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