Adopt the shared .golangci.yml and fix the code to it #6

Open
opened 2026-10-06 00:53:25 +02:00 by clawbot · 0 comments
Collaborator

Split out of #1, whose own definition of done says to move the lint cleanup into its own issue when it is large. Adding the shared .golangci.yml surfaced about 170 findings in the existing code.

The open question on issue 1 (fix the code, or loosen the shared config) is decided by REPO_POLICIES.md: the vendored .golangci.yml is never modified by an agent and stays byte-identical to the copy in sneak/prompts. So the code is fixed.

Definition of done

  1. .golangci.yml is byte-identical to the one on sneak/prompts next.
  2. In the same commit, the lint phase of the Dockerfile is based on the golangci-lint v2.14.0 image digest named in the .golangci.yml paragraph of REPO_POLICIES.md (sha256:ad862ba6...), with the version and date comment above it.
  3. Every finding is fixed without changing behaviour: same command-line flags, same output files and file names, same log lines apart from wording a linter forces, same SQL results, same order of operations. A //nolint is allowed only for a finding that is wrong for this code, with the linter named and the reason on the same line.
  4. make check and script/cibuild pass on a fresh clone.

Notes for the implementer

  • Starts after #1 lands on next: that unit rebuilds the Dockerfile into lint and test phases, and this one changes the lint phase.
  • A previous attempt, the closed #2, fixed 174 findings against v2.12.2 and the older config. Its commit is still fetchable as refs/pull/2/head (72d052e) and may be used as a starting point; it was never reviewed, so every change in it is checked again here.
  • The test suite is only a compilation smoke test, so behaviour is preserved by reading, not by tests. Keep each refactor plain: split long functions into named steps, do not redesign them.

Model: opus-5-5

Split out of https://git.eeqj.de/sneak/bsdaily/issues/1, whose own definition of done says to move the lint cleanup into its own issue when it is large. Adding the shared `.golangci.yml` surfaced about 170 findings in the existing code. The open question on issue 1 (fix the code, or loosen the shared config) is decided by `REPO_POLICIES.md`: the vendored `.golangci.yml` is never modified by an agent and stays byte-identical to the copy in `sneak/prompts`. So the code is fixed. ## Definition of done 1. `.golangci.yml` is byte-identical to the one on `sneak/prompts` `next`. 2. In the same commit, the `lint` phase of the `Dockerfile` is based on the golangci-lint v2.14.0 image digest named in the `.golangci.yml` paragraph of `REPO_POLICIES.md` (`sha256:ad862ba6...`), with the version and date comment above it. 3. Every finding is fixed without changing behaviour: same command-line flags, same output files and file names, same log lines apart from wording a linter forces, same SQL results, same order of operations. A `//nolint` is allowed only for a finding that is wrong for this code, with the linter named and the reason on the same line. 4. `make check` and `script/cibuild` pass on a fresh clone. ## Notes for the implementer - Starts after https://git.eeqj.de/sneak/bsdaily/issues/1 lands on `next`: that unit rebuilds the `Dockerfile` into lint and test phases, and this one changes the lint phase. - A previous attempt, the closed https://git.eeqj.de/sneak/bsdaily/pulls/2, fixed 174 findings against v2.12.2 and the older config. Its commit is still fetchable as `refs/pull/2/head` (`72d052e`) and may be used as a starting point; it was never reviewed, so every change in it is checked again here. - The test suite is only a compilation smoke test, so behaviour is preserved by reading, not by tests. Keep each refactor plain: split long functions into named steps, do not redesign them. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/bsdaily#6