forked from kf5i/k3ai-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (28 loc) · 913 Bytes
/
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
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
TEST_FLAGS ?=
build-cli:
go build -o bin/k3ai
.PHONY: lint
lint: check-format
go get golang.org/x/lint/golint
go vet ./...
golint -set_exit_status=1 ./...
.PHONY: check-format
check-format:
@echo "Running gofmt..."
$(eval unformatted=$(shell find . -name '*.go' | grep -v ./.git | grep -v vendor | xargs gofmt -s -l))
$(if $(strip $(unformatted)),\
$(error $(\n) Some files are ill formatted! Run: \
$(foreach file,$(unformatted),$(\n) gofmt -w -s $(file))$(\n)),\
@echo All files are well formatted.\
)
.PHONY: test
test:
go test $(TEST_FLAGS) -coverprofile=coverage.txt -covermode=atomic -race ./...
integration-test:
go test -tags integration -coverprofile=coverage.txt -covermode=atomic -race ./...