1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

Meta: Do not warn user about too modern clang-format

To prevent warnings for users of varying distributions, do not warn the
user if the clang-version is higher than the expected version.
This commit is contained in:
Riyyi 2021-06-15 15:36:43 +00:00 committed by Gunnar Beutner
parent 4566387ba5
commit 5d1676b05a

View file

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