From efe028a54fea585b288aa62ca0f27b693e2ef57c Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Wed, 10 Jun 2026 19:30:15 +0200 Subject: [PATCH] chore: improve the pre-commit hook --- .githooks/pre-commit | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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..."