Most of the formatting and linting tools listed below (except for mypy, the Python static type checker) have been registered as pre-commit hooks. The hooks can be installed using the command:
pre-commit installAfter the installation, those hooks are automatically triggered every time a commit is made, and are applied on files that are changed in the commit. Use the following command if you want to run hooks on all files (regardless whether the files are changed or not).
# Run pre-commit hooks over all the files.
pre-commit run --all-filesPlease follow the following coding style guide:
We recommend to integrate frequently used checkers (which were installed with the pre-commit hooks, as discussed above) into your editors and IDEs, so that they are automatically run on save (and you can stop worrying about running them manually yourself). We provide some examples of how they can be set up:
| IDE | black | ruff | mypy |
|---|---|---|---|
| VSCode | ms-python.black-formatter | charliermarsh.ruff | ms-python.mypy-type-checker |