Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💚 (analysis): Fix clang-tidy version selection #1089

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tools/run-clang-tidy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,21 @@ def log_debug(message)
log_debug "Find clang-tidy"
$CLANG_TIDY_EXEC = ""

if system("which clang-tidy > /dev/null")
$CLANG_TIDY_EXEC = "clang-tidy"
if system("which clang-tidy-15 > /dev/null")
$CLANG_TIDY_EXEC = "clang-tidy-15"
elsif system("which clang-tidy-14 > /dev/null")
$CLANG_TIDY_EXEC = "clang-tidy-14"
elsif system("which clang-tidy-13 > /dev/null")
$CLANG_TIDY_EXEC = "clang-tidy-13"
elsif system("which /opt/homebrew/opt/llvm/bin/clang-tidy > /dev/null")
$CLANG_TIDY_EXEC = "/opt/homebrew/opt/llvm/bin/clang-tidy"
elsif system("which /usr/local/opt/llvm/bin/clang-tidy > /dev/null")
$CLANG_TIDY_EXEC = "/usr/local/opt/llvm/bin/clang-tidy"
else
abort("No suitable version of clang-tidy found...")
end

puts "Clang-tidy found at: #{$CLANG_TIDY_EXEC}"
puts `#{$CLANG_TIDY_EXEC} --version`
puts

puts "Standard headers search dirs:"
puts $tmp_search_dirs.map { |d| " #{d}" }.join("\n")
Expand Down