Code Style¶
Python¶
Formatter & Linter: Ruff¶
Ruff handles both formatting and linting:
[tool.ruff]
target-version = "py312"
line-length = 120
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "UP", "S", "B", ...]
Type Checking: mypy¶
Commands¶
Conventions¶
Python¶
- Imports: Sorted by
isort(via Ruff). First-party:docflow - Docstrings: Google style
- Naming:
snake_casefor functions/variables,PascalCasefor classes - Type hints: Required on all public functions (mypy strict)
- Async: Use
async deffor all I/O-bound operations
Commits¶
Follow Conventional Commits — see Contributing.
Pre-Commit Checks¶
Run before every commit: