From bde1f828505d4ffc1b4d00cee5da7f8323442652 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 8 Sep 2025 13:40:08 +0200 Subject: [PATCH] Update gofumpt, add go.mod ignore directive (#35434) gofumpt now [supports](https://github.com/mvdan/gofumpt/releases/tag/v0.9.0) the [ignore](https://tip.golang.org/ref/mod#go-mod-file-ignore) directive added in go 1.25, make use of it which speeds up `make fmt` by around 30%. Likely this also has similar speed gains in other go-related commands which use the `./...` pattern. The change in `build/code-batch-process.go` was introduced by `gofumpt` because of this change: > A new rule is introduced to "clothe" naked returns for the sake of clarity. While there is nothing wrong with naming results in function signatures, using lone return statements can be confusing to the reader. --- Makefile | 2 +- build/code-batch-process.go | 2 +- go.mod | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cd37642514..1fb4a40d71 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ XGO_VERSION := go-1.25.x AIR_PACKAGE ?= github.com/air-verse/air@v1 EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3 -GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.8.0 +GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.9.1 GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0 GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.15 MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.7.0 diff --git a/build/code-batch-process.go b/build/code-batch-process.go index cc2ab68026..16d1273d96 100644 --- a/build/code-batch-process.go +++ b/build/code-batch-process.go @@ -181,7 +181,7 @@ func parseArgs() (mainOptions map[string]string, subCmd string, subArgs []string break } } - return + return mainOptions, subCmd, subArgs } func showUsage() { diff --git a/go.mod b/go.mod index 5597079416..eb871e24ae 100644 --- a/go.mod +++ b/go.mod @@ -287,6 +287,11 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect ) +ignore ( + ./.venv + ./node_modules +) + replace github.com/jaytaylor/html2text => github.com/Necoro/html2text v0.0.0-20250804200300-7bf1ce1c7347 replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1