2012-02-25 19:52:45 +01:00
|
|
|
#!/bin/sh
|
2018-01-04 21:31:29 +01:00
|
|
|
## This file is part of the coreboot project.
|
|
|
|
##
|
|
|
|
## This program is free software; you can redistribute it and/or modify
|
|
|
|
## it under the terms of the GNU General Public License as published by
|
|
|
|
## the Free Software Foundation; version 2 of the License.
|
|
|
|
##
|
|
|
|
## This program is distributed in the hope that it will be useful,
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
## GNU General Public License for more details.
|
|
|
|
##
|
|
|
|
|
2018-01-05 06:19:10 +01:00
|
|
|
set -e # -o errexit
|
|
|
|
set -u # -o nounset
|
|
|
|
|
2015-01-02 16:08:33 +01:00
|
|
|
%MAKE% check-style lint-stable
|
2017-07-26 18:38:42 +02:00
|
|
|
|
2018-05-30 15:48:16 +02:00
|
|
|
PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/)
|
2018-01-03 09:12:39 +01:00
|
|
|
if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then
|
2017-07-26 18:38:42 +02:00
|
|
|
echo
|
|
|
|
echo "Running checkpatch"
|
2018-07-18 17:40:29 +02:00
|
|
|
printf "%s\n" "$PATCHDIFF" | util/lint/lint-007-checkpatch diff \
|
|
|
|
|| (echo "Please consider fixing these issues." ;sleep 5) ; true
|
2017-07-26 18:38:42 +02:00
|
|
|
fi
|