This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 9568de303a [Chore](build) update clang-format version check (#19542)
9568de303a is described below

commit 9568de303a9f2be4c37a5d2aeb1c2e08c83bf3e5
Author: yongkang.zhong <[email protected]>
AuthorDate: Thu May 11 19:38:58 2023 +0800

    [Chore](build) update clang-format version check (#19542)
    
    update clang-format version check
---
 build-support/check-format.sh | 12 +++++++++---
 build-support/clang-format.sh | 12 +++++++++---
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/build-support/check-format.sh b/build-support/check-format.sh
index 97f620cac7..0e13f0d784 100755
--- a/build-support/check-format.sh
+++ b/build-support/check-format.sh
@@ -31,11 +31,17 @@ DORIS_HOME=$(
 )
 export DORIS_HOME
 
-if [[ -z $(command -v clang-format-16) ]]; then
-    echo "clang-format-16 not founded, please install clang-format-16 or 
upgrade your clang-format version to 16"
+if [[ -z $(command -v clang-format) ]]; then
+    echo "clang-format not found, please install clang-format"
     exit 1
 fi
 
-CLANG_FORMAT="${CLANG_FORMAT_BINARY:=$(command -v clang-format-16)}"
+CLANG_FORMAT_VERSION=$(clang-format --version | perl -nle 'print $& if 
m{version \K[0-9]+}')
+if [[ ${CLANG_FORMAT_VERSION} -ne 16 ]]; then
+    echo "clang-format version is not 16, please install clang-format version 
16 or upgrade your clang-format version to 16"
+    exit 1
+fi
+
+CLANG_FORMAT="${CLANG_FORMAT_BINARY:=$(command -v clang-format)}"
 
 python "${DORIS_HOME}/build-support/run_clang_format.py" 
"--clang-format-executable" "${CLANG_FORMAT}" "-r" "--style" "file" "--inplace" 
"false" "--extensions" "c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx" "--exclude" 
"none" "be/src be/test"
diff --git a/build-support/clang-format.sh b/build-support/clang-format.sh
index 34de3a32d0..4b27429224 100755
--- a/build-support/clang-format.sh
+++ b/build-support/clang-format.sh
@@ -31,11 +31,17 @@ DORIS_HOME=$(
 )
 export DORIS_HOME
 
-if [[ -z $(command -v clang-format-16) ]]; then
-    echo "clang-format-16 not founded, please install clang-format-16 or 
upgrade your clang-format version to 16"
+if [[ -z $(command -v clang-format) ]]; then
+    echo "clang-format not found, please install clang-format"
     exit 1
 fi
 
-CLANG_FORMAT="${CLANG_FORMAT_BINARY:=$(command -v clang-format-16)}"
+CLANG_FORMAT_VERSION=$(clang-format --version | perl -nle 'print $& if 
m{version \K[0-9]+}')
+if [[ ${CLANG_FORMAT_VERSION} -ne 16 ]]; then
+    echo "clang-format version is not 16, please install clang-format version 
16 or upgrade your clang-format version to 16"
+    exit 1
+fi
+
+CLANG_FORMAT="${CLANG_FORMAT_BINARY:=$(command -v clang-format)}"
 
 python "${DORIS_HOME}/build-support/run_clang_format.py" 
"--clang-format-executable" "${CLANG_FORMAT}" "-r" "--style" "file" "--inplace" 
"true" "--extensions" "c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx" "--exclude" 
"none" "be/src be/test"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to