mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05: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:
parent
1f90a41b89
commit
e3797076d9
@ -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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user