Repository navigation
Review pull requests that only delete files - #34
Conversation
A pull request whose only changes are file deletions was skipped as having no reviewable changes, so it never got a review or an approval. It is now reviewed: the removed lines are shown to the reviewer, which is told to search for what still depends on them. Findings there cannot sit on a changed line, so they are listed in the summary and withhold approval when they would have blocked it. A deletion of a path the filters or default ignores exclude still skips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3M7tsPz9Z383BKxKBMttQ Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
🟢 Tier S · Ready to mergeThis PR lets reviews proceed when a pull request only removes reviewable files: filtering happens before deleted files are classified, and the removed diff is included in the reviewer prompt within the diff budget. It adds guidance to look for remaining references, makes qualifying unplaceable findings and truncated deletion diffs withhold approval, and applies path-specific instructions to removed files. Tests cover filtering, deletion-only approvals, unplaceable findings, path instructions, and diff-budget truncation. Latest changes: The newest commits apply path instructions to removed files and ensure unplaced findings below
📂 Walkthrough · 4
Reviewed the commits since |
Withhold approval when removed lines did not fit in the prompt, apply minSeverity to unplaced findings before they block approval, and match per-path instructions against removed files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3M7tsPz9Z383BKxKBMttQ Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
Requested by Torsten · project thread
Why
filterFilesexcluded every deleted file, so a pull request that only deletes files ended with no included files andrunReviewskipped it as "No reviewable changes". Such PRs (e.g. the Dependabot-config removals) never got a review, and so never an approval. hansi.codes has the same behaviour.What changes
filters.ts): path filters and default ignores are checked first, sodeletednow marks only a removal the review would otherwise cover. Deleting a lockfile or a filtered path still reads asignored by default/path filterand still skips.review.ts): when nothing is included but reviewable files were removed, the review runs. The removed lines go into the prompt (within the diff budget), and the prompt tells the reviewer to grep for code, config, workflows, scripts and docs that still depend on what was deleted.decideVerdict(blocking severity or a bug finding), approval is withheld with a reason, so Hansi never approves a deletion it found a problem with.Tests
Added in
core.test.ts: filter reasons for removals, a deletion-only review that approves with the removed lines in the prompt, and one that withholds approval for an unplaceable bug finding.bun run lint,bun run checkandbun run test(364 pass) are green.Generated by Claude Code