Delete tools.go and remove tool-dependency pollution from go.mod - #5
Merged
Conversation
bborbe
marked this pull request as ready for review
August 9, 2026 15:28
bborbe
enabled auto-merge
August 9, 2026 15:31
There was a problem hiding this comment.
All matches are //go:generate comments, not actual imports. The application code is clean.
Let me now compile the final report:
Review Summary:
- tools.go deleted: ✅ Confirmed
- No replace/exclude directives: ✅ Confirmed absent from go.mod
- No tool pollution: ✅ No golangci-lint, osv-scanner, or other tool packages in go.mod
- go-git gone: ✅ Confirmed absent
- golang.org/x/ bumped*: ✅ x/net v0.57.0, x/sync v0.22.0, x/text v0.40.0
- //go:generate updated: ✅ All 5 suite files updated to
@v6.12.2 - mocks/mocks.go license header: ✅
// Copyright (c) 2026 Benjamin Borbe - No tool imports in app code: ✅ Only
//go:generatecomments, no actual imports - CHANGELOG.md: ✅ Properly updated with Unreleased section
- Mechanical findings (5x no-testing-t-direct): FALSE POSITIVES — All 5 are the exempt Ginkgo suite bootstrap pattern (
RegisterFailHandler(Fail); RunSpecs(t, ...))
{
"verdict": "approve",
"summary": "PR cleanly deletes tools.go and removes all tool-only dependencies from go.mod. Replace/exclude directives are gone, golang.org/x/* deps are bumped to latest, go:generate directives are pinned to counterfeiter/v6@v6.12.2, and mocks/mocks.go retains its license header. The 5 ast-grep MUST findings for no-testing-t-direct are false positives — each is the exempt Ginkgo suite entry-point pattern (RegisterFailHandler + RunSpecs). No issues found.",
"comments": [
{
"file": "pkg/pkg_suite_test.go",
"line": 16,
"severity": "nit",
"message": "go-testing/no-testing-t-direct mechanical finding is a FALSE POSITIVE: func TestSuite is the exempt Ginkgo suite entry-point (RegisterFailHandler(Fail); RunSpecs), not a stdlib-style test requiring porting to Ginkgo DSL."
},
{
"file": "pkg/watcher/suite_test.go",
"line": 16,
"severity": "nit",
"message": "go-testing/no-testing-t-direct mechanical finding is a FALSE POSITIVE: func TestWatcher is the exempt Ginkgo suite entry-point."
},
{
"file": "pkg/notify/suite_test.go",
"line": 16,
"severity": "nit",
"message": "go-testing/no-testing-t-direct mechanical finding is a FALSE POSITIVE: func TestNotify is the exempt Ginkgo suite entry-point."
},
{
"file": "pkg/config/suite_test.go",
"line": 16,
"severity": "nit",
"message": "go-testing/no-testing-t-direct mechanical finding is a FALSE POSITIVE: func TestConfig is the exempt Ginkgo suite entry-point."
},
{
"file": "pkg/cli/suite_test.go",
"line": 16,
"severity": "nit",
"message": "go-testing/no-testing-t-direct mechanical finding is a FALSE POSITIVE: func TestCli is the exempt Ginkgo suite entry-point."
}
],
"concerns_addressed": [
"correctness: tools.go deleted — no application imports of tool-only packages found",
"correctness: 5 replace directives and exclude directive removed — verified clean in go.mod",
"correctness: suite_test.go files updated with //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6@v6.12.2 — all 5 files, diff confirms",
"correctness: mocks/mocks.go license header intact — Copyright (c) 2026 confirmed",
"security: golang.org/x/* deps bumped to latest (x/net v0.57.0, x/sync v0.22.0, x/text v0.40.0)",
"tests: suite test infrastructure unchanged — only license year and generate directive updated"
]
}
This was referenced Aug 13, 2026
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.
Removes
tools.goso CLI tools are no longer Go module dependencies. Tool versions stay pinned viatools.env+go run pkg@\$(VERSION), which the Makefile already used.Third and last repo in this sweep, after
git-restandgit-sync.Result
go.modgo-gitreplacedirectivesexcludedirectivesRemoving the
replaceandexcludeblocks also fixes a standing violation of this repo's owndocs/dod.md: "Noexcludeorreplacedirectives in go.mod (break remote install)".go-gitwas tool-only pollution — no source file here imports a git library — so removing it means future go-git advisories never apply to this repo at all.Commits
chore: bump go-git, grpc and golang.org/x deps— unblocks the dark-factory preflight baseline, which was red on go-git and grpc CVEs.Delete tools.go and remove tool-dependency pollution from go.mod— the migration (dark-factory).Two guards carried over from the sibling
git-syncmigrationgolang.org/x/*bumped explicitly. Removing the tool deps drops the version floor they imposed, sogo mod tidyslides transitive deps backwards to CVE-carrying minimums. Ongit-syncthis droppedx/netv0.56.0 → v0.53.0 and trivy failed with 4 HIGH CVEs.mocks/mocks.golicense header verified.go generaterewrites it headerless andaddlicensere-adds it as the last precommit step, so an earlier failure leaves it stripped — which is exactly what happened ongit-sync.Verification
make precommitgreen (osv-scanner + trivy both clean)go-gitgrep, and^(replace|exclude)grep all empty;tools.goabsent//go:generatedirectives pinned tocounterfeiter/v6@v6.12.2, matchingtools.env//go:generatecomment lines plus dependency metadata