Skip to content

build(tools): separate dev tools into go.tools.mod#83

Merged
appleboy merged 1 commit intomainfrom
build
Mar 7, 2026
Merged

build(tools): separate dev tools into go.tools.mod#83
appleboy merged 1 commit intomainfrom
build

Conversation

@appleboy
Copy link
Copy Markdown
Member

@appleboy appleboy commented Mar 7, 2026

  • Move tool directive (templ, golangci-lint, swag, mockgen) and esbuild to a separate go.tools.mod
  • Update Makefile to use go tool -modfile=go.tools.mod for all tool invocations
  • Remove individual install-* targets in favor of modfile-based tool resolution
  • Update go:generate directives to use -modfile flag
  • Significantly reduce indirect dependencies in root go.mod

- Move tool directive (templ, golangci-lint, swag, mockgen) and esbuild to a separate go.tools.mod
- Update Makefile to use `go tool -modfile=go.tools.mod` for all tool invocations
- Remove individual install-* targets in favor of modfile-based tool resolution
- Update go:generate directives to use -modfile flag
- Significantly reduce indirect dependencies in root go.mod

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 7, 2026 16:43
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves Go-based developer tooling (templ, golangci-lint, swag, mockgen) and build-time dependencies (esbuild) out of the root module and into a dedicated go.tools.mod, then updates build/generate workflows to resolve tools via go tool -modfile=go.tools.mod.

Changes:

  • Added go.tools.mod to hold tool directives and tool-only dependencies.
  • Updated Makefile, .air.toml, and go:generate directives to invoke tools via go tool -modfile=....
  • Reduced root-module dependency surface by removing tool-only indirect requirements from go.mod/go.sum.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/templates/generate.go Switch templ generation to use tools modfile via go tool -modfile.
internal/mocks/generate.go Switch mock generation to use tools modfile via go tool -modfile.
go.tools.mod Introduces dedicated tools module with tool (...) directives and pinned tool dependency graph.
go.sum Shrinks root module checksums by removing tool-only entries.
go.mod Removes the root tool (...) block and prunes tool-only indirect requirements.
Makefile Routes tool invocations through go tool -modfile=go.tools.mod and replaces install-* targets with modfile-based resolution.
.air.toml Updates dev loop pre-command to run templ generation via tools modfile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@appleboy appleboy merged commit 04ce3b6 into main Mar 7, 2026
21 checks passed
@appleboy appleboy deleted the build branch March 7, 2026 16:59
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.

2 participants