blob: 8b571a72df7bd2218753898ff903d46f9aed0666 [file] [log] [blame]
Martin Roth0ad5fbd2020-12-24 12:06:38 -07001#!/usr/bin/env sh
Alex Thiessend4a3d012018-01-04 20:31:29 +00002##
Patrick Georgi7333a112020-05-08 20:48:04 +02003## SPDX-License-Identifier: GPL-2.0-only
Alex Thiessend4a3d012018-01-04 20:31:29 +00004
Alex Thiessen67198622018-01-05 05:19:10 +00005set -e # -o errexit
6set -u # -o nounset
7
Edward O'Callaghan4139c152015-01-03 02:08:33 +11008%MAKE% check-style lint-stable
Martin Rothef869302017-07-26 10:38:42 -06009
Patrick Georgi9110c172018-05-30 15:48:16 +020010PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/)
Alex Thiessenceb77882018-01-03 08:12:39 +000011if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then
Martin Rothef869302017-07-26 10:38:42 -060012 echo
13 echo "Running checkpatch"
Martin Roth4a6477e2018-07-18 09:40:29 -060014 printf "%s\n" "$PATCHDIFF" | util/lint/lint-007-checkpatch diff \
15 || (echo "Please consider fixing these issues." ;sleep 5) ; true
Martin Rothef869302017-07-26 10:38:42 -060016fi