Skip to main content

coop-review-core

Shared infrastructure for the coop-*-review family of offline, advisory standards linters (coop-sql-review, coop-dax-review, and future siblings).

It holds the tool-agnostic building blocks that were otherwise duplicated across each linter, so an infrastructure fix lands once instead of being copy-pasted (and silently drifting) between repos. Each linter keeps its own parsers, rules, Finding/Result model, and standards.md; it parameterizes the core with its own package name, tool name, and standards file.

What's in it

Module What it provides
coop_review_core.progress Stderr-only, TTY-gated scan progress (Progress, should_enable).
coop_review_core.diagnostics The Diagnostic model + processing-problem category constants.
coop_review_core.severity Severity ordering (SEVERITIES, severity_rank, at_or_above) + the stable, line-independent fingerprint.
coop_review_core.suppressions Inline <tool>:ignore directives + a fingerprint baseline (scan_directives, is_inline_suppressed, write_baseline, load_baseline).
coop_review_core.upgrade Self-update planning — the only networked part (build_plan, upgrade_command, apply_plan).
coop_review_core.config The rules.yml config layer + standards resolution (RuleConfig, apply_config, resolve_standards_path, standards_info).

Everything is deterministic and offline except upgrade (PyPI metadata / git fetch), and nothing here ever blocks a build.

How a linter uses it

from coop_review_core.config import RuleConfig, apply_config, resolve_standards_path
from coop_review_core.suppressions import scan_directives, is_inline_suppressed
from coop_review_core.upgrade import build_plan, upgrade_command

std = resolve_standards_path(user_path, BUNDLED_STANDARDS)          # tool passes its own bundled copy
rules = apply_config(all_rules(), RuleConfig.load(config_path))     # works on the tool's own Rule type
directives = scan_directives(file_text, tool="coop-sql-review")     # tool passes its own marker
plan = build_plan("coop-sql-review", __version__)                  # tool passes its name + version

apply_config is structural: it works on any rule dataclass with id / severity / default_enabled / params fields, so each linter keeps its own Rule.

Develop

make setup   # python3 -m venv .venv && pip install -e ".[dev]"
make test    # .venv/bin/pytest -q
make lint    # .venv/bin/ruff check . && .venv/bin/ruff format --check .

(No make? Each target is a one-liner — see the Makefile.) Use Python 3.10–3.13 for the venv — 3.14 doesn't process the editable install's .pth. If python3 is 3.14+, create the venv explicitly: python3.13 -m venv .venv.

Testing core changes against the linters

The consumer repos (coop-sql-review, coop-dax-review, assumed cloned side by side with this one under a single parent directory — substitute your parent for $HOME/Developer below) hold a non-editable installed copy of core in their .venvs, so an edit here is invisible to them until core is re-published and reinstalled. To run a consumer's tests (or CLI) against your local, unpublished core, shadow its installed copy — from the consumer repo:

PYTHONPATH="$HOME/Developer/coop-review-core/src:$PWD/src" .venv/bin/python -m pytest -q

PYTHONPATH beats site-packages, so the first entry shadows the installed core with this repo's src; $PWD/src keeps the consumer's own package importable next to it. Confirm the shadow took with ... -c "import coop_review_core; print(coop_review_core.__file__)" — it must print a path under this repo, not the consumer's site-packages.

Release = bump __version__ in src/coop_review_core/__init__.py (the single source — pyproject derives it), run make release-check, then tag vX.Y.Z; publish.yml refuses a tag that doesn't match __version__, builds, publishes to PyPI via trusted publishing, and cuts a GitHub Release. The tag push is the publish — releases happen only on an explicit request naming the version (agents: see AGENTS.md, "Version + release discipline").

Download files

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

Source Distribution

coop_review_core-0.3.0.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

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

coop_review_core-0.3.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file coop_review_core-0.3.0.tar.gz.

File metadata

  • Download URL: coop_review_core-0.3.0.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for coop_review_core-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d2638f52ee337c6de66e4a20f0142b222f825bbcfc28af72321490459f268f88
MD5 93ef45e213fe1bb6d9518bc977a368e2
BLAKE2b-256 a182ff54545c6404c88f7cedcd35a09b107b8270482937d86e80efc25fb8eddc

See more details on using hashes here.

Provenance

The following attestation bundles were made for coop_review_core-0.3.0.tar.gz:

Publisher: publish.yml on kabukisensei/coop-review-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coop_review_core-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coop_review_core-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17d7979465aaeb8879a0da6a07c9ac88654760115597f48a1487f28c465cf906
MD5 af1a5af6d987a4cf4ca6a284c7789ca6
BLAKE2b-256 81ba7063917399abbd7b30e86d92d3d913536273bb1846d80abbc8cd7eae6b82

See more details on using hashes here.

Provenance

The following attestation bundles were made for coop_review_core-0.3.0-py3-none-any.whl:

Publisher: publish.yml on kabukisensei/coop-review-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.10.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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