diff --git a/Meta/lint-clang-format.sh b/Meta/lint-clang-format.sh index 68304ec7aa8..bca36c2cec8 100755 --- a/Meta/lint-clang-format.sh +++ b/Meta/lint-clang-format.sh @@ -39,13 +39,13 @@ if (( ${#files[@]} )); then CLANG_FORMAT=$TOOLCHAIN_DIR/clang-format elif command -v clang-format >/dev/null 2>&1 ; then CLANG_FORMAT=clang-format - if ! "${CLANG_FORMAT}" --version | awk '{ if (substr($NF, 1, index($NF, ".") - 1) < 18) exit 1; }'; then - echo "You are using '$("${CLANG_FORMAT}" --version)', which appears to not be clang-format 18 or later." + if ! "${CLANG_FORMAT}" --version | awk '{ if (substr($NF, 1, index($NF, ".") - 1) != 18) exit 1; }'; then + echo "You are using '$("${CLANG_FORMAT}" --version)', which appears to not be clang-format 18." echo "It is very likely that the resulting changes are not what you wanted." fi else echo "clang-format-18 is not available, but C or C++ files need linting! Either skip this script, or install clang-format-18." - echo "(If you install a package 'clang-format', please make sure it's version 18 or later.)" + echo "(If you install a package 'clang-format', please make sure it's version 18.)" exit 1 fi