internal/config/waf.go is now ordered by setting, following the settings sections of SPEC as docs/settings.md lists them, Core to Anomaly thresholds. The struct WAF and WAFFromEnvironment stay first. Each setting's reader, parser, errors and check sit together.
Where the diff does not show it:
A helper several settings share sits just before the first setting that uses it. Examples: numberNotOff (Core), the duration parsers (State and cache files) and isZone (SWW_WAF_APPS, before the DNSBL zones).
checkCountriesAndLookups sits with SWW_WAF_LOOKUP_SOURCE, since it refuses the settings that need lookups while lookups are off.
The block of constants (day, ipv4Bits, masked, …) is split in the same way as the error block, each beside its user. The same goes for the DNSBL constants block.
Deviation: the only changed lines are var (, const ( and ) around each split block. gofmt also re-aligns the = of some lines in them. git diff --color-moved=plain shows everything else as moved. With whitespace stripped, the old and new files hold the same lines.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/smallwebwaf/issues/449.
`internal/config/waf.go` is now ordered by setting, following the settings sections of SPEC as `docs/settings.md` lists them, Core to Anomaly thresholds. The struct `WAF` and `WAFFromEnvironment` stay first. Each setting's reader, parser, errors and check sit together.
Where the diff does not show it:
- A helper several settings share sits just before the first setting that uses it. Examples: `numberNotOff` (Core), the duration parsers (State and cache files) and `isZone` (`SWW_WAF_APPS`, before the DNSBL zones).
- `checkCountriesAndLookups` sits with `SWW_WAF_LOOKUP_SOURCE`, since it refuses the settings that need lookups while lookups are off.
- The block of constants (`day`, `ipv4Bits`, `masked`, …) is split in the same way as the error block, each beside its user. The same goes for the DNSBL constants block.
- Deviation: the only changed lines are `var (`, `const (` and `)` around each split block. gofmt also re-aligns the `=` of some lines in them. `git diff --color-moved=plain` shows everything else as moved. With whitespace stripped, the old and new files hold the same lines.
Model: opus-5-5
internal/config/waf.go is reordered by setting, in the order of the
settings sections of SPEC and docs/settings.md. The struct WAF and
WAFFromEnvironment stay first. Each setting's reader, parser, errors
and check sit together. A helper several settings share sits before
the first of them.
Moves only. The one error block and the one block of constants are
split into a block beside each user, so gofmt re-aligns the = of some
of those lines.
Model: opus-5-5
internal/config/waf.go is now ordered by setting in SPEC's section order, and the change only moves code (apart from gofmt re-aligning the split blocks, as the PR says), meeting #449.
Model: opus-5-5
Verdict: PASS
Head: 3669abe7614b23f93a5e125fbed87d4b11e0737d
`internal/config/waf.go` is now ordered by setting in SPEC's section order, and the change only moves code (apart from gofmt re-aligning the split blocks, as the PR says), meeting https://git.eeqj.de/sneak/smallwebwaf/issues/449.
Model: opus-5-5
clawbot
merged commit 9afbd1b683 into next2026-11-20 01:44:08 +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.
Closes #449.
internal/config/waf.gois now ordered by setting, following the settings sections of SPEC asdocs/settings.mdlists them, Core to Anomaly thresholds. The structWAFandWAFFromEnvironmentstay first. Each setting's reader, parser, errors and check sit together.Where the diff does not show it:
numberNotOff(Core), the duration parsers (State and cache files) andisZone(SWW_WAF_APPS, before the DNSBL zones).checkCountriesAndLookupssits withSWW_WAF_LOOKUP_SOURCE, since it refuses the settings that need lookups while lookups are off.day,ipv4Bits,masked, …) is split in the same way as the error block, each beside its user. The same goes for the DNSBL constants block.var (,const (and)around each split block. gofmt also re-aligns the=of some lines in them.git diff --color-moved=plainshows everything else as moved. With whitespace stripped, the old and new files hold the same lines.Model: opus-5-5
Verdict: PASS
Head:
3669abe761internal/config/waf.gois now ordered by setting in SPEC's section order, and the change only moves code (apart from gofmt re-aligning the split blocks, as the PR says), meeting #449.Model: opus-5-5