-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
25 lines (18 loc) · 808 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
.PHONY: test coverage build pre-commit dependencies install-golangci-lint install-pre-commit
test:
go test ./... -shuffle on -race -coverprofile=coverage.out
coverage: test
go tool cover -html=coverage.out
build:
goreleaser build --single-target --snapshot --rm-dist
pre-commit: dependencies
@pre-commit install
dependencies: install-golangci-lint install-pre-commit
install-golangci-lint:
@command -v golangci-lint >/dev/null 2>&1 || { \
echo "Installing golangci-lint..."; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.55.2; \
}
install-pre-commit:
@command -v asdf >/dev/null 2>&1 && asdf plugin-add pre-commit || true
@command -v asdf >/dev/null 2>&1 && asdf install pre-commit || pip install pre-commit