We adopt PEP8 as the preferred code style.
We use pre-commit to check and format code automatically on every commit. The hook suite is defined in .pre-commit-config.yaml and includes:
- black (line length 79): formatter
- flake8: linter
- pylint: linter
- mypy: type checker
- pre-commit-hooks: trailing whitespace, encoding pragma, YAML/JSON/TOML checks, private key detection, etc.
Flake8 configuration lives in setup.cfg.
Install the development/test dependencies, then install the git hooks:
pip install pre-commit
pip install -r requirements-test.txt
pre-commit installAfter this, every git commit runs the checks automatically; commits that
fail the hooks are rejected (auto-fixing hooks such as black will rewrite
files — review and re-stage, then commit again).
To check the whole repository manually:
pre-commit run --all-files.github/workflows/pre-commit.yml runs pre-commit run --all-files on
every push and pull request, so code that bypasses the local hooks is still
blocked in CI.