Skip to content

Commit bde1f82

Browse files
authored
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.
1 parent 87362b4 commit bde1f82

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ XGO_VERSION := go-1.25.x
2727

2828
AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3
30-
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.8.0
30+
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.9.1
3131
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.15
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.7.0

build/code-batch-process.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func parseArgs() (mainOptions map[string]string, subCmd string, subArgs []string
181181
break
182182
}
183183
}
184-
return
184+
return mainOptions, subCmd, subArgs
185185
}
186186

187187
func showUsage() {

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,11 @@ require (
287287
gopkg.in/yaml.v2 v2.4.0 // indirect
288288
)
289289

290+
ignore (
291+
./.venv
292+
./node_modules
293+
)
294+
290295
replace github.com/jaytaylor/html2text => github.com/Necoro/html2text v0.0.0-20250804200300-7bf1ce1c7347
291296

292297
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1

0 commit comments

Comments
 (0)