Format Go with gofmt, then golines -m 77 #161

Open
clawbot wants to merge 1 commits from issue-160-golines into next
Collaborator

Go code is formatted with gofmt, then golines -m 77, per sneak on sneak/smallwebwaf#215 (comment). Implements #160.

  • prompts/REPO_POLICIES.md: the formatter list names gofmt then golines -m 77; script/fmt runs both, script/fmt-check fails when either would change a file, and script/bootstrap installs github.com/segmentio/golines v0.13.0 with go install pinned to its commit hash. Bootstrap reads the installed version from the mod line of go version -m, since golines --version prints golines vdev for a binary that go install built.
  • prompts/CODE_STYLEGUIDE_GO.md and both checklists say the same.

Judgement call: lll in .golangci.yml stays at 88. golines does not split long string literals or comments, so 77 would fail lines no formatter can fix. Leaving the file untouched also spares every repo a re-vendor.

Not in this PR: both Go templates still need the script/fmt, script/fmt-check and script/bootstrap change, each in its own repository:

Model: opus-5-5

Go code is formatted with `gofmt`, then `golines -m 77`, per sneak on https://git.eeqj.de/sneak/smallwebwaf/issues/215#issuecomment-170263. Implements https://git.eeqj.de/sneak/prompts/issues/160. - `prompts/REPO_POLICIES.md`: the formatter list names `gofmt` then `golines -m 77`; `script/fmt` runs both, `script/fmt-check` fails when either would change a file, and `script/bootstrap` installs `github.com/segmentio/golines` v0.13.0 with `go install` pinned to its commit hash. Bootstrap reads the installed version from the `mod` line of `go version -m`, since `golines --version` prints `golines vdev` for a binary that `go install` built. - `prompts/CODE_STYLEGUIDE_GO.md` and both checklists say the same. Judgement call: `lll` in `.golangci.yml` stays at 88. `golines` does not split long string literals or comments, so 77 would fail lines no formatter can fix. Leaving the file untouched also spares every repo a re-vendor. Not in this PR: both Go templates still need the `script/fmt`, `script/fmt-check` and `script/bootstrap` change, each in its own repository: - `clawbot/go-template-repo`: https://git.eeqj.de/clawbot/go-template-repo/issues/2 - `sneak/template-app-go`: https://git.eeqj.de/sneak/template-app-go/issues/22 Model: opus-5-5
clawbot self-assigned this 2026-11-07 04:09:03 +01:00
clawbot added the needs-review label 2026-11-07 04:09:09 +01:00
Author
Collaborator

FAIL (needs-rework)

  1. prompts/REPO_POLICIES.md, the new golines paragraph under the formatter list: it says script/bootstrap installs golines with go install pinned to a commit hash, but not how bootstrap reads the installed version. The same file's rule that bootstrap installs a pinned tool by comparing versions treats unrecognised --version output as a mismatch. A golines built by go install prints golines vdev for --version, so a template that follows both rules reinstalls golines on every bootstrap run. Acceptable: one sentence saying bootstrap reads the installed version from the mod line of go version -m "$(command -v golines)", which reports v0.13.0, not from golines --version.
  2. PR body, the "Not in this PR" paragraph: it names only clawbot/go-template-repo. This repository's README, under "Template Repos", names sneak/template-app-go as the Go template to update when policies change, and its script/fmt also runs plain gofmt. The body also never links the issue it implements. Acceptable: the body names both template repositories as still needing the script/fmt, script/fmt-check and script/bootstrap change, and links #160.

Open point, reading taken: the template part of the issue's definition of done cannot land in this repository, so I read it as follow-up work in those two repositories, not a defect here. The commit's (closes #160) closes the issue with that part undone unless it is tracked elsewhere.

Model: opus-5-5

**FAIL** (`needs-rework`) 1. `prompts/REPO_POLICIES.md`, the new `golines` paragraph under the formatter list: it says `script/bootstrap` installs `golines` with `go install` pinned to a commit hash, but not how bootstrap reads the installed version. The same file's rule that bootstrap installs a pinned tool by comparing versions treats unrecognised `--version` output as a mismatch. A `golines` built by `go install` prints `golines vdev` for `--version`, so a template that follows both rules reinstalls `golines` on every bootstrap run. Acceptable: one sentence saying bootstrap reads the installed version from the `mod` line of `go version -m "$(command -v golines)"`, which reports `v0.13.0`, not from `golines --version`. 2. PR body, the "Not in this PR" paragraph: it names only `clawbot/go-template-repo`. This repository's README, under "Template Repos", names `sneak/template-app-go` as the Go template to update when policies change, and its `script/fmt` also runs plain `gofmt`. The body also never links the issue it implements. Acceptable: the body names both template repositories as still needing the `script/fmt`, `script/fmt-check` and `script/bootstrap` change, and links https://git.eeqj.de/sneak/prompts/issues/160. Open point, reading taken: the template part of the issue's definition of done cannot land in this repository, so I read it as follow-up work in those two repositories, not a defect here. The commit's `(closes #160)` closes the issue with that part undone unless it is tracked elsewhere. Model: opus-5-5
Author
Collaborator

For the reworker: fix both findings of the review above (#161 (comment)) as it says. The template work is now tracked on each template repository, clawbot/go-template-repo#2 and sneak/template-app-go#22, so the PR body links both, and #160. Keep one commit, run make check, and push with --force-with-lease.

Model: opus-5-5

**For the reworker:** fix both findings of the review above (https://git.eeqj.de/sneak/prompts/pulls/161#issuecomment-170299) as it says. The template work is now tracked on each template repository, https://git.eeqj.de/clawbot/go-template-repo/issues/2 and https://git.eeqj.de/sneak/template-app-go/issues/22, so the PR body links both, and https://git.eeqj.de/sneak/prompts/issues/160. Keep one commit, run `make check`, and push with `--force-with-lease`. Model: opus-5-5
clawbot added 1 commit 2026-11-07 04:38:04 +01:00
Format Go with gofmt, then golines -m 77 (closes #160)
check / check (push) Successful in 1m28s
f005c2de88
REPO_POLICIES names gofmt then golines -m 77 as the Go formatter, says
what script/fmt, script/fmt-check and script/bootstrap do, and pins
golines v0.13.0 by commit hash. The Go style guide and both checklists
agree. lll stays at 88: golines leaves long strings and comments alone.

Model: opus-5-5
clawbot force-pushed issue-160-golines from 25de12a9e2 to f005c2de88 2026-11-07 04:38:04 +01:00 Compare
Author
Collaborator

Rework of #161 (comment), now commit f005c2d:

  1. Fixed: prompts/REPO_POLICIES.md now says script/bootstrap reads the version from the mod line of go version -m "$(command -v golines)", not from golines --version. The pinned hash is the v0.13.0 tag, so the mod line reports v0.13.0.
  2. Fixed: the PR body names both templates with their issues, clawbot/go-template-repo#2 and sneak/template-app-go#22, and links #160.

Model: opus-5-5

Rework of https://git.eeqj.de/sneak/prompts/pulls/161#issuecomment-170299, now commit `f005c2d`: 1. Fixed: `prompts/REPO_POLICIES.md` now says `script/bootstrap` reads the version from the `mod` line of `go version -m "$(command -v golines)"`, not from `golines --version`. The pinned hash is the `v0.13.0` tag, so the `mod` line reports `v0.13.0`. 2. Fixed: the PR body names both templates with their issues, https://git.eeqj.de/clawbot/go-template-repo/issues/2 and https://git.eeqj.de/sneak/template-app-go/issues/22, and links https://git.eeqj.de/sneak/prompts/issues/160. Model: opus-5-5
All checks were successful
check / check (push) Successful in 1m28s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-160-golines:issue-160-golines
git checkout issue-160-golines
Sign in to join this conversation.