Documentation: Encourage documentation with code changes
[coreboot.git] / util / gitconfig / pre-commit
blob7b7ab4846cf0c0da2f5f718b9dcb6081d45782a4
1 #!/bin/sh
2 ##
3 ## SPDX-License-Identifier: GPL-2.0-only
5 set -e # -o errexit
6 set -u # -o nounset
8 %MAKE% check-style lint-stable
10 PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/)
11 if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then
12 echo
13 echo "Running checkpatch"
14 printf "%s\n" "$PATCHDIFF" | util/lint/lint-007-checkpatch diff \
15 || (echo "Please consider fixing these issues." ;sleep 5) ; true