Style guide
-
All public APIs must be fully documented.
-
We use Google docstring format. These will at some point be extracted into searchable API docs, so it's important to get this right. A linter will check for you that they are correctly formatted.
-
Aim for 100% test coverage on public APIs.
-
Use type hints.
-
Format your code.
-
Run
make formatting
to do this explicitly. -
If you run
make bootstrap
to setup the project (as the devcontainer does automatically), you should get pre-commit hooks installed that do this for you. -
Check that all checks pass before requesting a PR review.
- You can do this using
make lint
- Individual checks are documented at:
- https://pypi.org/project/darglint/
- https://pypi.org/project/isort/
- https://mypy-lang.org/
- https://pypi.org/project/safety/
- https://pypi.org/project/bandit/
- Rules are configured in pyproject.yaml