-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (33 loc) · 1.11 KB
/
Makefile
File metadata and controls
39 lines (33 loc) · 1.11 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
# ==============================================================================
# Arguments passing to Makefile commands
GO_INSTALLED := $(shell which go)
SS_INSTALLED := $(shell which staticcheck 2> /dev/null)
GITHUB=gotrackery
PROJECT_NAME=$(notdir $(shell pwd))
# ==============================================================================
# Install commands
install-tools:
@echo Checking tools are installed...
ifndef SS_INSTALLED
@echo Installing staticcheck...
@go install honnef.co/go/tools/cmd/staticcheck@latest
endif
# ==============================================================================
# Modules support
tidy:
@echo Running go mod tidy...
@go mod tidy
# ==============================================================================
# Test commands
lint: install-tools
@echo Running lints...
@go vet ./...
@staticcheck ./...
@golangci-lint run
tests:
@echo Running tests...
@go test -v -race -vet=off $$(go list ./... | grep -v /test/)
cover:
@echo Running coverage tests...
@go test -vet=off -coverprofile ./cover.out $$(go list ./... | grep -v /test/)
@go tool cover -html=./cover.out