summaryrefslogtreecommitdiff
path: root/hooks/clang-tidy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hooks/clang-tidy.sh')
-rwxr-xr-xhooks/clang-tidy.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/hooks/clang-tidy.sh b/hooks/clang-tidy.sh
new file mode 100755
index 00000000..c51b4f7b
--- /dev/null
+++ b/hooks/clang-tidy.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env sh
+
+if [[ ! -f .clang-tidy ]]; then
+ echo Cannot find .clang-tidy
+ exit 1
+fi
+
+echo Running clang-tidy
+clang-tidy -p cmake-build-debug $(git diff --staged --name-only --diff-filter=AM)