summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.githooks/pre-commit10
-rwxr-xr-xgithooks-installer.sh7
2 files changed, 17 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
diff --git a/githooks-installer.sh b/githooks-installer.sh
new file mode 100755
index 00000000..b97d0a9a
--- /dev/null
+++ b/githooks-installer.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+cp ./.githooks/pre-commit .git/hooks/pre-commit
+
+echo "DONE" \ No newline at end of file