From fb87f80c20c061f0db5f65bfca5abe2bbdd02831 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Wed, 26 Apr 2017 16:31:44 -0700 Subject: [PATCH] scripts/check_format.sh: only check tracked files Change-Id: Ie6370bbcbcf08cb365ac54f53e8794ecdcbdedd9 Signed-off-by: Daniel Verkamp --- .astylerc | 1 - scripts/check_format.sh | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.astylerc b/.astylerc index 2c3b9de44..29e73728b 100644 --- a/.astylerc +++ b/.astylerc @@ -22,5 +22,4 @@ lineend=linux # LF line endings # General options suffix=none -recursive formatted diff --git a/scripts/check_format.sh b/scripts/check_format.sh index e067c620f..a4dd1fdad 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -16,9 +16,8 @@ if hash astyle; then # as-is to enable ongoing work to synch with a generic upstream DPDK vhost library, # rather than making diffs more complicated by a lot of changes to follow SPDK # coding standards. - astyle --options=.astylerc "*.c" --exclude="rte_vhost" >> astyle.log - astyle --options=.astylerc --exclude=test/cpp_headers "*.cpp" >> astyle.log - astyle --options=.astylerc "*.h" --exclude="rte_vhost" >> astyle.log + git ls-files '*.[ch]' '*.cpp' | grep -v rte_vhost | grep -v cpp_headers | \ + xargs astyle --options=.astylerc >> astyle.log if grep -q "^Formatted" astyle.log; then echo " errors detected" git diff