Skip to content

Commit 3ee6207

Browse files
authored
Update clang installation (#362)
1 parent 6955dc2 commit 3ee6207

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/contribute_code_cn.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ VisualDL 目前使用[Git流分支模型](http://nvie.com/posts/a-successful-git
5858
VisualDL 使用 `clang-format` 来调整 C/C++ 源代码格式,请确保 [clang-format 3.8](http://releases.llvm.org/download.html) 版本在 3.8 以上。
5959
请下载且安装在 path上. 例如 `/usr/local/bin`
6060

61+
```bash
62+
# For example, install clang-format on Mac
63+
64+
tar xvfJ clang+llvm-3.8.0-x86_64-apple-darwin.tar.xz -C ./clang_mac_install/
65+
cd clang_mac_install/clang+llvm-3.8.0-x86_64-apple-darwin/bin/
66+
ln -s $(pwd)/$(find clang-format | grep bin/clang-format$) /usr/local/bin/clang-format
67+
68+
# or directly mv clang-format binary to there
69+
# mv clang-format /usr/local/bin/
70+
71+
```
72+
6173
Git 每次提交代码,都需要写提交说明,这可以让其他人知道这次提交做了哪些改变,这可以通过`git commit` 完成。
6274

6375
```

docs/contribute_code_en.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ VisualDL uses this [Git branching model](http://nvie.com/posts/a-successful-git-
5959
Our pre-commit configuration requires [clang-format 3.8](http://releases.llvm.org/download.html) for auto-formating C/C++ code, yapf for auto-formating Python and flake8 for style checking Python.
6060
Please make sure clang-format version 3.8 is available in your path. For example, under ```/usr/local/bin```
6161

62+
```bash
63+
# For example, install clang-format on Mac
64+
65+
tar xvfJ clang+llvm-3.8.0-x86_64-apple-darwin.tar.xz -C ./clang_mac_install/
66+
cd clang_mac_install/clang+llvm-3.8.0-x86_64-apple-darwin/bin/
67+
ln -s $(pwd)/$(find clang-format | grep bin/clang-format$) /usr/local/bin/clang-format
68+
69+
# or directly mv clang-format binary to there
70+
# mv clang-format /usr/local/bin/
71+
72+
```
73+
6274
Once installed, `pre-commit` checks the style of code and documentation in every commit. We will see something like the following when you run `git commit`:
6375

6476
```

0 commit comments

Comments
 (0)