Skip to content

Style guide

  1. All public APIs must be fully documented.

  2. 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.

  3. Aim for 100% test coverage on public APIs.

  4. Use type hints.

  5. Format your code.

  6. Run make formatting to do this explicitly.

  7. 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.

  8. Check that all checks pass before requesting a PR review.

  9. You can do this using make lint
  10. 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/
  11. Rules are configured in pyproject.yaml