ci: use go-modtool with config file (#19333)

This commit is contained in:
Seth Hoenig
2023-12-07 11:12:39 -06:00
committed by GitHub
parent c624dc2121
commit f146678f43
2 changed files with 5 additions and 5 deletions

View File

@@ -140,7 +140,7 @@ deps: ## Install build and development dependencies
go install github.com/hashicorp/go-changelog/cmd/changelog-build@latest go install github.com/hashicorp/go-changelog/cmd/changelog-build@latest
go install golang.org/x/tools/cmd/stringer@v0.1.12 go install golang.org/x/tools/cmd/stringer@v0.1.12
go install github.com/hashicorp/hc-install/cmd/hc-install@v0.6.1 go install github.com/hashicorp/hc-install/cmd/hc-install@v0.6.1
go install github.com/shoenig/go-modtool@v0.1.1 go install github.com/shoenig/go-modtool@v0.2.0
.PHONY: lint-deps .PHONY: lint-deps
lint-deps: ## Install linter dependencies lint-deps: ## Install linter dependencies
@@ -249,10 +249,7 @@ tidy: ## Tidy up the go mod files
@cd tools && go mod tidy @cd tools && go mod tidy
@cd api && go mod tidy @cd api && go mod tidy
@echo "==> Tidy nomad module" @echo "==> Tidy nomad module"
@go-modtool \ @go-modtool -config=ci/modtool.toml fmt go.mod
--replace-comment="Pinned dependencies are noted in github.com/hashicorp/nomad/issues/11826." \
--subs-comment="Nomad is built using the current source of the API module." \
-w fmt go.mod
@go mod tidy @go mod tidy
.PHONY: dev .PHONY: dev

3
ci/modtool.toml Normal file
View File

@@ -0,0 +1,3 @@
ReplaceComment = "Pinned dependencies are noted in github.com/hashicorp/nomad/issues/11826."
SubmodulesComment = "Nomad is built using the current source of the API module."
WriteFile = true