summaryrefslogtreecommitdiffstats
path: root/.claude/hooks/clang-format.sh
diff options
context:
space:
mode:
Diffstat (limited to '.claude/hooks/clang-format.sh')
-rwxr-xr-x.claude/hooks/clang-format.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/.claude/hooks/clang-format.sh b/.claude/hooks/clang-format.sh
new file mode 100755
index 0000000..28b4c9c
--- /dev/null
+++ b/.claude/hooks/clang-format.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+file_path=$(jq -r '.tool_input.file_path')
+if [[ "$file_path" =~ \.(c|h|cpp|hpp)$ ]]; then
+ clang-format -i "$file_path"
+fi