-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
47 lines (37 loc) · 1.35 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
.PHONY: all
all: lint test build
.PHONY: build
build:
go build -a -o vervet ./cmd/vervet
# Run go mod tidy yourself
#----------------------------------------------------------------------------------
# Check for updates to packages in remote OSS repositories and update go.mod AND
# go.sum to match changes. Then download the all the dependencies
# This catches when your app has colliding versions of packages during updates
#----------------------------------------------------------------------------------
.PHONY: update-deps
update-deps:
go get -d -u ./...
# go mod download yourself if you don't need to update
.PHONY: lint
lint:
golangci-lint run -v ./...
(cd versionware/example; golangci-lint run -v ./...)
.PHONY: lint-docker
lint-docker:
docker run --rm -v $(shell pwd):/vervet -w /vervet golangci/golangci-lint:v1.42.1 golangci-lint run -v ./...
#----------------------------------------------------------------------------------
# Ignores the test cache and forces a full test suite execution
#----------------------------------------------------------------------------------
.PHONY: test
test:
go test ./... -count=1
(cd versionware/example; go generate . && go test ./... -count=1)
.PHONY: test-coverage
test-coverage:
go test ./... -count=1 -coverprofile=covfile
go tool cover -html=covfile
rm -f covfile
.PHONY: clean
clean:
$(RM) vervet