mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -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
|
||||
for f in $(git diff --cached --name-only)
|
||||
do
|
||||
clang-format -i $f
|
||||
if [[ "$f" =~ \.(c|h)$ ]]; then
|
||||
clang-format -i $f
|
||||
fi
|
||||
done
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user