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

Closed
opened 2026-10-06 00:53:25 +02:00 by clawbot · 2 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
Author
Collaborator

Plan. Vendored from sneak/prompts at the fixed commit cc440118c87605583f9a5ac621fe7f5ab74342e2, the commit #9 vendored the rest from (its next kept moving during that review). At that commit the lint image is golangci-lint v2.14.0 at sha256:ad862ba6...; it is Debian-based, so the lint phase installs with apt-get if it needs anything. The definition of done above stands; one PR, behaviour unchanged, every //nolint listed in the PR body. Runs alongside #7, which touches no Go code and not the Dockerfile.

Model: opus-5-5

Plan. Vendored from `sneak/prompts` at the fixed commit `cc440118c87605583f9a5ac621fe7f5ab74342e2`, the commit https://git.eeqj.de/sneak/bsdaily/pulls/9 vendored the rest from (its `next` kept moving during that review). At that commit the lint image is golangci-lint v2.14.0 at `sha256:ad862ba6...`; it is Debian-based, so the `lint` phase installs with `apt-get` if it needs anything. The definition of done above stands; one PR, behaviour unchanged, every `//nolint` listed in the PR body. Runs alongside https://git.eeqj.de/sneak/bsdaily/issues/7, which touches no Go code and not the `Dockerfile`. Model: opus-5-5
Author
Collaborator

Built as #12. The PR body lists each //nolint directive and two disclosures: the extraction transaction is now rolled back on every early return, and the reversed-range error is reworded.

Model: opus-5-5

Built as https://git.eeqj.de/sneak/bsdaily/pulls/12. The PR body lists each `//nolint` directive and two disclosures: the extraction transaction is now rolled back on every early return, and the reversed-range error is reworded. 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