From 08e88b1b4c894e8b0de68065a236f363dae59ad8 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Thu, 6 Oct 2022 19:13:13 -0700 Subject: [PATCH] [script] debugging check format script --- dev/check-format.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/check-format.sh b/dev/check-format.sh index e8d970926..890e11833 100755 --- a/dev/check-format.sh +++ b/dev/check-format.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash clean=$(git status -s -uno | wc -l) #Short ignore untracked +file_pattern="*.cpp *.c *.hpp *.h *.py *.xml" if [ $clean -ne 0 ]; then echo "Current working tree was not clean! This tool only works on clean checkouts" @@ -10,7 +11,7 @@ else echo "=====================" make format"$1" > /dev/null 2>&1 - valid_format=$(git diff | wc -l) + valid_format=$(git diff ${file_pattern}| wc -l) if [ $valid_format -ne 0 ]; then echo "FAILED" @@ -19,7 +20,7 @@ else echo "-------------------------------------------------------------------" echo "" - git diff + git diff ${file_pattern} echo "" echo "Run 'make format$1' to apply these changes"