mirror of https://github.com/milvus-io/milvus.git
fix: clang format broken under osx (#38427)
See: #38434 --------- Signed-off-by: Ted Xu <ted.xu@zilliz.com>pull/38981/head
parent
3c9f26942d
commit
9209a70bb6
|
@ -9,7 +9,7 @@ fi
|
|||
cat ${LICENSE} > /dev/null || exit -1
|
||||
|
||||
FILES=`find ${FOLDER} \
|
||||
| grep -E "(*CMakeLists.txt$)" \
|
||||
| grep "CMakeLists.txt$" \
|
||||
| grep -v thirdparty \
|
||||
| grep -v cmake_build \
|
||||
| grep -v cmake-build \
|
||||
|
|
|
@ -9,7 +9,7 @@ fi
|
|||
cat ${LICENSE} > /dev/null || exit -1
|
||||
|
||||
FILES=`find ${FOLDER} \
|
||||
| grep -E "(*\.cpp$|*\.h$|*\.cu$)" \
|
||||
| grep "(\.cpp\|\.h\|\.cu)$" \
|
||||
| grep -v thirdparty \
|
||||
| grep -v cmake_build \
|
||||
| grep -v cmake-build \
|
||||
|
|
|
@ -6,8 +6,10 @@ else
|
|||
fi
|
||||
CorePath=$1
|
||||
|
||||
CLANG_FORMAT=clang-format-12
|
||||
|
||||
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"
|
||||
|
|
|
@ -30,14 +30,7 @@ pushd $CPP_SRC_DIR
|
|||
./run_clang_format.sh .
|
||||
popd
|
||||
|
||||
if [[ $(uname -s) == "Darwin" ]]; then
|
||||
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")
|
||||
check_result=$(git status | grep -E "\.h\|\.hpp\|\.cc\|\.cpp")
|
||||
echo "check_result: $check_result"
|
||||
if test -z "$check_result"; then
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue