Properly sort imports

This commit is contained in:
eikendev
2025-02-22 22:54:34 +01:00
parent e3cabcba69
commit 21a8aaa517
2 changed files with 8 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
OUT_DIR := ./out OUT_DIR := ./out
GO_FILES := $(shell find . -type f \( -iname '*.go' \)) GO_FILES := $(shell find . -type f \( -iname '*.go' \))
GO_MODULE := github.com/pushbits/cli
.PHONY: build .PHONY: build
build: build:
@@ -12,17 +13,18 @@ clean:
.PHONY: test .PHONY: test
test: test:
stdout=$$(gofumpt -l . 2>&1); if [ "$$stdout" ]; then exit 1; fi if [ -n "$$(gofumpt -l $(GO_FILES))" ]; then echo "Code is not properly formatted"; exit 1; fi
if [ -n "$$(goimports -l -local $(GO_MODULE) $(GO_FILES))" ]; then echo "Imports are not properly formatted"; exit 1; fi
go vet ./... go vet ./...
misspell -error $(GO_FILES) misspell -error $(GO_FILES)
gocyclo -over 10 $(GO_FILES) gocyclo -over 10 $(GO_FILES)
staticcheck ./... staticcheck ./...
errcheck ./... errcheck -ignoregenerated ./...
gocritic check -disable='#experimental,#opinionated' -@ifElseChain.minThreshold 3 ./... gocritic check -disable='#experimental,#opinionated' -@ifElseChain.minThreshold 3 ./...
revive -set_exit_status ./... revive -set_exit_status ./...
nilaway ./... nilaway ./...
go test -v -cover ./... go test -v -cover ./...
gosec -exclude-dir=tests ./... gosec -exclude-generated ./...
govulncheck ./... govulncheck ./...
@printf '\n%s\n' "> Test successful" @printf '\n%s\n' "> Test successful"
@@ -35,6 +37,7 @@ setup:
go install github.com/mgechev/revive@latest go install github.com/mgechev/revive@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest go install github.com/securego/gosec/v2/cmd/gosec@latest
go install go.uber.org/nilaway/cmd/nilaway@latest go install go.uber.org/nilaway/cmd/nilaway@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/vuln/cmd/govulncheck@latest go install golang.org/x/vuln/cmd/govulncheck@latest
go install honnef.co/go/tools/cmd/staticcheck@latest go install honnef.co/go/tools/cmd/staticcheck@latest
go install mvdan.cc/gofumpt@latest go install mvdan.cc/gofumpt@latest

View File

@@ -9,8 +9,9 @@ import (
"net/url" "net/url"
"strings" "strings"
"github.com/pushbits/cli/internal/handling"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/pushbits/cli/internal/handling"
) )
func buildURL(baseStr string, endpoint string) *url.URL { func buildURL(baseStr string, endpoint string) *url.URL {