mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
fix: clang format broken under osx (#38427)
See: #38434 --------- Signed-off-by: Ted Xu <ted.xu@zilliz.com>
This commit is contained in:
parent
3c9f26942d
commit
9209a70bb6
@ -9,7 +9,7 @@ fi
|
|||||||
cat ${LICENSE} > /dev/null || exit -1
|
cat ${LICENSE} > /dev/null || exit -1
|
||||||
|
|
||||||
FILES=`find ${FOLDER} \
|
FILES=`find ${FOLDER} \
|
||||||
| grep -E "(*CMakeLists.txt$)" \
|
| grep "CMakeLists.txt$" \
|
||||||
| grep -v thirdparty \
|
| grep -v thirdparty \
|
||||||
| grep -v cmake_build \
|
| grep -v cmake_build \
|
||||||
| grep -v cmake-build \
|
| grep -v cmake-build \
|
||||||
|
|||||||
@ -9,7 +9,7 @@ fi
|
|||||||
cat ${LICENSE} > /dev/null || exit -1
|
cat ${LICENSE} > /dev/null || exit -1
|
||||||
|
|
||||||
FILES=`find ${FOLDER} \
|
FILES=`find ${FOLDER} \
|
||||||
| grep -E "(*\.cpp$|*\.h$|*\.cu$)" \
|
| grep "(\.cpp\|\.h\|\.cu)$" \
|
||||||
| grep -v thirdparty \
|
| grep -v thirdparty \
|
||||||
| grep -v cmake_build \
|
| grep -v cmake_build \
|
||||||
| grep -v cmake-build \
|
| grep -v cmake-build \
|
||||||
|
|||||||
@ -6,8 +6,10 @@ else
|
|||||||
fi
|
fi
|
||||||
CorePath=$1
|
CorePath=$1
|
||||||
|
|
||||||
|
CLANG_FORMAT=clang-format-12
|
||||||
|
|
||||||
formatThis() {
|
formatThis() {
|
||||||
find "$1" | grep -E "(*\.cpp|*\.h|*\.cc)$" | grep -v "gen_tools/templates" | grep -v "\.pb\." | grep -v "tantivy-binding.h" | xargs clang-format-12 -i
|
find "$1" | grep "(\.cpp\|\.h\|\.cc)$" | grep -v "gen_tools/templates" | grep -v "\.pb\." | grep -v "tantivy-binding.h" | xargs $CLANG_FORMAT -i
|
||||||
}
|
}
|
||||||
|
|
||||||
formatThis "${CorePath}/src"
|
formatThis "${CorePath}/src"
|
||||||
|
|||||||
@ -30,14 +30,7 @@ pushd $CPP_SRC_DIR
|
|||||||
./run_clang_format.sh .
|
./run_clang_format.sh .
|
||||||
popd
|
popd
|
||||||
|
|
||||||
if [[ $(uname -s) == "Darwin" ]]; then
|
check_result=$(git status | grep -E "\.h\|\.hpp\|\.cc\|\.cpp")
|
||||||
if ! brew --prefix --installed grep >/dev/null 2>&1; then
|
|
||||||
brew install grep
|
|
||||||
fi
|
|
||||||
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
check_result=$(git status | grep -E "*\.h|*\.hpp|*\.cc|*\.cpp")
|
|
||||||
echo "check_result: $check_result"
|
echo "check_result: $check_result"
|
||||||
if test -z "$check_result"; then
|
if test -z "$check_result"; then
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user