From 862fea498bfa66f2e3b08185c010d5d5de13e5cb Mon Sep 17 00:00:00 2001 From: starlord Date: Wed, 9 Oct 2019 17:20:24 +0800 Subject: [PATCH] disable clang-tidy Former-commit-id: c19aa457fd0f609e8e1eddd8ea7a6af771d53180 --- cpp/build.sh | 14 +++++++------- cpp/src/utils/ValidationUtil.cpp | 6 +++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cpp/build.sh b/cpp/build.sh index deda35ab..648206f9 100755 --- a/cpp/build.sh +++ b/cpp/build.sh @@ -112,13 +112,13 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then fi echo "clang-format check passed!" - # clang-tidy check - make check-clang-tidy - if [ $? -ne 0 ]; then - echo "ERROR! clang-tidy check failed" - exit 1 - fi - echo "clang-tidy check passed!" +# # clang-tidy check +# make check-clang-tidy +# if [ $? -ne 0 ]; then +# echo "ERROR! clang-tidy check failed" +# exit 1 +# fi +# echo "clang-tidy check passed!" else # compile and build make -j 4 || exit 1 diff --git a/cpp/src/utils/ValidationUtil.cpp b/cpp/src/utils/ValidationUtil.cpp index 248be510..254f46f2 100644 --- a/cpp/src/utils/ValidationUtil.cpp +++ b/cpp/src/utils/ValidationUtil.cpp @@ -71,7 +71,11 @@ ValidationUtil::ValidateTableName(const std::string& table_name) { Status ValidationUtil::ValidateTableDimension(int64_t dimension) { - if (dimension <= 0 || dimension > TABLE_DIMENSION_LIMIT) { + if (dimension <= 0) { + std::string msg = "Dimension value should be greater than 0"; + SERVER_LOG_ERROR << msg; + return Status(SERVER_INVALID_VECTOR_DIMENSION, msg); + } else if (dimension > TABLE_DIMENSION_LIMIT) { std::string msg = "Table dimension excceed the limitation: " + std::to_string(TABLE_DIMENSION_LIMIT); SERVER_LOG_ERROR << msg; return Status(SERVER_INVALID_VECTOR_DIMENSION, msg); -- GitLab