1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +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:
Michael Vetter 2020-07-15 11:36:39 +02:00
parent 1f90a41b89
commit e3797076d9

View File

@ -15,7 +15,9 @@ You can add the following snippet to `.git/hooks/pre-commit`:
```shell ```shell
for f in $(git diff --cached --name-only) for f in $(git diff --cached --name-only)
do do
clang-format -i $f if [[ "$f" =~ \.(c|h)$ ]]; then
clang-format -i $f
fi
done done
``` ```