Which code style are used in this project?
For code style we use PEP 8
7, but with black
1.
For Naming conventions we attach to PEP8 Naming Conventions.
For functions/methods/classes/modules/etc. documentation (docstrings) we use Numpy Documentation Style Guide.
We type the code, so we're following PEP 484
8 recommendations.
Tools to ensure you're code is compliant with our code style.
In this project we use black
1 to format the code.
Black
is aPEP 8
7 compliant opinionated formatter
To sort imports, we use isort
3, which is a tool that manages the order of imports in a file.
To check if you typed the code, we use mypy
2, which is a checker for PEP 484
8.
For checking that you don't let some imports, variables, etc. unused, some bad programming practices, and a lot of things more, we use flake8
4.
And for checking that the docstrings
are well formatted, we use flake8-pydocstyle
5.
How to run the tools to check if everything is correct
You must run the next command: make lint
.
It automatically runs all the tools, if it returns any errors, please fix it before making the commit.
If you want to apply black
and isort
to whole project (if you don't have this tools configured in your editor), you can run the command: make apply_black_isort
.