Skip to content

pydocformatter

pydocformatter is a Ruff-style Python linter and formatter for docstrings and comments.

Install it as a standalone tool:

uv tool install pydocformatter

Check a project:

pydocfmt check

Apply fixes:

pydocfmt check --fix

Start here

What it covers

pydocformatter formats Python docstrings and comments while leaving ordinary Python expression formatting to tools such as Ruff. It understands docstring conventions, file selection, rule selection, suppressions, line endings, indentation, protected code examples, and structured comment regions.

Rule families

Project resources