Ruff v0.1.8 introduces two major features: opt-in formatting of Python code snippets inside docstrings and auto-quoting of type annotations. Docstring formatting supports doctest format, CommonMark fenced code blocks, and reStructuredText literal/code blocks. Invalid Python snippets are skipped automatically. Line length for docstring snippets is configurable, defaulting to dynamic mode that respects surrounding code indentation. The auto-quoting feature automatically wraps type annotations in quotes when their imports are moved into TYPE_CHECKING blocks, avoiding runtime evaluation issues without requiring `from __future__ import annotations`.
Table of contents
Formatting code snippets in docstrings #Auto-quoting of type annotations #Contributors #Sort: