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
This commit is contained in:
1 parent
63e58e326b
commit
7f8a59de04
118 files changed
+9447
-2670
No files matched your search
@@ -27,7 +27,11 @@ func TestHistoryKeepsEveryRequest(t *testing.T) {
|
||||
// refused.
|
||||
{Status: 404},
|
||||
} {
|
||||
limiter.AddToHistory(client, start.Add(time.Duration(i)*time.Minute), r)
|
||||
limiter.AddToHistory(
|
||||
client,
|
||||
start.Add(time.Duration(i)*time.Minute),
|
||||
r,
|
||||
)
|
||||
}
|
||||
|
||||
want := ratelimit.History{
|
||||
@@ -63,7 +67,13 @@ func TestLookupReachesTheHistoryOfAClientInTheTable(t *testing.T) {
|
||||
|
||||
// A later answer replaces it, and one for a client the table does not
|
||||
// hold adds no client.
|
||||
limiter.AddLookup(client, start.Add(time.Hour), "AS64497", "Other Net", "FR")
|
||||
limiter.AddLookup(
|
||||
client,
|
||||
start.Add(time.Hour),
|
||||
"AS64497",
|
||||
"Other Net",
|
||||
"FR",
|
||||
)
|
||||
limiter.AddLookup(other, start, "AS64496", "Example Net", "DE")
|
||||
|
||||
want := ratelimit.History{
|
||||
@@ -96,7 +106,11 @@ func TestResetKeepsTheHistory(t *testing.T) {
|
||||
|
||||
for range limit {
|
||||
wantCount(t, limiter, client, start, "")
|
||||
limiter.AddToHistory(client, start, ratelimit.Request{Forwarded: true})
|
||||
limiter.AddToHistory(
|
||||
client,
|
||||
start,
|
||||
ratelimit.Request{Forwarded: true},
|
||||
)
|
||||
}
|
||||
|
||||
limiter.Reset(client)
|
||||
|
||||
Reference in new issue
Block a user