Skip to content

fix(rules): ignore callers that the same diff deletes in index-breaking-change - #795

Merged
ajianaz merged 1 commit into
developfrom
fix/breaking-change-callers-removed-too
Nov 17, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/breaking-change-callers-removed-too

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

index-breaking-change (scan_breaking_changes in src/engine/index_scanner.rs) now drops, from the callers it counts, those whose call site is one of the lines the diff removes (matched by file and old line number; a deleted file contributes all its lines). The removal is reported only if a caller remains, and the message then counts and names only the remaining ones.

Why

The index predates the change, so a helper deleted together with its only caller was reported as "breaks 1 caller", a major finding that blocks the Cora Review check and the commit gate. The staged diff of the dead-code cleanup (#790) hit exactly that: read_yaml_config and write_yaml_config were flagged for callers the same diff deletes. Closes #794.

Testing

  • Three new tests, red before the change: the only caller is removed in the same diff; one caller stays and one is removed (one finding, naming only the remaining caller); a deleted file takes its callers with it. The existing tests (a real removal still fires, rename, move, signature drift) still pass.
  • Measured on a real change: the staged diff of the dead-code removal (about 500 lines removed, index built on develop) had 2 major findings before this change and none after.
  • cargo test --features tree-sitter: 1556 passed, 0 failed; cargo fmt --all -- --check and clippy with -D warnings clean; Cora review of the staged diff: no findings.

@ajianaz
ajianaz merged commit d21788e into develop Nov 17, 2026
16 checks passed
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.

fix(rules): index-breaking-change flags a removal whose callers are deleted in the same diff

1 participant