File tree Expand file tree Collapse file tree 3 files changed +54
-5
lines changed
Expand file tree Collapse file tree 3 files changed +54
-5
lines changed Original file line number Diff line number Diff line change 5151## Development Environment
5252It is recommended that development is done in the latest
5353` nightly-custom-op ` docker image.
54- ```
54+
55+ ``` bash
5556docker run --rm -it -v ${PWD} :/addons -w /addons tensorflow/tensorflow:nightly-custom-op /bin/bash
5657```
5758
@@ -62,6 +63,12 @@ Try those commands below:
62632 . Run unit test: ` make unit-test `
63643 . All of the above: ` make `
6465
66+ ## Coding style
67+
68+ Addons provides ` make code-format ` command to format your changes
69+ automatically, don't forget to use it before pushing your codes.
70+
71+ Please see our [ Style Guide] ( SYLE_GUIDE.md ) for more details.
6572
6673## Code Testing
6774#### CI Testing
@@ -71,13 +78,15 @@ hardware will be available from our CI provider.
7178
7279#### Locally Testing
7380
74- ```
81+ ``` bash
7582docker run --rm -it -v ${PWD} :/addons -w /addons tensorflow/tensorflow:nightly-custom-op make unit-test
7683```
7784
7885or run manually:
7986
80- ```
87+ ``` bash
88+ docker run --rm -it -v ${PWD} :/addons -w /addons tensorflow/tensorflow:nightly-custom-op /bin/bash
89+
8190./configure.sh # Links project with TensorFlow dependency
8291
8392bazel test -c opt -k \
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ pip install artifacts/tensorflow_addons-*.whl
7373## Contributing
7474TF-Addons is a community led open source project. As such, the project
7575depends on public contributions, bug-fixes, and documentation. Please
76- see [ CONTRIBUTING.md ] ( CONTRIBUTING.md ) for a guide on how to contribute.
77- This project adheres to [ TensorFlow's code of conduct] ( CODE_OF_CONDUCT.md ) .
76+ see [ contribution guidelines ] ( CONTRIBUTING.md ) for a guide on how to
77+ contribute. This project adheres to [ TensorFlow's code of conduct] ( CODE_OF_CONDUCT.md ) .
7878By participating, you are expected to uphold this code.
7979
8080## Community
Original file line number Diff line number Diff line change 1+ #### C++
2+ C++ code should conform to [ Google C++ Style Guide] ( https://google.github.io/styleguide/cppguide.html ) .
3+
4+ Addons uses [ clang-format] ( https://clang.llvm.org/docs/ClangFormat.html )
5+ to check your C/C++ changes. Sometimes you have some manually formatted
6+ code that you don’t want clang-format to touch.
7+ You can disable formatting like this:
8+
9+ ``` cpp
10+ int formatted_code;
11+ // clang-format off
12+ void unformatted_code ;
13+ // clang-format on
14+ void formatted_code_again;
15+ ```
16+
17+ #### Python
18+ Python code should conform to [ PEP8] ( https://www.python.org/dev/peps/pep-0008/ ) .
19+
20+ Addons uses [ yapf] ( https://github.com/google/yapf ) to format code,
21+ and [ pylint] ( https://www.pylint.org/ ) for code analysis.
22+ You can disable them locally like this:
23+
24+ ``` python
25+ # yapf: disable
26+ FOO = {
27+ # ... some very large, complex data literal.
28+ }
29+
30+ BAR = [
31+ # ... another large data literal.
32+ ]
33+ # yapf: enable
34+ ```
35+
36+ ``` python
37+ # pylint: disable=protected-access
38+ foo._protected_member
39+ # pylint: enable=protected-access
40+ ```
You can’t perform that action at this time.
0 commit comments