Skip to content

Conversation

@vkleen
Copy link
Contributor

@vkleen vkleen commented Jan 17, 2023

This PR makes the pretty printer emit multiline strings if it encounters documentation metadata containing newlines. Previously, as I complained about in #1044, the pretty printer would unconditionally insert a hard newline after the opening double quote. Additionally, it would indent the documentation string and thereby change the semantics of the code.

With this PR, multiline strings are used when necessary and single line strings are used whenever the docstring does not contain newlines. Additionally, there's a regression test using the new snapshot testing infrastructure.

Closes #1044

@github-actions github-actions bot temporarily deployed to pull request January 17, 2023 14:30 Inactive
@vkleen vkleen merged commit 9453ad6 into master Jan 17, 2023
@vkleen vkleen deleted the pretty-printer-doc-metadata branch January 17, 2023 17:40
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.

Pretty printer produces spurious newlines

4 participants