From 230e15f49956cd5aede56cf8152f4e8f1b5d4579 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 25 Sep 2023 16:07:56 +0300 Subject: [PATCH] updated format.sh --- scripts/format.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/format.sh b/scripts/format.sh index 2ae292ff..8eb01fb9 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -2,15 +2,17 @@ cd "$(dirname "$0")"/.. pwd +find_sources="find include src tests example bench -not ( -path include/spdlog/fmt/bundled -prune ) -type f -name *\.h -o -name *\.cpp" echo -n "Running dos2unix " -find . -name "*\.h" -o -name "*\.cpp"|grep -v bundled|xargs -I {} sh -c "dos2unix '{}' 2>/dev/null; echo -n '.'" +$find_sources | xargs -I {} sh -c "dos2unix '{}' 2>/dev/null; echo -n '.'" echo echo -n "Running clang-format " -find include -name "*\.h" |grep -v bundled|xargs -I {} sh -c "clang-format -i {}; echo -n '.'" -find src -name "*\.cpp"|xargs -I {} sh -c "clang-format -i {}; echo -n '.'" + +$find_sources | xargs -I {} sh -c "clang-format -i {}; echo -n '.'" + echo echo -n "Running cmake-format " -find . -name "CMakeLists.txt" -o -name "*\.cmake"|grep -v bundled|grep -v build|xargs -I {} sh -c "cmake-format --line-width 120 --tab-size 4 --max-subgroups-hwrap 4 -i {}; echo -n '.'" +find . -type f -name "CMakeLists.txt" -o -name "*\.cmake"|grep -v bundled|grep -v build|xargs -I {} sh -c "cmake-format --line-width 120 --tab-size 4 --max-subgroups-hwrap 4 -i {}; echo -n '.'" echo