Skip to content

Commit 02364fe

Browse files
committed
[doc] Add Collaborations sections to StringParensStripper and StringExprSplitter
1 parent 3c46389 commit 02364fe

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

black.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@ class that makes use of this mixin's functionality.
26632663
Collaborations:
26642664
What contractual agreements does this StringTransformer have with other
26652665
StringTransfomers? Such collaborations should be eliminated/minimized
2666-
as much as possible. Hence, this section is optional.
2666+
as much as possible.
26672667
"""
26682668

26692669
# Compiling re.Pattern objects is computationally expensive, so we cache
@@ -3179,6 +3179,11 @@ class StringParensStripper(StringTransformerMixin):
31793179
31803180
Transformations:
31813181
The parentheses mentioned in the 'Requirements' section are stripped.
3182+
3183+
Collaborations:
3184+
StringParensStripper has its own inherent usefulness, but it is also
3185+
relied on to clean up the parentheses created by StringExprSplitter (in
3186+
the event that they are no longer needed).
31823187
"""
31833188

31843189
def do_match(self, line: Line) -> STMatchResult:
@@ -3876,6 +3881,12 @@ class StringExprSplitter(StringSplitterMixin):
38763881
string is not necessarily being "wrapped" by parentheses. We can,
38773882
however, count on the LPAR being placed directly before the chosen
38783883
string.
3884+
3885+
Collaborations:
3886+
In the event that the string that StringExprSplitter split is changed
3887+
such that it no longer needs to be given its own line,
3888+
StringExprSplitter delegates the job of cleaning up the parentheses it
3889+
created to StringParensStripper.
38793890
"""
38803891

38813892
def do_splitter_match(self, line: Line) -> STMatchResult:

0 commit comments

Comments
 (0)