| 1 |
Style and Conventions |
| 2 |
|
| 3 |
- Typing |
| 4 |
- mypy strict is enabled; add precise type hints for public functions/classes. |
| 5 |
- Prefer explicit/clear types; avoid `Any` and unsafe casts. |
| 6 |
- Linting/Imports |
| 7 |
- Ruff is the canonical linter (config in pyproject). Respect its rules and isort settings (single-line imports, ordered, types grouped). |
| 8 |
- Flake8 config exists in tox.ini but ruff linting is primary. |
| 9 |
- Formatting |
| 10 |
- Follow ruff guidance; keep lines <= 88 where applicable (flake8 reference). |
| 11 |
- Testing |
| 12 |
- Pytest with `testing/` as testpath; default 5m timeout; warnings treated as errors. |
| 13 |
- Use existing fixtures; add `@pytest.mark` markers if needed (see pyproject markers). |
| 14 |
- Logging |
| 15 |
- Tests run with log level info/debug; avoid noisy logs in normal library code. |
| 16 |
- General |
| 17 |
- Small, focused functions; early returns; explicit errors. Keep APIs documented with concise docstrings. |