fix(build): make task fmt apply the gofumpt rules task lint checks
`task lint` enables gofumpt's `extra-rules`, so it demands `func f(a, b int)` where `task fmt`'s bare `gofumpt -w .` left `func f(a int, b int)` alone -- and `task fmt` is the documented repair for a failing gate, so a contributor had no command that could satisfy `task check`. That is the same failure shape as the version drift fixed alongside it, one layer up: fmt and lint are not the same formatter, so only the rules they happen to share are safe. `-extra` matches `extra-rules`, and nothing reformats as a result: the tree is already clean under it (`gofumpt -extra -l .` is empty). Still open, filed as archie-core-q288: gci's custom-order places archie-core imports last where gofumpt sorts them alphabetically, so `task fmt` can still produce formatting it will never fix. That needs a decision about which formatter owns formatting rather than another flag, and it is a decision CI cannot currently surface at all -- the deploy gate never runs golangci-lint.
This commit is contained in:
2 files changed
+16
-2
No files matched your search
+5
-1
@@ -12,7 +12,11 @@ tasks:
|
||||
fmt:
|
||||
desc: Format and fix Go source (gofumpt, go fix)
|
||||
cmds:
|
||||
- gofumpt -w .
|
||||
# -extra must match the gofumpt formatter's extra-rules in
|
||||
# .golangci.yml. Without it `task fmt` cannot produce what `task lint`
|
||||
# demands -- e.g. func f(a int, b int) -> func f(a, b int) -- so a
|
||||
# contributor has no command that satisfies the gate.
|
||||
- gofumpt -extra -w .
|
||||
- go fix ./...
|
||||
|
||||
proto:install:
|
||||
|
||||
Reference in new issue
Block a user