We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3244b9e commit 341a64fCopy full SHA for 341a64f
scripts/git-precommit-hook.sh
@@ -1,7 +1,7 @@
1
#!/usr/bin/env bash
2
3
-CFILES=$(git diff-index --cached --name-only HEAD | grep -E "^(examples|include|src|tests/unit).*\.(c|h|cpp)$")
4
-PYFILES=$(git diff-index --cached --name-only HEAD | grep -E "^tests.*\.py$")
+CFILES=$(git diff-index --cached --name-only --diff-filter=dr HEAD | grep -E "^(examples|include|src|tests/unit).*\.(c|h|cpp)$")
+PYFILES=$(git diff-index --cached --name-only --diff-filter=dr HEAD | grep -E "^tests.*\.py$")
5
6
if [ -n "$CFILES" ]; then
7
.venv/bin/clang-format -i $CFILES
0 commit comments