Code Style

Formatting

django-docutils uses ruff for both linting and formatting.

$ uv run ruff format .
$ uv run ruff check . --fix --show-fixes

Type Checking

Strict mypy with django-stubs is enforced across src/ and tests/.

$ uv run mypy

Docstrings

Follow NumPy-style docstrings for all public functions and methods.

Imports

  • Always include from __future__ import annotations at the top of Python files.

  • Use import typing as t and access via namespace: t.Optional, t.Dict, etc.