summaryrefslogtreecommitdiff
path: root/.githooks
diff options
context:
space:
mode:
authorKajetan <[email protected]>2023-03-02 21:54:59 +0100
committerKajetan <[email protected]>2023-03-02 21:54:59 +0100
commitdb63470ee932941f292069c00890845e69de40d3 (patch)
treec4269f238eaaba2448f3560f4aa2c27511c774c6 /.githooks
parent58dfc803373800e4ced0e8bcce5bcd1db0f2b7f6 (diff)
feat: git hooks for go linter
Diffstat (limited to '.githooks')
-rwxr-xr-x.githooks/pre-commit10
1 files changed, 10 insertions, 0 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
new file mode 100755
index 00000000..630bd781
--- /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 run "$@" \ No newline at end of file