Repository navigation
fork-ci: fail clippy only on lines the PR changes - #16
thedancingdeveloper wants to merge 2 commits into
Conversation
thedancingdeveloper
left a comment
There was a problem hiding this comment.
Review: blocker (head be98bad)
The design is right: one file start count per hunk from git diff -U0, and a diagnostic fails only if its primary span overlaps a changed hunk with count > 0. Pure deletions are ignored, and jq stderr is still checked synchronously.
-
The awk hunk parser isn't portable.
sub("^+","",a[1])is an invalid ERE (+with nothing to repeat). I tested the exact program under mawk:regular expression compile failed (syntax error ^* or ^+). Ubuntu images commonly defaultawkto mawk; I haven't confirmed which awk the GitHub runner uses. Underset -o pipefailthat fails the step on every PR. Use regex literals:sub(/^\+/, "", a[1]), andsub(/^b\/codex-rs\//, "", file). Verified with mawk:cli/src/main.rs 2 1andcli/src/main.rs 6 1for a one-line change plus a one-line append. Or callgawkexplicitly after installing it. -
Probe evidence, required as with #11:
- (a) a lint on a changed line fails at
cargo clippy, naming that line; - (b) a lint elsewhere in the same changed file but outside the hunk passes the clippy step.
Link both runs. (b) is the case #11 couldn't handle.
- (a) a lint on a changed line fails at
Non-blocking: file names with spaces would split $4. There are none in the tree today, so a comment is enough.
thedancingdeveloper
left a comment
There was a problem hiding this comment.
Review (head 15b0b77): blocker 1 is fixed. The awk now uses regex literals sub(/^b\/codex-rs\//, "", file) and sub(/^\+/, "", a[1]), which is the form I verified under mawk. Still open: blocker 2, the probe evidence. Link (a) a lint on a changed line failing at cargo clippy and naming that line, and (b) a lint in the same changed file but outside every changed hunk passing clippy. Once both are linked and green or red as expected, this has no blockers.
15b0b77 to
b852357
Compare
A file-level gate still inherits a file's whole upstream lint debt: a PR editing one line of message_processor.rs was failed for a let_and_return elsewhere in that file. The gate now reads the changed line ranges from git diff -U0 and fails only when a warning or error's primary span overlaps one of them. A pure deletion (count 0) overlaps nothing.
b852357 to
e874aec
Compare
|
Blockers (head e874aec) Epic lead. The code is unchanged and correct:
Required, both on probe branches cut from this head (e874aec on fork/main b8011f5) so they run #16's workflow:
Link both runs and name the step each ended at. With those, this has no blockers. |
Summary
Test plan