summaryrefslogtreecommitdiff
path: root/bin/git-pre-commit-hook
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2022-05-20 12:06:31 -0400
committerGitHub <noreply@github.com>2022-05-20 12:06:31 -0400
commit8ab4abf190778867a8eccde08733c45f3760b2d0 (patch)
treef5b63f5e192c36d8c6bf47e4c30c68d8b1a73728 /bin/git-pre-commit-hook
parent1316e8132e58361f42cb4315c586e0e2cccfc64c (diff)
parent47123198760f8740acda0799d3b22f14b3f69550 (diff)
Merge pull request #1548 from inkstitch/feature_guided_fill
Feature guided fill
Diffstat (limited to 'bin/git-pre-commit-hook')
-rwxr-xr-xbin/git-pre-commit-hook17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/git-pre-commit-hook b/bin/git-pre-commit-hook
new file mode 100755
index 00000000..81ace2cd
--- /dev/null
+++ b/bin/git-pre-commit-hook
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# copy (DO NOT SYMLINK) this file to .git/hooks/pre-commit
+# to check style on all modified files before allowing the commit to complete
+#
+# DO NOT SYMLINK
+# DO NOT SYMLINK
+# DO NOT SYMLINK (why? security risk)
+
+cd $(dirname "$0")/../..
+
+errors=$(git diff --cached | bin/style-check --diff 2>&1)
+
+if [ "$?" != "0" ]; then
+ echo "$errors"
+ exit 1
+fi