Skip to content

Commit 21a8aaa

Browse files
committed
Properly sort imports
1 parent e3cabcb commit 21a8aaa

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
OUT_DIR := ./out
22
GO_FILES := $(shell find . -type f \( -iname '*.go' \))
3+
GO_MODULE := github.com/pushbits/cli
34

45
.PHONY: build
56
build:
@@ -12,17 +13,18 @@ clean:
1213

1314
.PHONY: test
1415
test:
15-
stdout=$$(gofumpt -l . 2>&1); if [ "$$stdout" ]; then exit 1; fi
16+
if [ -n "$$(gofumpt -l $(GO_FILES))" ]; then echo "Code is not properly formatted"; exit 1; fi
17+
if [ -n "$$(goimports -l -local $(GO_MODULE) $(GO_FILES))" ]; then echo "Imports are not properly formatted"; exit 1; fi
1618
go vet ./...
1719
misspell -error $(GO_FILES)
1820
gocyclo -over 10 $(GO_FILES)
1921
staticcheck ./...
20-
errcheck ./...
22+
errcheck -ignoregenerated ./...
2123
gocritic check -disable='#experimental,#opinionated' [email protected] 3 ./...
2224
revive -set_exit_status ./...
2325
nilaway ./...
2426
go test -v -cover ./...
25-
gosec -exclude-dir=tests ./...
27+
gosec -exclude-generated ./...
2628
govulncheck ./...
2729
@printf '\n%s\n' "> Test successful"
2830

@@ -35,6 +37,7 @@ setup:
3537
go install github.com/mgechev/revive@latest
3638
go install github.com/securego/gosec/v2/cmd/gosec@latest
3739
go install go.uber.org/nilaway/cmd/nilaway@latest
40+
go install golang.org/x/tools/cmd/goimports@latest
3841
go install golang.org/x/vuln/cmd/govulncheck@latest
3942
go install honnef.co/go/tools/cmd/staticcheck@latest
4043
go install mvdan.cc/gofumpt@latest

internal/api/mod.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import (
99
"net/url"
1010
"strings"
1111

12-
"github.com/pushbits/cli/internal/handling"
1312
log "github.com/sirupsen/logrus"
13+
14+
"github.com/pushbits/cli/internal/handling"
1415
)
1516

1617
func buildURL(baseStr string, endpoint string) *url.URL {

0 commit comments

Comments
 (0)