From 14a1b4a7ac57080758b2a1931786ea69d82db780 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 17 May 2022 13:31:33 +0200 Subject: [PATCH] made auto-formatter even more re-usable --- scripts/auto-formatter.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/auto-formatter.sh b/scripts/auto-formatter.sh index 7b67ee9d..33f3fabc 100755 --- a/scripts/auto-formatter.sh +++ b/scripts/auto-formatter.sh @@ -12,11 +12,17 @@ else fi cpp_format="clang-format" +folder_list=( + "./src" + "./hal" + "./tests" +) file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp" if command -v ${cpp_format} &> /dev/null; then - find ./src ${file_selectors} | xargs clang-format --style=file -i - find ./hal ${file_selectors} | xargs clang-format --style=file -i - find ./tests ${file_selectors} | xargs clang-format --style=file -i + echo "Auto-formatting ${dir} recursively" + for dir in ${allThreads[@]}; do + find ${dir} ${file_selectors} | xargs clang-format --style=file -i + done else echo "No ${cpp_format} tool found, not formatting C++/C files" fi