Repository navigation
fix: sdlc ci runs a non-mutating ruff verdict (#48) - #49
Conversation
Ruff lived only in the commit tier, where it runs with --fix, and ci is push minus the reviewers, so `sdlc ci` judged no lint at all. A new built-in `lint` -- `ruff check --no-fix` plus `ruff format --check`, read-only -- leads the push tier and ci inherits it. Measured on the 36 consuming repos: 35 clean, data-collector has one fixable I001. Opt-out is the existing `[tool.sdlc.push] skip`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Y1jgFUuEitySo4qtRTaQ
| ok "ruff-check fails on broken code" | ||
| fi | ||
| # A finding ruff could fix is still a finding here -- that is the whole of #48. | ||
| podman run --rm -v "$FIXTURE:/repo:ro,z" -w /repo --entrypoint="" \ |
There was a problem hiding this comment.
MEDIUM (Test Coverage): The lint integration checks only that the combined command exits nonzero on a fixture with both an import violation and bad formatting. Its output is discarded, so the test would still pass if t_lint stopped after the first failing tool or never ran ruff format --check. The clean-fixture test likewise does not establish that both tools ran. This leaves the promised behavior that both kinds of findings are reported unverified.
Suggestion: Capture the lint output for the failing fixture and assert it contains diagnostics from both ruff check and ruff format --check, or otherwise verify both subprocesses run even when the first returns nonzero.
Evidence:
podman run --rm -v "$FIXTURE:/repo:ro,z" -w /repo --entrypoint="" \
"$IMAGE" sdlc lint >/dev/null 2>&1 && rc=0 || rc=$?
if [ "$rc" -eq 1 ]; then
ok "lint fails on code ruff would fix, without fixing it"
There was a problem hiding this comment.
Fixed. The contract test now captures lint's output and requires both an F401 from ruff check and ruff format's "1 file would be reformatted" summary. If t_lint stopped after the first tool or skipped the formatter, the second string would be missing and the test would fail. It passes against the image with the new sdlc layered in.
There was a problem hiding this comment.
fixed in a4ec1a2
The contract test now requires lint's output to include an F401 and ruff format's "1 file would be reformatted".
Answers the Gatehouse finding on #49: an exit of 1 alone would still pass if lint stopped after ruff check and never ran the formatter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Y1jgFUuEitySo4qtRTaQ
There was a problem hiding this comment.
Gatehouse found no issues.
Reviewed 1 commit since e5dc255 (incremental).
It runs python-sdlc as of gatehouse#134; constitution#138 drops its sdlc_exempt entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Y1jgFUuEitySo4qtRTaQ
There was a problem hiding this comment.
Gatehouse found no issues.
Reviewed 1 commit since a4ec1a2 (incremental).
Review of #49: a repo's [tool.ruff] fix-only = true overrode --no-fix, so ruff exited 0 having reported nothing; --no-fix-only restores the verdict. A syntax error is 1 to ruff check and 2 to the formatter, and max() turned that code finding into COULD NOT RUN; a finding from either tool now wins. Contract cases for each fault alone, both of which fail against the previous t_lint. No consumer sets fix-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Y1jgFUuEitySo4qtRTaQ
There was a problem hiding this comment.
Gatehouse found no issues.
Reviewed 1 commit since 108e78f (incremental).
8 of 8 agents served by google/gemini-3.1-flash-lite (primary unavailable).
|
Review (a143): APPROVE at 62cbbcd. This is a comment, not a formal review: this seat has no PR-review tool.
The ci output still doesn't name push-level skips. That gap predates this PR and is tracked in #50. 🤖 Generated with Claude Code |
Fixes #48.
Ruff lived only in the commit tier, where
ruff check --fixandruff formatpass anything fixable, andciis push minus the reviewers, so the requiredsdlc cijudged no lint at all. A--no-verifycommit reached a green check unlinted.This adds a built-in
lint:ruff check --no-fix --no-cache .thenruff format --check --no-cache .(both always run; exit is the worse of the two, so ruff's own 2 stays "cannot run"). It isimage-ro, not inWRITES_TREE, so push keeps its two lanes. It leads the push defaults and ci inherits it;[tool.sdlc.ci] skipcannot name it, per the existing XII rule.Rollout impact. Measured against all 36 consuming repos' default branches with the image's ruff 0.17.1: 35 clean,
data-collectorhas one fixable I001 (src/data_collector/pipeline.py). No new opt-out was needed:[tool.sdlc.push] skip = ["lint"]already removes it from both tiers. Called out in the CHANGELOG as able to turn a consumer red on its bump; under 0.x SemVer that makes the next release a minor (0.7.0).Tests:
tests/test_plan.py(lint in ci, read-only plan line, lanes unchanged, ci skip refused, push skip propagates) andtests/contract.sh(lint clean on a read-only fixture, exits 1 on fixable code without fixing it, push plan order). Both pass locally against the 0.6.3 image with the newsdlclayered in; shellcheck and the host contract pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01R7Y1jgFUuEitySo4qtRTaQ