From 994c7299b979e62cdcc7eff985423a093e1603d2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 May 2022 11:34:44 +0200 Subject: [PATCH] add cmake-format command to shell script --- scripts/apply-clang-format.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/apply-clang-format.sh b/scripts/apply-clang-format.sh index 27202324..d3aa1d1a 100755 --- a/scripts/apply-clang-format.sh +++ b/scripts/apply-clang-format.sh @@ -3,6 +3,12 @@ if [[ ! -f README.md ]]; then cd .. fi +cmake_fmt="python3 -m cmake-format" +if command -v ${cmake_fmt} &> /dev/null + cmake_fmt_cmd=${cmake_fmt} -i CMakeLists.txt + eval ${cmake_fmt_cmd} +then + 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