Install clang-format 3.8 on Mac OS X
Created by: wangkuiyi
While I am writing this issue, Paddle's pre-commit hook configuration requires the specific version of clang-format of 3.8.
This is because different versions of clang-format behave differently.
The problem is: on Mac OS X, Homebrew would install clang-format version 4.0, which causes the failure of git commit
.
I found a hacky solution to install clang-format 3.8 using Homebrew:
- Make sure you have Homebrew installed.
mkdir -p /usr/local/Homebrew/Library/Taps/yiwang/homebrew-yiwang
- Download this gist to be
/usr/local/Homebrew/Library/Taps/yiwang/homebrew-yiwang/clang-format@38.rb
. - Run
brew install clang-format@38
. sudo cp /usr/local/Cellar/clang-format@38/3.8.0/bin/clang-format /usr/local/bin/clang-format