Skip to content

docstring-code-format incorrectly formats semicolons+expressions #11480

@JasonGrace2282

Description

@JasonGrace2282

Example

"""
>>> l = []
>>> l.append(3); l
[3]
"""

Expected

"""
>>> l = []
>>> l.append(3)
>>> l
[3]
"""

Result

"""
>>> l = []
>>> l.append(3)
... l
[3]
"""

Reproduce:

[tool.ruff.format]
docstring-code-format = true

And run ruff format on the file.

Ruff Version

$ ruff -V
ruff 0.4.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocstringRelated to docstring linting or formattingformatterRelated to the formatter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions