-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
43 lines (34 loc) · 1.12 KB
/
Makefile
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
GOBIN = $(shell go env GOPATH)/bin
SERUM := $(shell command -v go-serum-analyzer)
MODULE := $(shell go list -m)
install:
@echo "Installing plugins..."
mkdir -p $(GOBIN)
# ignore errors when copying plugins (cp does not like copying over symbolic links)
-cp ./plugins/* $(GOBIN)
@echo "Building and installing warpforge..."
go install ./...
@echo "Install complete!"
test:
ifndef SERUM
@echo "go-serum-analyzer executable not found, skipping error analysis"
@echo "go-serum-analyzer can be installed from https://github.com/serum-errors/go-serum-analyzer"
@echo
else
-$(SERUM) -strict ./...
endif
go test ./...
@stty sane
imports:
goimports -local=$(MODULE) -w ./cmd ./pkg ./wfapi ./larkdemo
imports-test:
# ideally this would return a non-zero exit code when it detects output
goimports -local=$(MODULE) -l ./cmd ./pkg ./wfapi ./larkdemo
vet:
go vet ./...
shadow:
# go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
@command -v shadow # errors if shadow is not an available command
go vet -vettool=$$(command -v shadow) ./...
all: test install
.PHONY: install test all shadow vet imports imports-test