summaryrefslogtreecommitdiff
path: root/.githooks
diff options
context:
space:
mode:
Diffstat (limited to '.githooks')
-rw-r--r--.githooks/pre-commit10
1 files changed, 10 insertions, 0 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
new file mode 100644
index 00000000..907bebe4
--- /dev/null
+++ b/.githooks/pre-commit
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e -o pipefail
+
+if ! command -v golangci-lint &> /dev/null; then
+ echo "golangci-lint is not installed"
+ exit 1
+fi
+
+exec golangci-lint --build-tags=race run "$@"