Contributing Guide
October 30, 2019 ยท View on GitHub
License
The source file should contain a license header. See the existing files as the example.
Name style
All name in python and cpp using snake case style, except for op for Tensorflow.
For Golang, using Camel-Case for variable name and interface.
Python style
Changes to Python code should conform the Chromium Python Style Guide.
You can use yapf to check the style.
The style configuration is .style.yapf.
You can using tools/format.sh tool to format code.
C++ style
Changes to C++ code should conform to Google C++ Style Guide.
You can use cpplint to check the style and use clang-format to format the code.
The style configuration is .clang-format.
You can using tools/format.sh tool to format code.
C++ macro
C++ macros should start with DELTA_, except for most common ones like LOG and VLOG.
Golang style
For Golang styple, please see docs below:
Before commit golang code, plase using go fmt and go vec to format and lint code.
Logging guideline
For python using abseil-py, more info.
For C++ using abseil-cpp, more info.
For Golang using glog.
Unit test
For python using tf.test.TestCase, and the entrypoint for python unittest is tools/test/python_test.sh.
For C++ using googletest, and the entrypoint for C++ unittest is tools/test/cpp_test.sh.
For Golang using go test for unittest.