why does my vim fmt differently on save/quit than seems to have been done in the repo with fmt? #215

Open
opened 2026-11-07 03:34:50 +01:00 by sneak · 4 comments
Owner
No description provided.
Author
Owner
https://git.eeqj.de/sneak/smallwebwaf/commit/8249a1110cd073eb175a6875dffc435182e58992
Collaborator

Why: the repo's formatter never wraps lines; your editor does.

  • make fmt runs script/fmt, which runs plain gofmt. gofmt fixes spacing and indentation but never splits a long line. Line length is only checked by the linter, at 88 columns (lll in .golangci.yml).
  • Your editor splits calls and composite literals into one argument per line, with a trailing comma. In your commit (8249a1110c), even lines under 80 columns were split. That is the style of golines, a gofmt wrapper that shortens lines, run on save by vim-go or ALE.

So the two will keep disagreeing until they run the same formatter.

Options:

  • The repo adopts your formatter (recommended): make fmt runs golines (pinned, with your column limit) after gofmt, and make fmt-check checks it. Your saves and the repo then agree. The Go formatting rule lives in sneak/prompts, so it changes there for every Go repo.
  • Your editor matches the repo: vim runs only gofmt for these repos.

Question: which one? If the first, what column limit does your vim use? Your commit suggests about 80. That and golines' other flags would be read from your vim config.

Model: opus-5-5

**Why:** the repo's formatter never wraps lines; your editor does. - `make fmt` runs `script/fmt`, which runs plain `gofmt`. `gofmt` fixes spacing and indentation but never splits a long line. Line length is only checked by the linter, at 88 columns (`lll` in `.golangci.yml`). - Your editor splits calls and composite literals into one argument per line, with a trailing comma. In your commit (https://git.eeqj.de/sneak/smallwebwaf/commit/8249a1110cd073eb175a6875dffc435182e58992), even lines under 80 columns were split. That is the style of `golines`, a gofmt wrapper that shortens lines, run on save by vim-go or ALE. So the two will keep disagreeing until they run the same formatter. **Options:** - **The repo adopts your formatter** (recommended): `make fmt` runs `golines` (pinned, with your column limit) after `gofmt`, and `make fmt-check` checks it. Your saves and the repo then agree. The Go formatting rule lives in `sneak/prompts`, so it changes there for every Go repo. - **Your editor matches the repo:** vim runs only `gofmt` for these repos. **Question:** which one? If the first, what column limit does your vim use? Your commit suggests about 80. That and `golines`' other flags would be read from your vim config. Model: opus-5-5
sneak was assigned by clawbot 2026-11-07 03:36:27 +01:00
Author
Owner

golines -m 77 it looks like. this is now our global default for all repos everywhere, update any required policy and standards documents.

`golines -m 77` it looks like. this is now our global default for all repos everywhere, update any required policy and standards documents.
Collaborator

Recorded: golines -m 77 is the global default for Go formatting. The policy change is sneak/prompts#160. Each repo, smallwebwaf included, adopts it through its next standards update.

Model: opus-5-5

Recorded: `golines -m 77` is the global default for Go formatting. The policy change is https://git.eeqj.de/sneak/prompts/issues/160. Each repo, smallwebwaf included, adopts it through its next standards update. Model: opus-5-5
sneak was unassigned by clawbot 2026-11-07 04:07:13 +01:00
clawbot self-assigned this 2026-11-07 04:07:13 +01:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/smallwebwaf#215