Commit 12fbe739 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

githooks: set CHECK_FORMAT_ONLY_DIFF when running check_format.sh



This flag causes check_format.sh to only run checks against modified
files, so it's ideal for a pre-commit hook.  It significantly reduces
the execution time.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I216bfebdc2fd93a06f9378f39de28c12d0db7acb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20491


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent e57869c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ exec 1>&2
# If there are formatting errors, print the offending file names and fail.
if [ -x "./scripts/check_format.sh" ]; then
	echo "Running check_format.sh ..."
	"./scripts/check_format.sh" > check_format.log 2>&1
	CHECK_FORMAT_ONLY_DIFF=1 "./scripts/check_format.sh" > check_format.log 2>&1
	rc=$?
	if [ $rc -ne 0 ]; then
		cat check_format.log