zephyr/tests/compliance/checkpatch.sh
Inaky Perez-Gonzalez b618d001b4 tests/compiance/checkpatch: force the format to 'email'
Otherwise, local settings in the account will cause headache and
randomly alter the result of the testcase.

Change-Id: I758966a7fe9335a13ce237aea7d6df2ddc5733ce
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-10 19:30:32 +00:00

24 lines
706 B
Bash
Executable file

#! /bin/bash -e
#
# @testcase static defaults=none
# @eval shcmd %(thisfile)s %(srcdir)s/../../
# @tags bat
#
# If checkpatch.pl is not on your path, you can:
# 1 - put it in your path (copy or symlink)
# 2 - export CPPPATH to the path where it is
#
# (1) is easier
#
set -eu -o pipefail
cd $1 || exit 127
# If no modifications to the tree, check the previous commit;
# otherwise, show the current modifications
if git diff-index HEAD --quiet; then
git show --format=email HEAD || exit 127
else
git diff HEAD || exit 127
fi \
| ${CPPATH:-scripts/}checkpatch.pl \
${CPOPTS:---no-tree --patch --show-types --mailback --terse --showfile --ignore FILE_PATH_CHANGES } \
-