Convert format hook to format check hook

parent 739b57ce
#!/bin/sh
set -eu
for file in $(git diff-index --cached --name-only HEAD | grep -E '\.(cpp|cc|h|hpp)$') ; do
clang-format -i "$file"
git add "$file"
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
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