dist: add tab test
This commit is contained in:
parent
dbd4475bfe
commit
2ec5f27a57
12
dist/tools/whitespacecheck/check.sh
vendored
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…
x
Reference in New Issue
Block a user