task fmt still cannot produce gci's custom-order import grouping #1524
Notifications
Due Date
No due date set.
Depends on
Reference: sam/archie#1524
Reference in new issue
Block a user
Follow-up to archie-core-ebzk. That bead fixed two ways
task fmtcould not satisfytask lint(gofumpt version drift, and a missing-extra). A third remains, and it is the general shape of all three: formatting has two owners, so only the rules they happen to share are safe to rely on.task fmtruns the standalone gofumpt (gofumpt -extra -w .).task lintenforces theformatters:block from.golangci.yml— gofumpt (extra-rules) plus goimports plus gci. gci is configuredcustom-order: truewithprefix(github.com/samcharles93/archie-core), so it puts archie-core imports in their own trailing section. gofumpt has no knowledge of that prefix and sorts alphabetically within a group.REPRO (module + a config mirroring the repo's formatters block):
but
gofumpt -extra -w .produces this, and leaves it there on every re-run:So
task fmtwrites somethingtask lintrejects, and re-runningtask fmtcannot move it. Any contributor who adds a third-party import sorting aftergithub.com/samcharles93into the same group as an archie-core import gets a red gate whose documented repair does nothing.golangci-lint fmtdoes fix it, but nothing tells them to run that, and the gate's own documentation namestask fmt.Impact today is latent: the committed tree is clean (
golangci-lint run ./...reports 0 issues), so no gate is red. The defect is the contract, not the current content.Options, needing a decision:
task fmtatgolangci-lint fmt, so fmt and lint share one engine, one config and one version. Thenfmtcan always convergelintby construction, and the gofumpt/golangci-lint version pairing stops mattering for the gate. Costs:deploy.yml's inline quality-gate step runsgofumpt -w .directly (nottask fmt) and CI does not install golangci-lint at all, so CI would need to rungolangci-lint fmttoo; and the pin documented inDockerfile/AGENTS.md becomes about the preview command rather than the gate.formatters.enable, leaving gofumpt as the single formatting authority. Cheaper, but gives up the grouping rule the repo's import style already follows, and gci's grouping would then be unenforced.Related, not fixed here: CI's quality gate never runs
golangci-lint runat all — it runs gofumpt, go fix, proto, vet, build and test — so no CI surface can catch any of this class of drift. That is a separate gap from the one above.Close reason
Implemented one configured formatting writer, protected Yaegi secret engines from goimports, and added a read-only PR quality gate; task check passes.
Imported from beads
archie-core-q288· GitHub #954 · type bug · priority P3 · created 2026-09-19 · closed 2026-09-19