1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 14:33:52 +01:00

Merge pull request #2468 from OlegHahm/make_travis_whining_about_trailing_whitespaces_are_a_nono

Make travis whining about trailing whitespaces are a nono
This commit is contained in:
Oleg Hahm 2015-02-19 17:25:16 +01:00
commit 41575f341c
2 changed files with 39 additions and 0 deletions

View File

@ -44,6 +44,8 @@ script:
- make -s -C ./examples/default info-concurrency
- git rebase riot/master || git rebase --abort
- ./dist/tools/whitespacecheck/check.sh master || exit
- ./dist/tools/licenses/check.sh master --diff-filter=MR --error-exitcode=0 || exit
- ./dist/tools/licenses/check.sh master --diff-filter=AC || exit

37
dist/tools/whitespacecheck/check.sh vendored Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
# Copyright 2015 Oliver Hahm <oliver.hahm@inria.fr>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
# If no branch but an option is given, unset BRANCH.
# Otherwise, consume this parameter.
BRANCH="${1}"
if echo "${BRANCH}" | grep -q '^-'; then
if [ $(git rev-parse --abbrev-ref HEAD) != "master" ]; then
BRANCH="master"
else
BRANCH=""
fi
else
if [ -n "${BRANCH}" ]; then
shift 1
fi
fi
# select files to check
if [ -z "${BRANCH}" ]; then
BRANCH=$(git rev-list HEAD | tail -n 1)
fi
git diff --check $(git merge-base ${BRANCH} HEAD) > /dev/null
if [ $? -gt 0 ]
then
echo "ERROR: This change introduces new whitespace errors"
exit 1
else
exit 0
fi