This file describes rules to contribute to EXANTE repositories
- Every method should have docstring with:
- small description (
does foo); - all available parameters descriptions. If there is default value it should
be mentioned. Parameters types should be mentioned as well
(
:param foo: foo, str. Default is 'bar'); - return values (
:return: value, str); - optional: usage example
- small description (
- To logging your output use logging library info is casual information, debug is verbose information which is not usually required, warning indicates possible non-critical errors, error is critical error. Do not use critical log type.
- All libraries (except for tool which work with external services maybe) should have own tests. Each method should be tested. Refer to http://docs.python-guide.org/en/latest/writing/tests/#py-test .
- Any changes in library should be accompanied by test run before commit.
- Any method should have description comment.
The main code style is described here.
For automagic autopep with options -a -i
is recommended. Some details below:
- Do not use lines more than 80 symbols.
- Avoid to use double quotes.
- Do not use lines more than 80 symbols.
- To concatenate use
formatmethod. More details: https://docs.python.org/3/library/string.html . - You don't want to use lines more than 80 symbols.
- Library variables and methods are with
underline_symbol. NocamelCase. Classes should be named withUpperCase. - Do not use hardcode.
- If you are using item twice or more - create method.
- Create tools which doesn't requires any system variables (for example
$PYTHONPATH). - Use one break line to separate method inside class, and two - outside.
- Almost all methods should return anything.
Noneis not recommended. - Do not use
print,pprint, etc. Uselogginginstead. - No dots and the end of comment otherwise we will find you by IP. And it should start with small letter. Seriously.
- No trailing spaces. It makes me nervous.