Skip to content

Add goodcodereview-lint: run the gates cards name, report by card - #28

Merged
n0nuser merged 2 commits into
mainfrom
linter
Nov 4, 2026
Merged

n0nuser merged 2 commits into
mainfrom
linter

Conversation

@n0nuser

@n0nuser n0nuser commented Nov 4, 2026

Copy link
Copy Markdown
Owner

What changed

A new folder, lint/, holds a separate PyPI package, goodcodereview-lint, with one command, gcr-lint. It is not published.

  • gcr-lint check [paths] runs the ruff rules that cards name in tool_gate, then reports each finding as a card: id, severity, how well the card is backed, and whether the rule is the card's whole check (full) or part of it (partial).
  • Every run ends with how many stable cards the rules cover (9 of 202 in this release) and that a clean run is not a review.
  • gcr-lint coverage lists the covered cards. gcr-lint config prints a ruff config that selects the same rules. --fail-on sets the exit code.
  • It adds no detection of its own. The map is lint/src/goodcodereview_lint/data/gates.tsv; data/cards.json is a snapshot of the cards, rebuilt with python3 lint/scripts/snapshot.py.
  • test/test_lint.py fails when the map points at a missing card or the snapshot drifts from the built cards, and runs ruff on small samples.

Why Python, not Rust

The tool orchestrates ruff, which is already Rust, so its own speed does not matter. Python installs with pipx or uvx and takes a contributor in minutes. Rust would pay off only for our own multi-language detection engine; that is a later decision.

Checks

ruff, mypy, uv run pytest (159 tests) and a wheel build pass. I installed the wheel in an isolated uvx environment and ran gcr-lint check and coverage on a sample. Nothing was published to PyPI.

Review notes

Coverage is small on purpose and is printed on every run. The map covers nine cards today; adding rows is the way to grow it.

🤖 Generated with Claude Code

https://claude.ai/code/session_013wy5PKFLRYL7DhA4rqJ7kz

n0nuser and others added 2 commits November 4, 2026 21:10
lint/ holds a separate PyPI package. gcr-lint check runs the ruff rules that
cards name in tool_gate and reports each finding as a card, with its severity
and how well it is backed. Every run ends with how many stable cards the rules
cover (9 of 202 in this release) and that a clean run is not a review.
gcr-lint coverage lists them; gcr-lint config prints a ruff config.

It adds no detection of its own. The map from rule codes to cards is
src/goodcodereview_lint/data/gates.tsv, and a repository test fails when it or
the card snapshot drifts from the cards. It is not published.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013wy5PKFLRYL7DhA4rqJ7kz
@n0nuser
n0nuser merged commit 879c4b9 into main Nov 4, 2026
3 checks passed
@n0nuser
n0nuser deleted the linter branch November 4, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant