[dead-code] chore: remove dead functions — 4 functions removed - #49357
Conversation
Remove 4 unreachable functions identified by deadcode analyzer: - checkForUpdates (pkg/cli/update_check.go) - formatTableHeaderWithTTY (pkg/console/console.go) - formatErrorTextWithTTY (pkg/console/console.go) - NewPermissionsIssuesWriteDiscussionsWritePRWrite (pkg/workflow/permissions_factory.go) Also removed exclusive tests for the deleted functions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis. Warning threat detection engine error DetailsThe threat detection engine failed to produce results. Review the workflow run logs for details. |
|
✅ PR Code Quality Reviewer completed the code quality review. Warning threat detection engine error DetailsThe threat detection engine failed to produce results. Review the workflow run logs for details. |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ Warning threat detection engine error DetailsThe threat detection engine failed to produce results. Review the workflow run logs for details. |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100). |
There was a problem hiding this comment.
Pull request overview
Removes four unused helper functions and their obsolete unit tests.
Changes:
- Removes unused update-check and console-formatting wrappers.
- Removes an unused permissions factory and associated tests.
Show a summary per file
| File | Description |
|---|---|
pkg/cli/update_check.go |
Removes the unused synchronous update-check wrapper. |
pkg/cli/update_check_test.go |
Removes tests specific to that wrapper. |
pkg/console/console.go |
Removes two unused TTY formatting helpers. |
pkg/console/console_formatting_test.go |
Removes tests for those helpers. |
pkg/workflow/permissions_factory.go |
Removes an unused permissions factory. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
|
Warning threat detection engine error DetailsThe threat detection engine failed to produce results. Review the workflow run logs for details. 🧪 Test Quality Sentinel Report✅ Test Quality Score: N/A — Deletions Only
📊 Summary
Modified test files:
Verdict
|
There was a problem hiding this comment.
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
Details
The threat detection engine failed to produce results.
Review the workflow run logs for details.
Clean dead-code removal — all deleted functions were unused and their tests covered only those removed functions. Build and vet pass per PR description. LGTM.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 13.5 AIC · ⊞ 5.3K
There was a problem hiding this comment.
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
Details
The threat detection engine failed to produce results.
Review the workflow run logs for details.
✅ Verified clean — approving
All 4 removed functions (checkForUpdates, formatTableHeaderWithTTY, formatErrorTextWithTTY, NewPermissionsIssuesWriteDiscussionsWritePRWrite) confirmed dead: no remaining references anywhere in the repo (grep across .go/.md/.yml), no reflection/string-keyed dispatch, no partial removal (their shared helpers like applyStyleWithTTY and checkForUpdatesWithContext remain in active use elsewhere). Independently re-ran go build ./... and go vet ./... — both pass clean.
Details
checkForUpdateswas a thin wrapper delegating tocheckForUpdatesWithContext, which is still called via a function-variable indirection elsewhere and covered by its own tests.- The two console TTY formatting helpers were only used by their own now-removed tests;
applyStyleWithTTY(the underlying primitive) is still used by other call sites. NewPermissionsIssuesWriteDiscussionsWritePRWritewas unreferenced; allNewPermissions*factories are invoked by direct Go identifier, not by name/reflection, so removal cannot silently break dynamic dispatch.- No additions in this diff, only deletions — nothing to review for new logic bugs.
🔎 Code quality review by PR Code Quality Reviewer · auto · 21.6 AIC · ⊞ 7.8K
Comment /review to run again
There was a problem hiding this comment.
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
Details
The threat detection engine failed to produce results.
Review the workflow run logs for details.
Skills-Based Review 🧠
Applied /codebase-design — clean dead-code removal, no issues found.
📋 Summary
- ✅ All 4 removed functions were unexported wrappers with no remaining callers
- ✅ Corresponding tests removed in lockstep — no orphaned test coverage
- ✅ Build, vet, and fmt verified by author
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 15.5 AIC · ⊞ 7K
Comment /matt to run again
|
Warning threat detection engine error DetailsThe threat detection engine failed to produce results. Review the workflow run logs for details. Hey 👋 — thanks for the dead code cleanup! This PR looks great and is ready for review. Here's what stands out: ✅ Well-focused — removes 4 dead functions and their corresponding tests cleanly This aligns perfectly with the project's agentic development workflow. The PR is in great shape and ready for maintainer review.
|
|
Warning threat detection engine error DetailsThe threat detection engine failed to produce results. Review the workflow run logs for details. @copilot please run the Failed checks: Run details: https://github.com/github/gh-aw/actions/runs/30669315501
|
PR Finisher summary
Actions taken: No code changes were needed. Local validation ( Hand-off: CI must be re-triggered by a maintainer (close/reopen PR or |
|
@copilot doesn't compile do a background checkForUpdates ? |
Yes —
The removed |
|
🎉 This pull request is included in a new release. Release: |
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
Details
The threat detection engine failed to produce results.
Review the workflow run logs for details.