Martin Roth | 0ad5fbd | 2020-12-24 12:06:38 -0700 | [diff] [blame] | 1 | #!/usr/bin/env sh |
Alex Thiessen | d4a3d01 | 2018-01-04 20:31:29 +0000 | [diff] [blame] | 2 | ## |
Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 3 | ## SPDX-License-Identifier: GPL-2.0-only |
Alex Thiessen | d4a3d01 | 2018-01-04 20:31:29 +0000 | [diff] [blame] | 4 | |
Alex Thiessen | 6719862 | 2018-01-05 05:19:10 +0000 | [diff] [blame] | 5 | set -e # -o errexit |
| 6 | set -u # -o nounset |
| 7 | |
Edward O'Callaghan | 4139c15 | 2015-01-03 02:08:33 +1100 | [diff] [blame] | 8 | %MAKE% check-style lint-stable |
Martin Roth | ef86930 | 2017-07-26 10:38:42 -0600 | [diff] [blame] | 9 | |
Patrick Georgi | 9110c17 | 2018-05-30 15:48:16 +0200 | [diff] [blame] | 10 | PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/) |
Alex Thiessen | ceb7788 | 2018-01-03 08:12:39 +0000 | [diff] [blame] | 11 | if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then |
Martin Roth | ef86930 | 2017-07-26 10:38:42 -0600 | [diff] [blame] | 12 | echo |
| 13 | echo "Running checkpatch" |
Martin Roth | 4a6477e | 2018-07-18 09:40:29 -0600 | [diff] [blame] | 14 | printf "%s\n" "$PATCHDIFF" | util/lint/lint-007-checkpatch diff \ |
| 15 | || (echo "Please consider fixing these issues." ;sleep 5) ; true |
Martin Roth | ef86930 | 2017-07-26 10:38:42 -0600 | [diff] [blame] | 16 | fi |