Skip to content

chore: remove unused code [Y7KC6EG] - #26

Merged
cameronnewman merged 5 commits into
mainfrom
ergates/task/06G3EKQRDRG0F41287BY7KC6EG
Aug 25, 2026
Merged

chore: remove unused code [Y7KC6EG]#26
cameronnewman merged 5 commits into
mainfrom
ergates/task/06G3EKQRDRG0F41287BY7KC6EG

Conversation

@cameronnewman

@cameronnewman cameronnewman commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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-symbol git grep -c sweep over every declaration in every non-test .go file found no declaration-only and no test-only symbol.

Changes

  • internal/render/view.go — removed viewRow.HasTests and its two assignments in buildView. Neither report.md.tmpl nor report.html.tmpl mentions .HasTests; both render the preformatted .Tests string instead. The same-named render.Workspace.HasTests (types.go) is still read at view.go:50 and is untouched.
  • internal/baseline/baseline.go — removed Comparison.HasTotalLine and its assignment in Compare. Nothing consumed it; app.checkFailOnDrop reads render.Summary.TotalDelta.HasLine.
  • .ergates/plan.md — task plan and evidence log.

No import was freed and no branch stranded by either removal (buildView still needs anyTests for the Total row). No file in the repo carries a DO NOT EDIT header; there is no generated code here. internal/cobertura's Merge, Report, Class and Line are all reachable from app.aggregateCoverage and untouched.

Left in place for a human to confirm — each is referenced, so none met the deletion bar:

  • baseline.Comparison.TotalLineDropPP — read only by baseline_test.go:100; production reads TotalDelta.LinePP.
  • junit.Report.Failures / Errors / Skipped — the app reads only .Tests, but junit/parser_test.go asserts all four.
  • baseline.pctDelta's isNew bool — all three call sites pass literal false, making if 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 by git grep across 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

ergates-agent 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 cameronnewman changed the title [WIP] chore: remove unused code [Y7KC6EG] chore: remove unused code [Y7KC6EG] Aug 25, 2026
@cameronnewman
cameronnewman marked this pull request as ready for review August 25, 2026 05:12
@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Greptile Summary

The PR removes two write-only struct fields without changing their observable behavior.

  • Removes Comparison.HasTotalLine and its unused assignment.
  • Removes viewRow.HasTests and its unused assignments while retaining test-count formatting and aggregation.

Confidence Score: 5/5

The 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

@cameronnewman
cameronnewman merged commit a9d0970 into main Aug 25, 2026
7 checks passed
@cameronnewman
cameronnewman deleted the ergates/task/06G3EKQRDRG0F41287BY7KC6EG branch August 25, 2026 05:35
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