mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 12:56:21 +00:00
Add filetype check to pre hook example
We have `Language: Cpp` in .clang-format but recently it tried to format my makefile anyways. Let's add this to be sure.
This commit is contained in:
@@ -15,7 +15,9 @@ You can add the following snippet to `.git/hooks/pre-commit`:
|
||||
```shell
|
||||
for f in $(git diff --cached --name-only)
|
||||
do
|
||||
clang-format -i $f
|
||||
if [[ "$f" =~ \.(c|h)$ ]]; then
|
||||
clang-format -i $f
|
||||
fi
|
||||
done
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user