Skip to content

fix: handle multiline string in parameter formatting#336

Merged
weibullguy merged 2 commits into
PyCQA:masterfrom
finswimmer:fix-multiline-parameter
Apr 20, 2026
Merged

fix: handle multiline string in parameter formatting#336
weibullguy merged 2 commits into
PyCQA:masterfrom
finswimmer:fix-multiline-parameter

Conversation

@finswimmer
Copy link
Copy Markdown
Contributor

This PR fixes an issue where multiline string parameters in function were formatted by docformatter.

If the input looked like this:

foo = textwrap.dedent("""\
   bar
   baz
""")

The wrong output looked like this:

foo = textwrap.dedent(\
"""\
   bar
   baz
"""\
)

My expectation is that docformatter do nothing in this case.

I was able to narrow down the underlying issue by myself. The actual fix was than created with the help of AI, as my knowledge about the token stuff is quite limited 🙈

@weibullguy weibullguy merged commit 4dfae40 into PyCQA:master Apr 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants