Commit d3d2a573 authored by Brenden Blanco's avatar Brenden Blanco

Add clang-format file, tweak style-check.sh

Add an initial .clang-format file, based on LLVM's style base. Inform
the style-check wrapper to only consider h, c, and cc files when it
runs, and print out the --verbose output upon failure.
parent 581fc7d0
---
BasedOnStyle: Google
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
......@@ -14,12 +14,10 @@ if ! hash $CLANG_FORMAT 2> /dev/null; then
exit 1
fi
n=$(git clang-format $GITREF --binary $CLANG_FORMAT --style llvm --diff --quiet | wc -l)
cmd="git clang-format $GITREF --binary $CLANG_FORMAT --diff --extensions h,c,cc"
n=$($cmd --quiet | wc -l)
if [ $n -gt 0 ]; then
echo "git clang-format $GITREF --binary $CLANG_FORMAT --style llvm --diff"
echo
git clang-format $GITREF --binary $CLANG_FORMAT --style llvm --diff
echo
echo "clang-format returned non-empty diff, please fixup the style" 1>&2
$cmd -v
exit 1
fi
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