From b62bd4de75694dfe775ff4f6f7f0a567fda549a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Langa?= Date: Tue, 24 Apr 2018 14:27:21 -0700 Subject: [PATCH] Add `explode_split` to documentation --- black.py | 3 ++- docs/reference/reference_functions.rst | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/black.py b/black.py index e899f7f..5458198 100644 --- a/black.py +++ b/black.py @@ -1984,13 +1984,14 @@ def standalone_comment_split(line: Line, py36: bool = False) -> Iterator[Line]: def explode_split( line: Line, py36: bool = False, omit: Collection[LeafID] = () ) -> Iterator[Line]: - """Split by RHS and immediately split contents by a delimiter.""" + """Split by rightmost bracket and immediately split contents by a delimiter.""" new_lines = list(right_hand_split(line, py36, omit)) if len(new_lines) != 3: yield from new_lines return yield new_lines[0] + try: yield from delimiter_split(new_lines[1], py36) except CannotSplit: diff --git a/docs/reference/reference_functions.rst b/docs/reference/reference_functions.rst index 40d9665..d0ded95 100644 --- a/docs/reference/reference_functions.rst +++ b/docs/reference/reference_functions.rst @@ -60,6 +60,8 @@ Split functions .. autofunction:: black.delimiter_split +.. autofunction:: black.explode_split + .. autofunction:: black.left_hand_split .. autofunction:: black.right_hand_split -- 2.39.5