Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ codebase with _Black_.

Yes, there is support for PyPy 3.8 and higher.

## Does Black format docstrings?

Yes, Black cleans up the indentation of docstrings and removes superfluous whitespace,
but it does not format the code inside docstrings (including doctests).

If you need to format doctests, consider using a dedicated tool such as
[blacken-docs](https://github.com/adamchainz/blacken-docs) or
[pytest-doctestplus](https://pypi.org/project/pytest-doctestplus/) with
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like this one only runs doctests, not format them? I don't see any mention of the --doctest-format option in their README.

`pytest --doctest-modules --doctest-format=pep8`.

## Why does Black not detect syntax errors in my code?

_Black_ is an autoformatter, not a Python linter or interpreter. Detecting all syntax
Expand Down