fsfw/scripts/apply-clang-format.sh
2022-05-13 11:35:59 +02:00

15 lines
479 B
Bash
Executable File

#!/bin/bash
if [[ ! -f README.md ]]; then
cd ..
fi
cmake_fmt="python3 -m cmake-format"
if command -v ${cmake_fmt} &> /dev/null; then
cmake_fmt_cmd="${cmake_fmt} -i CMakeLists.txt"
eval ${cmake_fmt_cmd}
fi
find ./src -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./hal -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./tests -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i