feat(ci): use goimports to format import statements

This commit is contained in:
Łukasz Mierzwa
2021-12-16 20:51:52 +00:00
committed by Łukasz Mierzwa
parent 087c9c1398
commit 650fdca8e6
23 changed files with 77 additions and 9 deletions
+2 -1
View File
@@ -12,9 +12,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/jarcoal/httpmock"
"github.com/prometheus/common/model"
"github.com/rs/zerolog"
"github.com/prymitive/karma/internal/config"
"github.com/prymitive/karma/internal/regex"
"github.com/rs/zerolog"
)
type prometheusAPIV1Labels struct {
+2 -1
View File
@@ -9,8 +9,9 @@ import (
"strings"
"time"
"github.com/prymitive/karma/ui"
"github.com/rs/zerolog/log"
"github.com/prymitive/karma/ui"
)
func contentText(w http.ResponseWriter) {
+1
View File
@@ -8,6 +8,7 @@ import (
lru "github.com/hashicorp/golang-lru"
"github.com/jarcoal/httpmock"
"github.com/prymitive/karma/internal/alertmanager"
"github.com/prymitive/karma/internal/mock"
)
+2 -1
View File
@@ -9,9 +9,10 @@ import (
"runtime"
"testing"
"github.com/rs/zerolog"
"github.com/prymitive/karma/internal/mock"
"github.com/prymitive/karma/internal/models"
"github.com/rs/zerolog"
)
func reportMemoryMetrics(b *testing.B) {
+2 -1
View File
@@ -10,8 +10,9 @@ import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/prometheus/client_golang/prometheus"
"github.com/prymitive/karma/internal/config"
"github.com/rs/zerolog/log"
"github.com/prymitive/karma/internal/config"
)
var (
+1
View File
@@ -4,6 +4,7 @@ import (
"runtime"
"github.com/prometheus/client_golang/prometheus"
"github.com/prymitive/karma/internal/alertmanager"
)
+1
View File
@@ -10,6 +10,7 @@ import (
"strings"
"github.com/go-chi/chi/v5"
"github.com/prymitive/karma/internal/alertmanager"
"github.com/prymitive/karma/internal/config"
"github.com/prymitive/karma/internal/mapper"
+2 -1
View File
@@ -15,10 +15,11 @@ import (
lru "github.com/hashicorp/golang-lru"
"github.com/jarcoal/httpmock"
"github.com/pmezard/go-difflib/difflib"
"github.com/rs/zerolog"
"github.com/prymitive/karma/internal/alertmanager"
"github.com/prymitive/karma/internal/config"
"github.com/prymitive/karma/internal/mock"
"github.com/rs/zerolog"
)
// httptest.NewRecorder() doesn't implement http.CloseNotifier
+1
View File
@@ -15,6 +15,7 @@ import (
"github.com/cnf/structhash"
"github.com/fvbommel/sortorder"
"github.com/prymitive/karma/internal/alertmanager"
"github.com/prymitive/karma/internal/config"
"github.com/prymitive/karma/internal/filters"
+1
View File
@@ -18,6 +18,7 @@ import (
"github.com/beme/abide"
lru "github.com/hashicorp/golang-lru"
"github.com/prymitive/karma/internal/alertmanager"
"github.com/prymitive/karma/internal/config"
"github.com/prymitive/karma/internal/mock"
+2 -1
View File
@@ -3,9 +3,10 @@ package alertmanager_test
import (
"testing"
"github.com/spf13/pflag"
"github.com/prymitive/karma/internal/alertmanager"
"github.com/prymitive/karma/internal/config"
"github.com/spf13/pflag"
)
func BenchmarkDedupAlerts(b *testing.B) {
+2 -1
View File
@@ -8,10 +8,11 @@ import (
"time"
"github.com/google/go-cmp/cmp"
"github.com/prymitive/karma/internal/uri"
"github.com/rs/zerolog"
"github.com/spf13/pflag"
"github.com/prymitive/karma/internal/uri"
"github.com/pmezard/go-difflib/difflib"
yaml "gopkg.in/yaml.v3"
+1
View File
@@ -5,6 +5,7 @@ import (
"time"
"github.com/Masterminds/semver/v3"
"github.com/prymitive/karma/internal/mapper"
"github.com/prymitive/karma/internal/models"
)
+1
View File
@@ -5,6 +5,7 @@ import (
"time"
"github.com/Masterminds/semver/v3"
"github.com/prymitive/karma/internal/mapper"
"github.com/prymitive/karma/internal/models"
)
+1
View File
@@ -7,6 +7,7 @@ import (
"github.com/cnf/structhash"
"github.com/fvbommel/sortorder"
"github.com/prymitive/karma/internal/config"
)
+1
View File
@@ -6,6 +6,7 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/prymitive/karma/internal/config"
"github.com/prymitive/karma/internal/models"
)
+1
View File
@@ -6,6 +6,7 @@ import (
"strings"
"github.com/fvbommel/sortorder"
"github.com/prymitive/karma/internal/config"
"github.com/prymitive/karma/internal/slices"
)
+1
View File
@@ -5,6 +5,7 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/prymitive/karma/internal/config"
"github.com/prymitive/karma/internal/models"
)
+2 -1
View File
@@ -12,8 +12,9 @@ import (
"testing"
"time"
"github.com/prymitive/karma/internal/uri"
"github.com/rs/zerolog"
"github.com/prymitive/karma/internal/uri"
)
type httpTransportTest struct {
+4 -1
View File
@@ -41,9 +41,12 @@ $(GOBIN)/golangci-lint: tools/golangci-lint/go.mod tools/golangci-lint/go.sum
lint-go: $(GOBIN)/golangci-lint lint-go-looppointer
$(ENV) golangci-lint run -v --timeout 5m -E staticcheck,misspell,promlinter,revive,tenv,errorlint,exportloopref,predeclared
$(GOBIN)/lint-go-goimports: tools/goimports/go.mod tools/goimports/go.sum
go install -modfile=tools/goimports/go.mod golang.org/x/tools/cmd/goimports
.PHONY: format-go
format-go:
format-go: $(GOBIN)/lint-go-goimports
gofmt -l -s -w .
goimports -local github.com/prymitive/karma -w .
.PHONY: download-deps-go
download-deps-go:
+11
View File
@@ -0,0 +1,11 @@
module _
go 1.17
require golang.org/x/tools v0.1.8
require (
golang.org/x/mod v0.5.1 // indirect
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
)
+28
View File
@@ -0,0 +1,28 @@
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.8 h1:P1HhGGuLW4aAclzjtmJdf0mJOjVUZUzOTqkAkWL+l6w=
golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+7
View File
@@ -0,0 +1,7 @@
//go:build tools
package tools
import (
_ "golang.org/x/tools/cmd/goimports"
)