Commit 68dcb05d authored by Ivan Vandot's avatar Ivan Vandot Committed by GitHub

Git pre push hook (#165)

parent 9f7e1e80
#!/usr/bin/env bash
set -euo pipefail
# Check if we actually have commits to push
commits=$(git log @{u}..)
if [ -z "$commits" ]; then
exit 0
fi
if ! command -v golangci-lint &> /dev/null; then
echo "installing golangci-lint..."
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
fi
make lint vet test-race
......@@ -39,6 +39,10 @@ build: export CGO_ENABLED=0
build:
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...
.PHONY: githooks
githooks:
ln -f -s ../../.githooks/pre-push.bash .git/hooks/pre-push
.PHONY: clean
clean:
$(GO) clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment