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

Update clang installation #362

Merged
merged 6 commits into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions docs/contribute_code_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` 完成。

```
Expand Down
12 changes: 12 additions & 0 deletions docs/contribute_code_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

```
Expand Down