diff --git a/.githooks/pre-commit b/.githooks/pre-commit index a74fd90..b328071 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -13,10 +13,8 @@ if [ -z "$FILES" ]; then exit 0 fi -for file in $FILES; do - clang-format -i "$file" - git add "$file" -done +git diff -U0 --cached | \ +python3 <(curl -s https://raw.githubusercontent.com/llvm/llvm-project/refs/heads/main/clang/tools/clang-format/clang-format-diff.py) -p1 -i echo "Running clang-tidy..."