Skip to content

Commit 022e5e7

Browse files
committed
chore: add Makefile
1 parent da0c610 commit 022e5e7

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Makefile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.POSIX:
2+
.SUFFIXES:
3+
4+
all: test lint
5+
6+
test:
7+
go test -race -shuffle=on -cover ./...
8+
9+
test/cover:
10+
go test -race -shuffle=on -coverprofile=coverage.out ./...
11+
go tool cover -html=coverage.out
12+
13+
lint:
14+
golangci-lint run
15+
16+
tidy:
17+
go mod tidy
18+
19+
generate:
20+
go generate ./...
21+
22+
# run `make pre-commit` once to install the hook.
23+
pre-commit: .git/hooks/pre-commit test lint tidy generate
24+
git diff --exit-code
25+
26+
.git/hooks/pre-commit:
27+
echo "make pre-commit" > .git/hooks/pre-commit
28+
chmod +x .git/hooks/pre-commit

0 commit comments

Comments
 (0)