-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 1.01 KB
/
Makefile
File metadata and controls
47 lines (35 loc) · 1.01 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
VERSION ?= $(shell sh ./scripts/versions.sh lab)
FERRET_VERSION = $(shell sh ./scripts/versions.sh ferret)
DIR_BIN = ./bin
DIR_PKG = ./pkg
DIR_CMD = ./cmd
NAME = lab
default: build
build: vet test compile
install-tools:
go install honnef.co/go/tools/cmd/staticcheck@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install github.com/mgechev/revive@latest
install:
go get
compile:
go build -v -o ${DIR_BIN}/${NAME} \
-ldflags "-X main.version=${VERSION} -X github.com/MontFerret/lab/v2/pkg/runtime.version=${FERRET_VERSION}" \
./main.go
test:
go test ./...
cover:
go test -race -coverprofile=coverage.txt -covermode=atomic ... && \
curl -s https://codecov.io/bash | bash
doc:
godoc -http=:6060 -index
fmt:
go fmt ./... && \
goimports -w -local github.com/MontFerret ${DIR_PKG} ${DIR_CMD} main.go
lint:
staticcheck ./... && \
revive -config revive.toml -formatter stylish -exclude ./pkg/parser/fql/... -exclude ./vendor/... ./...
vet:
go vet ./...
release:
./scripts/release.sh $(TAG)