Unverified Commit 91510e35 authored by Kip's avatar Kip Committed by GitHub

Merge pull request #906 from Tachi107/git-format-hook

Add pre-commit format hook
parents e3c40485 ea39290f
#!/bin/sh
for file in $(git diff-index --cached --name-only HEAD | grep -E '\.(cpp|cc|hpp|h)$') ; do
clang-format --dry-run --Werror "$file" >/dev/null 2>&1 || (echo 'Run ninja clang-format before committing' && false)
done
......@@ -106,3 +106,5 @@ endif
if get_option('PISTACHE_BUILD_DOCS')
subdir('docs')
endif
run_command('git', 'config', '--local', 'core.hooksPath', '.hooks')
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment