chore: remove unused code [Y7KC6EG] - #26
Merged
Merged
Conversation
added 5 commits
August 25, 2026 05:07
Two struct fields were written but never read: - render.viewRow.HasTests: buildView assigned it on every summary row, but neither template mentions it — both render the preformatted .Tests string. render.Workspace.HasTests, the same-named field it was copied from, is still read and stays. - baseline.Comparison.HasTotalLine: Compare assigned it and nothing consumed it; the fail-on-drop check reads render.Summary.TotalDelta.HasLine. No import is freed and no branch is stranded by either removal; buildView still needs anyTests for the Total row's tests cell.
cameronnewman
marked this pull request as ready for review
August 25, 2026 05:12
Greptile SummaryThe PR removes two write-only struct fields without changing their observable behavior.
Confidence Score: 5/5The PR appears safe to merge because both removed fields were write-only and their behavioral paths remain intact. Repository consumers and embedded templates do not reference either removed field, while the retained fields and local aggregation continue to provide baseline and report behavior. Reviews (1): Last reviewed commit: "Remove ergates plan file" | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A full dead-code census of the module turned up far less than expected: every top-level function, type, constant and variable is referenced somewhere, so the only genuinely unreferenced code is two struct fields that were assigned but never read. Both are removed. The census itself is the substance of this change —
staticcheck -checks U1000 ./...reports nothing, and a per-symbolgit grep -csweep over every declaration in every non-test.gofile found no declaration-only and no test-only symbol.Changes
internal/render/view.go— removedviewRow.HasTestsand its two assignments inbuildView. Neitherreport.md.tmplnorreport.html.tmplmentions.HasTests; both render the preformatted.Testsstring instead. The same-namedrender.Workspace.HasTests(types.go) is still read atview.go:50and is untouched.internal/baseline/baseline.go— removedComparison.HasTotalLineand its assignment inCompare. Nothing consumed it;app.checkFailOnDropreadsrender.Summary.TotalDelta.HasLine..ergates/plan.md— task plan and evidence log.No import was freed and no branch stranded by either removal (
buildViewstill needsanyTestsfor the Total row). No file in the repo carries aDO NOT EDITheader; there is no generated code here.internal/cobertura'sMerge,Report,ClassandLineare all reachable fromapp.aggregateCoverageand untouched.Left in place for a human to confirm — each is referenced, so none met the deletion bar:
baseline.Comparison.TotalLineDropPP— read only bybaseline_test.go:100; production readsTotalDelta.LinePP.junit.Report.Failures/Errors/Skipped— the app reads only.Tests, butjunit/parser_test.goasserts all four.baseline.pctDelta'sisNew bool— all three call sites pass literalfalse, makingif isNew { return d }unreachable. Removing it is a signature change, which this task puts out of scope.Validation
Run locally, all green:
gofmt -l .(empty),go build ./...,go vet ./...,go test ./...(9/9 packages ok),staticcheck ./...(exit 0). Each deleted field was confirmed unreferenced bygit grepacross Go sources, tests, templates and docs before removal.CI was not waited on — the build/test, Trivy and markdown/shell lint jobs will run on this push; nothing is known to be red.
Ergates task:
06G3EKQRDRG0F41287BY7KC6EG