summaryrefslogtreecommitdiff
path: root/Meta/lint-clang-format.sh
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2022-10-22 10:26:40 +0200
committerLinus Groh <mail@linusgroh.de>2022-10-22 12:53:03 +0200
commitf1f6c4c0b6202b0ea8c2b05b04d69077ce3f7f83 (patch)
tree108aa182b76a59751df90b692e55080588f89da3 /Meta/lint-clang-format.sh
parente52f0a991b698db28e8712adc4ccebb2efc42d08 (diff)
downloadserenity-f1f6c4c0b6202b0ea8c2b05b04d69077ce3f7f83.zip
Meta: Detect Homebrew clang-format
Homebrew does not add upstream LLVM's install location to $PATH so as not to conflict with XCode tools, so we need to run `brew --prefix llvm` to figure out its install path.
Diffstat (limited to 'Meta/lint-clang-format.sh')
-rwxr-xr-xMeta/lint-clang-format.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/Meta/lint-clang-format.sh b/Meta/lint-clang-format.sh
index 30ba9d7c3a..9a3b75d9f6 100755
--- a/Meta/lint-clang-format.sh
+++ b/Meta/lint-clang-format.sh
@@ -30,6 +30,8 @@ if (( ${#files[@]} )); then
CLANG_FORMAT=false
if command -v clang-format-14 >/dev/null 2>&1 ; then
CLANG_FORMAT=clang-format-14
+ elif command -v brew >/dev/null 2>&1 && command -v "$(brew --prefix llvm@14)"/bin/clang-format >/dev/null 2>&1 ; then
+ CLANG_FORMAT="$(brew --prefix llvm@14)"/bin/clang-format
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