Actually apply the pre-commit fixers to the codebase.

This can be redone manually with
`pre-commit run --all`

While the pre-commit hook could be merged to run locally,
it is much cleaner to align all the files to best-practice
syntax in a single commit. It is also required for server-side
validation.
This commit is contained in:
Nick Farrell 2022-12-17 18:22:37 +11:00
parent 108ad3c7c3
commit b218e62ffc
No known key found for this signature in database
GPG key ID: 740D3A86CF435835
151 changed files with 42251 additions and 31034 deletions

View file

@ -1,12 +1,13 @@
package util_test
import (
"github.com/stretchr/testify/require"
"heckel.io/ntfy/util"
"math/rand"
"sync"
"testing"
"time"
"github.com/stretchr/testify/require"
"heckel.io/ntfy/util"
)
func TestBatchingQueue_InfTimeout(t *testing.T) {

View file

@ -2,9 +2,10 @@ package util
import (
"crypto/rand"
"github.com/stretchr/testify/require"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/require"
)
func TestSniffWriter_WriteHTML(t *testing.T) {

View file

@ -2,11 +2,12 @@ package util
import (
"embed"
"github.com/stretchr/testify/require"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/stretchr/testify/require"
)
var (

View file

@ -2,11 +2,12 @@ package util
import (
"compress/gzip"
"github.com/stretchr/testify/require"
"io"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/require"
)
func TestGzipHandler(t *testing.T) {

View file

@ -2,10 +2,11 @@ package util
import (
"errors"
"golang.org/x/time/rate"
"io"
"sync"
"time"
"golang.org/x/time/rate"
)
// ErrLimitReached is the error returned by the Limiter and LimitWriter when the predefined limit has been reached

View file

@ -2,9 +2,10 @@ package util
import (
"bytes"
"github.com/stretchr/testify/require"
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestFixedLimiter_Add(t *testing.T) {

View file

@ -1,10 +1,11 @@
package util
import (
"github.com/stretchr/testify/require"
"io"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestPeak_LimitReached(t *testing.T) {

View file

@ -2,11 +2,12 @@ package util
import (
"errors"
"github.com/olebedev/when"
"regexp"
"strconv"
"strings"
"time"
"github.com/olebedev/when"
)
var (

View file

@ -1,9 +1,10 @@
package util
import (
"github.com/stretchr/testify/require"
"testing"
"time"
"github.com/stretchr/testify/require"
)
var (