-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
52 lines (43 loc) · 1.49 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
43
44
45
46
47
48
49
50
51
52
.PHONY: test lint check cover
.PHONY: install-linters
.PHONY: build install
test: ## Run tests for Wing Commander
go test -race ./... -timeout=5m
build:
go build -v ./cmd/wcbot/.
install:
go install -v ./...
lint: ## Run linters. Use make install-linters first.
vendorcheck ./...
$(GOPATH)/bin/golangci-lint run --no-config --deadline=3m --disable-all --tests \
-E golint \
-E goimports \
-E varcheck \
-E unparam \
-E deadcode \
-E structcheck \
-E errcheck \
-E gosimple \
-E staticcheck \
-E unused \
-E ineffassign \
-E typecheck \
-E gas \
-E megacheck \
-E misspell \
./...
# The govet version in golangci-lint is out of date and has spurious warnings, run it separately
#go vet -all ./...
check: lint cover ## Run coverage tests and linters
cover: ## Runs tests on ./cmd/ with HTML code coverage
go test -race -cover -coverprofile=cover.out -coverpkg=github.com/BigOokie/skywire-wing-commander/... ./...
go tool cover -html=cover.out
install-linters: ## Install linters
go get -u github.com/FiloSottile/vendorcheck
# Using v1.10.2
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $(GOPATH)/bin v1.10.2
#format: ## Formats the code. Must have goimports installed (use make install-linters).
# goimports -w -local github.com/BigOokie/skywire-wing-commander ./cmd
# goimports -w -local github.com/BigOokie/skywire-wing-commander ./internal
#release: check ## Use GoReleaser to build, package and release
# goreleaser --rm-dist