Skip to content

Formatting doctests in doc strings #745

@ChrisWellsWood

Description

@ChrisWellsWood

I often find myself writing a doctest, pasting it into a separate file, formatting it with Black then pasting it back into the doc string. It'd be very convenient if Black formatted the code in doctests, maybe it could be behind a flag.

I saw @ambv saying that doc strings are out of scope in another issue (#144 (comment)) but I see less controversy about formatting the doctests as they're code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions