-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (51 loc) · 1.47 KB
/
Makefile
File metadata and controls
62 lines (51 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
PKGS := github.com/seacraft/errors
SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS))
GO := go
check: test vet gofmt misspell unconvert staticcheck ineffassign unparam
test:
$(GO) test $(PKGS)
vet: | test
$(GO) vet $(PKGS)
staticcheck:
ifeq (,$(shell which staticcheck 2>/dev/null))
@echo "===========> Installing staticcheck"
$(GO) install honnef.co/go/tools/cmd/staticcheck@v0.4.6
endif
staticcheck -checks all $(PKGS)
misspell:
ifeq (,$(shell which misspell 2>/dev/null))
@echo "===========> Installing misspell"
$(GO) install github.com/client9/misspell/cmd/misspell@v0.3.4
endif
misspell \
-locale GB \
-error \
*.md *.go
unconvert:
ifeq (,$(shell which unconvert 2>/dev/null))
@echo "===========> Installing unconvert"
$(GO) install github.com/mdempsky/unconvert@latest
endif
unconvert -v $(PKGS)
ineffassign:
ifeq (,$(shell which ineffassign 2>/dev/null))
@echo "===========> Installing ineffassign"
$(GO) install github.com/gordonklaus/ineffassign@v0.1.0
endif
find $(SRCDIRS) -name '*.go' | xargs ineffassign
pedantic: check errcheck
unparam:
ifeq (,$(shell which unparam 2>/dev/null))
@echo "===========> Installing unparam"
$(GO) install mvdan.cc/unparam@latest
endif
unparam ./...
errcheck:
ifeq (,$(shell which errcheck 2>/dev/null))
@echo "===========> Installing errcheck"
$(GO) install github.com/kisielk/errcheck@v1.7.0
endif
errcheck $(PKGS)
gofmt:
@echo Checking code is gofmted
@test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)"