Browse Source

dist: add tab test

dev/timer
Martine Lenders 8 years ago
parent
commit
2ec5f27a57
  1. 12
      dist/tools/whitespacecheck/check.sh

12
dist/tools/whitespacecheck/check.sh vendored

@ -27,8 +27,16 @@ if [ -z "${BRANCH}" ]; then
BRANCH=$(git rev-list HEAD | tail -n 1)
fi
git diff --check $(git merge-base ${BRANCH} HEAD)
if [ $? -gt 0 ]
git -c core.whitespace="tab-in-indent,tabwidth=4" \
diff --check $(git merge-base ${BRANCH} HEAD) -- *.[ch]
RESULT=$?
# Git regards any trailing white space except `\n` as an error so `\r` is
# checked here, too
git -c core.whitespace="trailing-space" \
diff --check $(git merge-base ${BRANCH} HEAD)
if [ $? -ne 0 ] || [ $RESULT -ne 0 ]
then
echo "ERROR: This change introduces new whitespace errors"
exit 1

Loading…
Cancel
Save