made auto-formatter even more re-usable
This commit is contained in:
parent
e49de9422a
commit
14a1b4a7ac
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user