repostyle is a stdlib-only linter for repository conventions that ruff cannot express. It publishes the repostyle CLI, a pre-commit hook, ruff-base.toml, and optional third-party gate hooks.
The rule implementation is authoritative. Read a check function's docstring before changing its behavior; docs/rules.md is the user-facing index, not a second specification.
Use the repository environment when one exists. The direct commands are:
PYTHONPATH=src python3 -m pytest
PYTHONPATH=src python3 -m repostyle.cli --no-baseline .
pre-commit run --all-filesThe unbaselined repostyle run must report no warnings or errors. The repository promotes warnings to errors in pyproject.toml.
src/repostyle/rules/owns checks, ids, dispatch, severities, explanation cards, and the public rule surface.runner.pyresolves configuration and scans files.cli.pyowns command parsing and reporting.baseline.pyandsuppressions.pyfilter known findings.languages/owns each language's syntax behind aLanguagerecord: comment scanning, the spans a block directive covers, test-file layout, and YAML folded prose._shared.pyowns shared parsing, configuration, and path behavior.tests/mirrors the behavior surfaces.docs/holds user reference and contributor guidance.
docs/development.md maps each public surface to its owner and lists the complete rule-change checklist.
- Keep internal functions and class helpers private.
- Do not introduce
Manager,Helper,Util, orUtilsclass suffixes. - Use descriptive Google-style docstrings in third-person present tense.
- State contracts and non-obvious invariants; omit implementation narration.
- Catch specific exceptions and keep one failure family per handler.
- Use strict type hints and absolute imports.
- Preserve public imports from
repostyle.rules. - Keep tests straight-line and assertion-driven. Prefer fakes over mocks.
- Parametrize scalar variations only when the cases exercise one contract.
Ruff and repostyle own mechanical style. Follow docs/judgment-conventions.md for decisions that need review rather than syntax.
- Keep the README focused on installation, first use, and navigation.
- Put rule ids and severities in
docs/rules.md. - Put runner options in
docs/configuration.md. - Put ruff and third-party gate setup in
docs/gates.md. - Put contributor workflows in
docs/development.md. - Update one owning page instead of repeating detail across several files.
AGENTS.md is the canonical agent guide. CLAUDE.md is a compatibility symlink and must continue to point here.
Do not edit the version in pyproject.toml; Release Please owns it. Pull request titles use Conventional Commits with a Linear ticket or NO-ISSUE in the scope. Never amend or force-push a shared branch.