Skip to main content

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 a run(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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pr_sop-0.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pr_sop-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file pr_sop-0.1.0.tar.gz.

File metadata

  • Download URL: pr_sop-0.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pr_sop-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d8fe1edaf499a3f3ec235cdae0c19f3ff996fc9189def6a7994ae1b4b194cba
MD5 c359646488f09d056c9938b6d4100a06
BLAKE2b-256 48b112cbd58b9bc3b59dcf72140a2e8d6f1756b89b05c8b4943f2107ad7a0540

See more details on using hashes here.

File details

Details for the file pr_sop-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pr_sop-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pr_sop-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afc78cba5d15990e50315246fd5c6c506b06d88662d7cc69e0682a72e1b0c755
MD5 81f3a117e040c9d0a86052bbdfe15a4d
BLAKE2b-256 572a9594f96af9b99111090f02c2db267ec68d067fa27e9481791fb5bd3cec3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page