From 4acf3358a1757b299a471603d2d4d551019de76a Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 17 Dec 2022 19:19:34 -0800 Subject: [PATCH] Revert "enable long_docstring_quotes_on_newline" This reverts commit bce883b4d81d18b2c8e99690c5cddddbaf44162b. --- src/black/linegen.py | 2 +- src/black/mode.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/black/linegen.py b/src/black/linegen.py index 29bd57e..64e9b91 100644 --- a/src/black/linegen.py +++ b/src/black/linegen.py @@ -393,7 +393,7 @@ def visit_STRING(self, leaf: Leaf) -> Iterator[Line]: quote = quote_char * quote_len # It's invalid to put closing single-character quotes on a new line. - if quote_len == 3: + if Preview.long_docstring_quotes_on_newline in self.mode and quote_len == 3: # We need to find the length of the last line of the docstring # to find if we can add the closing quotes to the line without # exceeding the maximum line length. diff --git a/src/black/mode.py b/src/black/mode.py index afa403e..4148266 100644 --- a/src/black/mode.py +++ b/src/black/mode.py @@ -150,6 +150,7 @@ class Preview(Enum): """Individual preview style features.""" prefer_splitting_right_hand_side_of_assignments = auto() + long_docstring_quotes_on_newline = auto() # NOTE: string_processing requires wrap_long_dict_values_in_parens # for https://github.com/psf/black/issues/3117 to be fixed. string_processing = auto()