1 Commits
Author SHA1 Message Date
30cdf15cde fix(golang-lint): enable goimports formatter (#85)
* fix(golang-lint): enable goimports formatter

gofumpt sorts and groups existing imports. It never adds a missing one and
never removes an unused one, so disabling goimports leaves nothing in the
config that manages imports.

This breaks `golangci-lint run --fix`. perfsprint rewrites `fmt.Errorf("x")`
into `errors.New("x")` without adding the `errors` import, and modernize
introduces `slices` and `maps` references the same way. With goimports off,
the fixed tree no longer compiles, and the failure surfaces later as a
typecheck error from an unrelated command.

goimports does not undo gofumpt. gofumpt output is already gofmt-stable, so
running both is idempotent: octal literals stay `0o755`, extra-rules blank
line removal survives, and a second `golangci-lint fmt` run reports no diff.

* refactor(golang-lint): drop gofmt, already covered by gofumpt

gofumpt applies gofmt's full rule set before adding its own, so listing
both in formatters.enable runs the same pass twice.

Verified against the full config: formatting a file that exercises
gofumpt's extra rules (octal literal, blank line after a func brace,
var block alignment, import grouping) produces byte-identical output
with and without gofmt, and a second run reports no diff.

* Disable gofmt in golangci.yml

Removed gofmt from the enabled linters in golangci.yml.

* Update version to 1.3.0 in SKILL.md

* fix(golang-lint): drop invalid formatters.disable block

golangci-lint v2 rejects a `disable` key under `formatters`, so
`golangci-lint config verify` failed. Formatters are opt-in, so keep
only the enabled ones and leave the rest as commented lines with their
reasons. Verified with golangci-lint 2.12.2: config verify now passes.

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2026-08-13 12:45:57 +02:00