diff --git a/docs/contribute_code_cn.md b/docs/contribute_code_cn.md index 54112d42bb35ed9d1f4ea0c9b3c584944573ac40..a64da4ba58726225c31f13524a7988507b79537d 100644 --- a/docs/contribute_code_cn.md +++ b/docs/contribute_code_cn.md @@ -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` 完成。 ``` diff --git a/docs/contribute_code_en.md b/docs/contribute_code_en.md index 4cf32d88aaa5fd2f684daffd26332690084bcd71..1226a41b6df3513b86a35e742f404e617c238d08 100644 --- a/docs/contribute_code_en.md +++ b/docs/contribute_code_en.md @@ -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`: ```