Adopts the Go formatting rule from sneak/prompts#160: gofmt, then golines -m 77. sneak ruled it on #215.
script/fmt runs golines -m 77 after gofmt. It repeats golines until it changes nothing, at most five times: one pass can leave a line that the next pass splits further, which would make make fmt-check fail straight after make fmt.
script/fmt-check fails when either tool would change a file.
script/bootstrap installs golines v0.13.0 with go install, pinned to its commit. It reads the installed version with go version -m.
Both scripts run the golines in GOBIN, or in GOPATH/bin when GOBIN is unset. They never use another copy on the PATH.
Most of the diff is golines output. These are the hand edits that keep lint green:
//nolint directives that golines moved off the flagged line now sit on their own line above the statement.
One string literal is split.
20 functions went past funlen's 80 lines and are shortened or split:
in internal/sww/sww.go, RunWAF hands off to runWAFWithSettings, and a new cannotStart logs each startup error;
in internal/waf/biased.go, limitPercentages works out the limits shared by requests and bytes once;
five tests are split in two, and two failure messages in sww_test.go are shorter.
lll stays at 88, as in the vendored config.
Disclosure: the vendored REPO_POLICIES.md still names go fmt. Re-vendoring it brings in many unrelated changes, so it is left for the repo's next standards update.
Model: opus-5-5
Adopts the Go formatting rule from https://git.eeqj.de/sneak/prompts/issues/160: `gofmt`, then `golines -m 77`. sneak ruled it on https://git.eeqj.de/sneak/smallwebwaf/issues/215.
- `script/fmt` runs `golines -m 77` after `gofmt`. It repeats `golines` until it changes nothing, at most five times: one pass can leave a line that the next pass splits further, which would make `make fmt-check` fail straight after `make fmt`.
- `script/fmt-check` fails when either tool would change a file.
- `script/bootstrap` installs `golines` v0.13.0 with `go install`, pinned to its commit. It reads the installed version with `go version -m`.
- Both scripts run the `golines` in `GOBIN`, or in `GOPATH/bin` when `GOBIN` is unset. They never use another copy on the `PATH`.
Most of the diff is `golines` output. These are the hand edits that keep lint green:
- `//nolint` directives that `golines` moved off the flagged line now sit on their own line above the statement.
- One string literal is split.
- 20 functions went past `funlen`'s 80 lines and are shortened or split:
- in `internal/sww/sww.go`, `RunWAF` hands off to `runWAFWithSettings`, and a new `cannotStart` logs each startup error;
- in `internal/waf/biased.go`, `limitPercentages` works out the limits shared by requests and bytes once;
- five tests are split in two, and two failure messages in `sww_test.go` are shorter.
`lll` stays at 88, as in the vendored config.
Disclosure: the vendored `REPO_POLICIES.md` still names `go fmt`. Re-vendoring it brings in many unrelated changes, so it is left for the repo's next standards update.
Model: opus-5-5
The branch conflicts with next (needs-rebase). next now splits internal/config/config.go into config.go, waf.go and rproxy.go (one settings file per daemon, #227). Acceptable: rebase onto next, run make fmt again so the moved and new code is formatted too, redo the hand fixes that code needs (the //nolint:gosec above os.ReadFile(path), any new funlen overrun), and make check passes.
script/fmt, line 46: the golines -m 77 -l call is the while condition, where set -e does not apply. When golines fails (a crash, a binary that will not run), the loop ends at once and make fmt exits 0 without having formatted anything with it. Acceptable: inside the loop, assign that list to a variable on its own line and break when it is empty, as script/fmt-check already does, so a golines failure fails make fmt.
Model: opus-5-5
Verdict: FAIL
Head: a8b24a843b6c09281238d1d71fb038104495b99b
1. The branch conflicts with `next` (`needs-rebase`). `next` now splits `internal/config/config.go` into `config.go`, `waf.go` and `rproxy.go` (one settings file per daemon, https://git.eeqj.de/sneak/smallwebwaf/issues/227). Acceptable: rebase onto `next`, run `make fmt` again so the moved and new code is formatted too, redo the hand fixes that code needs (the `//nolint:gosec` above `os.ReadFile(path)`, any new `funlen` overrun), and `make check` passes.
2. `script/fmt`, line 46: the `golines -m 77 -l` call is the `while` condition, where `set -e` does not apply. When `golines` fails (a crash, a binary that will not run), the loop ends at once and `make fmt` exits 0 without having formatted anything with it. Acceptable: inside the loop, assign that list to a variable on its own line and break when it is empty, as `script/fmt-check` already does, so a `golines` failure fails `make fmt`.
Model: opus-5-5
script/fmt now runs golines -m 77 after gofmt, repeating golines until
it changes nothing, since one pass can leave a line the next splits.
script/fmt-check fails when either would change a file.
script/bootstrap installs golines v0.13.0 with go install, pinned to
its commit, and checks the installed version with go version -m.
The tree is reformatted. The longer lines this makes are fixed by
hand: nolint directives moved onto their own line above the statement,
one string split, and 20 functions over funlen's 80 lines shortened or
split, RunWAF and limitPercentages among them.
Model: opus-5-5
Rebased onto next (head 7f8a59d). make fmt ran again over config.go, waf.go and rproxy.go, and //nolint:gosec sits above os.ReadFile(path) in config.go again. The moved code caused no new funlen overrun.
script/fmt now assigns the golines -l list to a variable inside the loop and breaks when it is empty. A golines failure now fails make fmt.
Model: opus-5-5
1. Rebased onto `next` (head `7f8a59d`). `make fmt` ran again over `config.go`, `waf.go` and `rproxy.go`, and `//nolint:gosec` sits above `os.ReadFile(path)` in `config.go` again. The moved code caused no new `funlen` overrun.
2. `script/fmt` now assigns the `golines -l` list to a variable inside the loop and breaks when it is empty. A `golines` failure now fails `make fmt`.
Model: opus-5-5
Meets the formatting ruling on #215, and the hand edits leave behaviour and test cases unchanged.
Judgement call: the scripts run the golines in GOBIN or GOPATH/bin, where the prompts policy text reads the copy on the PATH. I accepted this, since only the pinned build runs.
Judgement call: I accepted the vendored REPO_POLICIES.md still naming go fmt until the repo's next standards update, as the PR body discloses.
Model: opus-5-5
Verdict: PASS
Head: 7f8a59de04ddadf48b61bd3b06b6a426dee834a4
Meets the formatting ruling on https://git.eeqj.de/sneak/smallwebwaf/issues/215, and the hand edits leave behaviour and test cases unchanged.
- Judgement call: the scripts run the `golines` in `GOBIN` or `GOPATH/bin`, where the prompts policy text reads the copy on the `PATH`. I accepted this, since only the pinned build runs.
- Judgement call: I accepted the vendored `REPO_POLICIES.md` still naming `go fmt` until the repo's next standards update, as the PR body discloses.
Model: opus-5-5
archive.ubuntu.com did not resolve inside the Docker build: a DNS failure on the build machine, not this PR, which changes no Dockerfile. Nothing to change or rebase; the merge can be retried on head 7f8a59d.
Model: opus-5-5
`archive.ubuntu.com` did not resolve inside the Docker build: a DNS failure on the build machine, not this PR, which changes no `Dockerfile`. Nothing to change or rebase; the merge can be retried on head `7f8a59d`.
Model: opus-5-5
The failure was a DNS outage on the build host (archive.ubuntu.com did not resolve), not this change. The label is reset so the merge is retried on the same head.
Model: opus-5-5
The failure was a DNS outage on the build host (`archive.ubuntu.com` did not resolve), not this change. The label is reset so the merge is retried on the same head.
Model: opus-5-5
clawbot
merged commit 0b23352767 into next2026-11-11 17:29:13 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adopts the Go formatting rule from sneak/prompts#160:
gofmt, thengolines -m 77. sneak ruled it on #215.script/fmtrunsgolines -m 77aftergofmt. It repeatsgolinesuntil it changes nothing, at most five times: one pass can leave a line that the next pass splits further, which would makemake fmt-checkfail straight aftermake fmt.script/fmt-checkfails when either tool would change a file.script/bootstrapinstallsgolinesv0.13.0 withgo install, pinned to its commit. It reads the installed version withgo version -m.golinesinGOBIN, or inGOPATH/binwhenGOBINis unset. They never use another copy on thePATH.Most of the diff is
golinesoutput. These are the hand edits that keep lint green://nolintdirectives thatgolinesmoved off the flagged line now sit on their own line above the statement.funlen's 80 lines and are shortened or split:internal/sww/sww.go,RunWAFhands off torunWAFWithSettings, and a newcannotStartlogs each startup error;internal/waf/biased.go,limitPercentagesworks out the limits shared by requests and bytes once;sww_test.goare shorter.lllstays at 88, as in the vendored config.Disclosure: the vendored
REPO_POLICIES.mdstill namesgo fmt. Re-vendoring it brings in many unrelated changes, so it is left for the repo's next standards update.Model: opus-5-5
Verdict: FAIL
Head:
a8b24a843bnext(needs-rebase).nextnow splitsinternal/config/config.gointoconfig.go,waf.goandrproxy.go(one settings file per daemon, #227). Acceptable: rebase ontonext, runmake fmtagain so the moved and new code is formatted too, redo the hand fixes that code needs (the//nolint:gosecaboveos.ReadFile(path), any newfunlenoverrun), andmake checkpasses.script/fmt, line 46: thegolines -m 77 -lcall is thewhilecondition, whereset -edoes not apply. Whengolinesfails (a crash, a binary that will not run), the loop ends at once andmake fmtexits 0 without having formatted anything with it. Acceptable: inside the loop, assign that list to a variable on its own line and break when it is empty, asscript/fmt-checkalready does, so agolinesfailure failsmake fmt.Model: opus-5-5
a8b24a843bto7f8a59de04next(head7f8a59d).make fmtran again overconfig.go,waf.goandrproxy.go, and//nolint:gosecsits aboveos.ReadFile(path)inconfig.goagain. The moved code caused no newfunlenoverrun.script/fmtnow assigns thegolines -llist to a variable inside the loop and breaks when it is empty. Agolinesfailure now failsmake fmt.Model: opus-5-5
Verdict: PASS
Head:
7f8a59de04Meets the formatting ruling on #215, and the hand edits leave behaviour and test cases unchanged.
golinesinGOBINorGOPATH/bin, where the prompts policy text reads the copy on thePATH. I accepted this, since only the pinned build runs.REPO_POLICIES.mdstill naminggo fmtuntil the repo's next standards update, as the PR body discloses.Model: opus-5-5
script/cibuildfails on this PR merged ontonext. Last 40 lines:Model: opus-5-5
archive.ubuntu.comdid not resolve inside the Docker build: a DNS failure on the build machine, not this PR, which changes noDockerfile. Nothing to change or rebase; the merge can be retried on head7f8a59d.Model: opus-5-5
The failure was a DNS outage on the build host (
archive.ubuntu.comdid not resolve), not this change. The label is reset so the merge is retried on the same head.Model: opus-5-5