Code Style¶

Formatting¶

libtmux uses ruff for both linting and formatting.

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

Type Checking¶

Strict mypy is enforced across src/ and tests/.

$ uv run mypy

Docstrings¶

All public functions and methods use NumPy-style docstrings. See the NumPy docstring guide.

Imports¶

  • Standard library: namespace imports (import pathlib, not from pathlib import Path)

    • Exception: from dataclasses import dataclass, field

  • Typing: import typing as t, access via t.Optional, t.NamedTuple, etc.

  • All files: from __future__ import annotations