From 49a4dda7d23fa54dc8e2f819377f55d00020f537 Mon Sep 17 00:00:00 2001 From: smlng <s@mlng.net> Date: Tue, 19 Sep 2017 10:57:06 +0200 Subject: [PATCH] tools: ignore vendor files on whitespace check --- dist/tools/whitespacecheck/check.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/tools/whitespacecheck/check.sh b/dist/tools/whitespacecheck/check.sh index 53b15a2456..ed803e0e14 100755 --- a/dist/tools/whitespacecheck/check.sh +++ b/dist/tools/whitespacecheck/check.sh @@ -6,6 +6,8 @@ # General Public License v2.1. See the file LICENSE in the top level # directory for more details. +NOVENDOR=":!*/include/vendor/*" + # If no branch but an option is given, unset BRANCH. # Otherwise, consume this parameter. BRANCH="${1}" @@ -28,14 +30,14 @@ if [ -z "${BRANCH}" ]; then fi git -c core.whitespace="tab-in-indent,tabwidth=4" \ - diff --check $(git merge-base ${BRANCH} HEAD) -- *.[ch] + diff --check $(git merge-base ${BRANCH} HEAD) -- *.[ch] ${NOVENDOR} 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) + diff --check $(git merge-base ${BRANCH} HEAD) -- . ${NOVENDOR} if [ $? -ne 0 ] || [ $RESULT -ne 0 ] then echo "ERROR: This change introduces new whitespace errors" -- GitLab