Skip to content

fix(rust): implement DeadCodeDetector to unbreak main#8

Merged
cffls merged 1 commit intomainfrom
fix/rust-deadcode-detector
May 5, 2026
Merged

fix(rust): implement DeadCodeDetector to unbreak main#8
cffls merged 1 commit intomainfrom
fix/rust-deadcode-detector

Conversation

@cffls
Copy link
Copy Markdown
Collaborator

@cffls cffls commented May 5, 2026

Summary

  • *rustanalyzer.Language was missing DeadCodeDetector(), so go install github.com/0xPolygon/diffguard/cmd/diffguard@latest has been failing since cbf402d (2026-04-29). This broke downstream consumers — e.g. bor's Quality metrics CI.
  • Returning nil is the supported "no detector" path: internal/deadcode/deadcode.go:31 already emits a PASS section explaining the language has no detector wired up.

Why this slipped through

PR #7 added DeadCodeDetector() to lang.Language and updated Go + TS. PR #4 (Rust analyzer) branched from a pre-#7 main and merged second with no textual conflict — its CI never saw the merged combination, and main's post-merge CI run (25134342922) failed silently. Worth enabling "require branches up to date before merge" to prevent the same semantic conflict pattern.

Test plan

  • make build clean
  • make test all green (incl. internal/lang/rustanalyzer)
  • ./diffguard . exits 0

🤖 Generated with Claude Code

PR #7 added DeadCodeDetector() to lang.Language; PR #4 (Rust analyzer)
branched from a pre-#7 main and merged without re-running CI on the
merged result, breaking the build on main and any downstream
go install ...@latest.

Returning nil is the supported "no detector" path
(internal/deadcode/deadcode.go:31 emits a PASS section explaining the
language has no detector wired up).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cffls cffls merged commit a34e0b2 into main May 5, 2026
6 checks passed
@cffls cffls deleted the fix/rust-deadcode-detector branch May 5, 2026 18:24
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