Skip to content

Commit b42989b

Browse files
committed
chore: enhance pre-commit and pre-push hooks
1 parent 5a389a6 commit b42989b

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.githooks/pre-commit

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
#!/bin/sh
2+
set -e # Exit immediately if any command exits with a non-zero status
23

3-
make test
4+
echo ""
5+
echo '* Verify dependencies'
6+
go mod verify
7+
8+
echo ""
9+
echo '* Run: go-modernize'
10+
modernize -test ./...
11+
12+
echo ""
13+
echo '* Run: golangci'
14+
golangci-lint run ./...
15+
16+
echo ""
17+
echo '* Run: all tests and generate coverage report'
18+
go clean -testcache
19+
go test -count=1 -timeout 30s ./... -covermode=atomic

.githooks/pre-push

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
#!/bin/sh
2+
set -e # Exit immediately if any command exits with a non-zero status
23

3-
make _go_tools
4+
echo ""
5+
echo '* Verify dependencies'
6+
go mod verify
7+
8+
echo ""
9+
echo '* Run: go-modernize'
10+
modernize -test ./...
11+
12+
echo ""
13+
echo '* Run: golangci'
14+
golangci-lint run ./...
15+
16+
echo ""
17+
echo '* Run: all tests and generate coverage report'
18+
go clean -testcache
19+
go test -count=1 -timeout 30s ./... -covermode=atomic

0 commit comments

Comments
 (0)