fix: clang format broken under osx (#38427)

See: #38434

---------

Signed-off-by: Ted Xu <ted.xu@zilliz.com>
pull/38981/head
Ted Xu 2025-01-17 10:43:03 +08:00 committed by GitHub
parent 3c9f26942d
commit 9209a70bb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 11 deletions

View File

@ -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 \

View File

@ -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 \

View File

@ -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"

View File

@ -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