forked from cjfinnell/pgverify
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (26 loc) · 857 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
.PHONY: build
build:
go build -o pgverify ./cmd/pgverify
.PHONY: clean
clean:
@rm -f pgverify coverage.txt ||:
@rm -rf .bin ||:
@go clean -testcache ||:
.PHONY: lint
lint: .bin/golangci-lint
@.bin/golangci-lint run
.PHONY: lint-fix
lint-fix: .bin/golangci-lint
@.bin/golangci-lint run --fix
.PHONY: unit-test
unit-test:
go test -v -short ./...
.PHONY: test
test:
go test -v -cover -coverprofile coverage.txt -covermode=atomic -race ./...
################################################################################
# Tools
################################################################################
.bin/golangci-lint: $(wildcard vendor/github.com/golangci/*/*.go)
@echo "building linter..."
@cd vendor/github.com/golangci/golangci-lint/cmd/golangci-lint && go build -o $(shell git rev-parse --show-toplevel)/.bin/golangci-lint .