未验证 提交 3ee62077 编写于 作者: D daminglu 提交者: GitHub

Update clang installation (#362)

上级 6955dc24
......@@ -58,6 +58,18 @@ VisualDL 目前使用[Git流分支模型](http://nvie.com/posts/a-successful-git
VisualDL 使用 `clang-format` 来调整 C/C++ 源代码格式,请确保 [clang-format 3.8](http://releases.llvm.org/download.html) 版本在 3.8 以上。
请下载且安装在 path上. 例如 `/usr/local/bin`
```bash
# For example, install clang-format on Mac
tar xvfJ clang+llvm-3.8.0-x86_64-apple-darwin.tar.xz -C ./clang_mac_install/
cd clang_mac_install/clang+llvm-3.8.0-x86_64-apple-darwin/bin/
ln -s $(pwd)/$(find clang-format | grep bin/clang-format$) /usr/local/bin/clang-format
# or directly mv clang-format binary to there
# mv clang-format /usr/local/bin/
```
Git 每次提交代码,都需要写提交说明,这可以让其他人知道这次提交做了哪些改变,这可以通过`git commit` 完成。
```
......
......@@ -59,6 +59,18 @@ VisualDL uses this [Git branching model](http://nvie.com/posts/a-successful-git-
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.
Please make sure clang-format version 3.8 is available in your path. For example, under ```/usr/local/bin```
```bash
# For example, install clang-format on Mac
tar xvfJ clang+llvm-3.8.0-x86_64-apple-darwin.tar.xz -C ./clang_mac_install/
cd clang_mac_install/clang+llvm-3.8.0-x86_64-apple-darwin/bin/
ln -s $(pwd)/$(find clang-format | grep bin/clang-format$) /usr/local/bin/clang-format
# or directly mv clang-format binary to there
# mv clang-format /usr/local/bin/
```
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`:
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册