forked from evilmartians/lefthook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 1.25 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
COMMIT_HASH = $(shell git rev-parse HEAD)
build:
go build -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook
build-with-coverage:
go build -cover -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook
install: build
cp lefthook $$(go env GOPATH)/bin
test:
go test -cpu 24 -race -count=1 -timeout=30s ./...
test-integrity: install
go test -cpu 24 -race -count=1 -timeout=30s -tags=integrity integrity_test.go
bench:
go test -cpu 24 -race -run=Bench -bench=. ./...
bin/golangci-lint:
@test -x $$(go env GOPATH)/bin/golangci-lint || \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.56.2
lint: bin/golangci-lint
$$(go env GOPATH)/bin/golangci-lint run --fix
.ONESHELL:
version:
@read -p "New version: " version
sed -i "s/const version = .*/const version = \"$$version\"/" internal/version/version.go
sed -i "s/VERSION := .*/VERSION := $$version/" packaging/Makefile
sed -i "s/lefthook-plugin.git\", exact: \".*\"/lefthook-plugin.git\", exact: \"$$version\"/" docs/install.md
make -C packaging clean set-version
git add internal/version/version.go packaging/* docs/install.md