Opinionated PR governance checks. Config-driven, no LLM. Runs as pre-commit hook, CLI, or GitHub Action.
Project description
pr-sop
Opinionated PR governance checks. Config-driven, no LLM. Runs as a CLI, pre-commit hook, or GitHub Action.
Built by the author of sql-sop. Same naming, same philosophy: catch real drift fast, skip the ceremony.
What it checks (v0.1)
| ID | Default severity | What it catches |
|---|---|---|
changelog-required |
error | Files matching a glob pattern changed, but CHANGELOG.md wasn't updated, or the ## [Unreleased] section is missing/empty. |
version-consistency |
error | Version strings extracted from multiple files disagree. Catches the classic "bumped pyproject, forgot the __init__.py" drift. |
precommit-rev-matches-tag |
warning | rev: pins in README or .pre-commit-hooks.yaml don't match the latest git tag. |
Every check is optional and configured in .prsop.yml. Missing section means
the check is off.
Quick start
pip install pr-sop
Drop a .prsop.yml at the repo root:
checks:
changelog_required:
severity: error
paths:
- "src/**/*.py"
version_consistency:
severity: error
sources:
- file: pyproject.toml
pattern: '^version\s*=\s*"([^"]+)"'
- file: src/mypkg/__init__.py
pattern: '^__version__\s*=\s*"([^"]+)"'
precommit_rev_matches_tag:
severity: warning
files:
- README.md
- .pre-commit-hooks.yaml
Run:
pr-sop check --base origin/main
Exit code is 1 if any error fired, 0 otherwise. Warnings never fail CI.
GitHub Action
- uses: Pawansingh3889/pr-sop@v0.1.0
Findings surface as native check-run annotations in the PR Files tab plus a
table in the workflow summary. No API calls, no token setup beyond the default
GITHUB_TOKEN.
Why not Danger?
Danger is great when you want to write repo-specific rules in JavaScript. pr-sop is the opposite: three opinionated rules you turn on with a YAML block, no Dangerfile to maintain. If you need custom logic, use Danger. If you keep forgetting to bump the changelog, use pr-sop.
Design
- Checks are plugins (see
pr_sop/checks/base.py). Each has an id, a config model, and arun(ctx) -> list[Finding]. - No network calls. Reads your files, shells out to
git. - Config validated by pydantic v2. Typos fail fast, not mid-scan.
- Output: Rich terminal locally, workflow commands in Actions.
Status
v0.1.0, alpha. API will stabilise at v1.0.
Licence
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pr_sop-0.1.1.tar.gz.
File metadata
- Download URL: pr_sop-0.1.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8dca74d4553474ab7f94cdfe634fd8f3436dd7baa6533443bc26e1aadcb1c23
|
|
| MD5 |
509b4ca7e78dfb0c81e3fe83595c6537
|
|
| BLAKE2b-256 |
bfdb91a9201bab8e46140eee19944887401695253f4e44867f9fb31dfad6bdc2
|
File details
Details for the file pr_sop-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pr_sop-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b29c116b12b9266b04f2829b5ee788ab2c95ef6041a454ce5715f093c37149c7
|
|
| MD5 |
2ee8cafb05a22a69e2ffc517fcf921b9
|
|
| BLAKE2b-256 |
74052c2f59af9d1a751e90b1fee71d22589f31e0d0bb2ffe87a6c83c6d06a1f8
|