TDengine/tools/scripts/codeFormat.sh

27 lines
455 B
Bash
Raw Normal View History

2022-10-13 03:09:43 +00:00
#!/bin/bash
PRJ_ROOT_DIR=$(readlink -f -- "$(dirname $0)/../..")
FORMAT_BIN=clang-format-14
ORIGIN_DIR=$(pwd)
cd ${PRJ_ROOT_DIR}
FORMAT_DIR_LIST=(
"include"
2022-10-13 03:49:46 +00:00
"source/os"
"source/util"
2022-10-13 03:56:16 +00:00
"source/common"
# "source/libs"
# "source/client"
"source/dnode"
2022-10-13 03:09:43 +00:00
)
for d in ${FORMAT_DIR_LIST[@]}; do
for f in $(find ${PRJ_ROOT_DIR}/$d/ -regex '.*\.\(cpp\|hpp\|c\|h\)'); do
${FORMAT_BIN} -i $f
done
done
cd ${ORIGIN_DIR}