[dead-code] chore: remove dead functions — 1 function removed#28257
[dead-code] chore: remove dead functions — 1 function removed#28257
Conversation
The extractEngineConfig function was a thin wrapper around extractEngineConfigWithInferredEngine that was only called from test files. Tests now call extractEngineConfigWithInferredEngine directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🎉 Great work, Dead Code Removal Agent! This PR is a clean, focused removal of the
|
There was a problem hiding this comment.
Pull request overview
Removes an unreachable Go helper (extractEngineConfig) identified by static analysis, and updates tests to call the underlying function directly.
Changes:
- Deleted the dead wrapper function
extractEngineConfigfrompkg/cli/audit_expanded.go. - Updated
pkg/cli/audit_expanded_test.goto callextractEngineConfigWithInferredEnginedirectly.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/audit_expanded.go | Removes the dead extractEngineConfig wrapper function. |
| pkg/cli/audit_expanded_test.go | Updates tests to invoke extractEngineConfigWithInferredEngine directly. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
| if tt.expectNil && tt.awInfoContent == "" { | ||
| result := extractEngineConfig("") | ||
| result := extractEngineConfigWithInferredEngine("", "") | ||
| assert.Nil(t, result, "Should return nil for empty logs path") |
There was a problem hiding this comment.
The test is still named TestExtractEngineConfig, but it now directly calls extractEngineConfigWithInferredEngine (since extractEngineConfig was removed). Renaming the test (and any related subtest descriptions) would avoid confusion about which function/API is being exercised.
🧪 Test Quality Sentinel ReportTest Quality Score: 100/100✅ Excellent test quality
Test Classification Details
Analysis NotesThis PR removes the dead function
Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §24892766039
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 100/100. Test quality is excellent — 0% of new/modified tests are implementation tests (threshold: 30%). The single modified test is a well-structured table-driven behavioral test with proper assertion messages, build tags, and error/edge case coverage.
Dead Code Removal
This PR removes unreachable Go functions identified by the
deadcodestatic analyzer.Functions Removed
extractEngineConfigpkg/cli/audit_expanded.goTests Removed
None. Test files that called
extractEngineConfigwere updated to callextractEngineConfigWithInferredEnginedirectly (the function it was wrapping).Verification
go build ./...— passesgo vet ./...— passesgo vet -tags=integration ./...— passesmake fmt— no changes neededgo test -run TestExtractEngineConfig ./pkg/cli/...— passesDead Function Count
Automated by Dead Code Removal workflow — https://github.com/github/gh-aw/actions/runs/24888473465