Added sample file for git hook
This commit is contained in:
1 parent
9c1ec01ce0
commit
434f808095
1 file changed
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copy this file to .git/hooks
|
||||
|
||||
# Run clang-format before commiting
|
||||
files=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(cpp|hpp)$')
|
||||
[ -z "$files" ] && exit 0
|
||||
clang-format -i $files
|
||||
git add $files
|
||||
Reference in new issue
Block a user