Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.17 KB

STYLE_GUIDE.md

File metadata and controls

45 lines (35 loc) · 1.17 KB

C++

C++ code should conform to Google C++ Style Guide.

Addons uses clang-format to check your C/C++ changes. Sometimes you have some manually formatted code that you don’t want clang-format to touch. You can disable formatting like this:

int formatted_code;
// clang-format off
    void    unformatted_code  ;
// clang-format on
void formatted_code_again;

Python

Python code should conform to PEP8.

Addons uses yapf to format code, and pylint for code analysis. You can disable them locally like this:

# yapf: disable
FOO = {
    # ... some very large, complex data literal.
}

BAR = [
    # ... another large data literal.
]
# yapf: enable
# pylint: disable=protected-access
foo._protected_member
# pylint: enable=protected-access

TensorFlow Conventions

Follow the guidance in the TensorFlow Style Guide - Conventions.