diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2022-04-10 11:21:54 +0200 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-04-23 10:43:32 -0700 |
commit | d6a735fe62537fe67473f5c2847fd16fc7235e52 (patch) | |
tree | 0ef281d04266efd4650d9b318da287602351ccba | |
parent | 01b31d98580beda60d154fad4acc6934d6e6745e (diff) | |
download | serenity-d6a735fe62537fe67473f5c2847fd16fc7235e52.zip |
Meta: Use clang-format from the Clang toolchain if available
-rwxr-xr-x | Meta/lint-clang-format.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Meta/lint-clang-format.sh b/Meta/lint-clang-format.sh index 639a58ff49..5d2899790b 100755 --- a/Meta/lint-clang-format.sh +++ b/Meta/lint-clang-format.sh @@ -26,9 +26,12 @@ else fi if (( ${#files[@]} )); then + TOOLCHAIN_DIR=Toolchain/Local/clang/bin CLANG_FORMAT=false if command -v clang-format-14 >/dev/null 2>&1 ; then CLANG_FORMAT=clang-format-14 + elif command -v $TOOLCHAIN_DIR/clang-format >/dev/null 2>&1 && $TOOLCHAIN_DIR/clang-format --version | grep -qF ' 14.' ; 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) < 14) exit 1; }'; then |