made auto-formatter even more usable
This commit is contained in:
parent
14a1b4a7ac
commit
e8023886f6
@ -3,6 +3,12 @@ if [[ ! -f README.md ]]; then
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
folder_list=(
|
||||||
|
"./src"
|
||||||
|
"./hal"
|
||||||
|
"./tests"
|
||||||
|
)
|
||||||
|
|
||||||
cmake_fmt="cmake-format"
|
cmake_fmt="cmake-format"
|
||||||
if command -v ${cmake_fmt} &> /dev/null; then
|
if command -v ${cmake_fmt} &> /dev/null; then
|
||||||
cmake_fmt_cmd="${cmake_fmt} -i CMakeLists.txt"
|
cmake_fmt_cmd="${cmake_fmt} -i CMakeLists.txt"
|
||||||
@ -12,15 +18,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cpp_format="clang-format"
|
cpp_format="clang-format"
|
||||||
folder_list=(
|
|
||||||
"./src"
|
|
||||||
"./hal"
|
|
||||||
"./tests"
|
|
||||||
)
|
|
||||||
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
|
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
|
||||||
if command -v ${cpp_format} &> /dev/null; then
|
if command -v ${cpp_format} &> /dev/null; then
|
||||||
|
for dir in ${folder_list[@]}; do
|
||||||
echo "Auto-formatting ${dir} recursively"
|
echo "Auto-formatting ${dir} recursively"
|
||||||
for dir in ${allThreads[@]}; do
|
|
||||||
find ${dir} ${file_selectors} | xargs clang-format --style=file -i
|
find ${dir} ${file_selectors} | xargs clang-format --style=file -i
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user