-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (40 loc) · 1.27 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
53
54
GIT_VERSION := $(shell git rev-parse HEAD)
GIT_SHORT_VERSION := $(shell git rev-parse --short HEAD)
TAG_VERSION := $(shell git tag -l --contains $$GIT_VERSION | tail -1)
CURRENT_DATE := $(shell date "+%Y-%m-%d")
BUILD_TIMESTAMP := $(shell TZ='GMT' date '+%Y-%m-%d %H:%M:%S')
PKGS := $(shell go list ./... | grep -v /vendor)
SRC_DIRS := . $(addprefix .,$(subst github.com/coyim/constbn,,$(PKGS)))
SRC_TEST := $(foreach sdir,$(SRC_DIRS),$(wildcard $(sdir)/*_test.go))
SRC_ALL := $(foreach sdir,$(SRC_DIRS),$(wildcard $(sdir)/*.go))
SRC := $(filter-out $(SRC_TEST), $(SRC_ALL))
GO := go
GOGET := $(GO) get
GOINSTALL := $(GO) install
GOBUILD := $(GO) build
GOTEST := $(GO) test
default: check
check: quality test
quality: lint gosec ineffassign lint-ci
lint:
golint -set_exit_status $(SRC_DIRS)
gosec:
gosec .
ineffassign:
ineffassign .
lint-ci:
golangci-lint run .
test:
$(GOTEST) -cover -v .
run-cover:
$(GOTEST) -coverprofile=coverage.out -v .
coverage: run-cover
go tool cover -html=coverage.out
coverage-tails: run-cover
go tool cover -html=coverage.out -o ~/Tor\ Browser/coverage.html
xdg-open ~/Tor\ Browser/coverage.html
deps-ci:
$(GOINSTALL) github.com/mattn/goveralls
$(GOINSTALL) golang.org/x/lint/golint
coveralls: run-cover
goveralls -coverprofile=coverage.out