Skip to content

Commit

Permalink
chore: add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
tmzane committed Mar 14, 2024
1 parent b60cf0a commit 09db1f9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.POSIX:
.SUFFIXES:

all: test lint

test:
go test -race -shuffle=on -cover ./...

test/cover:
go test -race -shuffle=on -coverprofile=coverage.out ./...
go tool cover -html=coverage.out

lint:
golangci-lint run

tidy:
go mod tidy

generate:
go generate ./...

# run `make pre-commit` once to install the hook.
pre-commit: .git/hooks/pre-commit test lint tidy generate
git diff --exit-code

.git/hooks/pre-commit:
echo "make pre-commit" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

0 comments on commit 09db1f9

Please sign in to comment.