Remove dead code
This commit is contained in:
parent
c984042ad2
commit
2446941824
35
black.py
35
black.py
@ -649,7 +649,7 @@ def any_open_brackets(self) -> bool:
|
|||||||
def max_delimiter_priority(self, exclude: Iterable[LeafID] = ()) -> int:
|
def max_delimiter_priority(self, exclude: Iterable[LeafID] = ()) -> int:
|
||||||
"""Return the highest priority of a delimiter found on the line.
|
"""Return the highest priority of a delimiter found on the line.
|
||||||
|
|
||||||
Values are consistent with what `is_delimiter()` returns.
|
Values are consistent with what `is_split_*_delimiter()` return.
|
||||||
Raises ValueError on no delimiters.
|
Raises ValueError on no delimiters.
|
||||||
"""
|
"""
|
||||||
return max(v for k, v in self.delimiters.items() if k not in exclude)
|
return max(v for k, v in self.delimiters.items() if k not in exclude)
|
||||||
@ -1352,17 +1352,11 @@ def whitespace(leaf: Leaf) -> str: # noqa C901
|
|||||||
|
|
||||||
if p.type in {syms.parameters, syms.arglist}:
|
if p.type in {syms.parameters, syms.arglist}:
|
||||||
# untyped function signatures or calls
|
# untyped function signatures or calls
|
||||||
if t == token.RPAR:
|
|
||||||
return NO
|
|
||||||
|
|
||||||
if not prev or prev.type != token.COMMA:
|
if not prev or prev.type != token.COMMA:
|
||||||
return NO
|
return NO
|
||||||
|
|
||||||
elif p.type == syms.varargslist:
|
elif p.type == syms.varargslist:
|
||||||
# lambdas
|
# lambdas
|
||||||
if t == token.RPAR:
|
|
||||||
return NO
|
|
||||||
|
|
||||||
if prev and prev.type != token.COMMA:
|
if prev and prev.type != token.COMMA:
|
||||||
return NO
|
return NO
|
||||||
|
|
||||||
@ -1456,21 +1450,9 @@ def whitespace(leaf: Leaf) -> str: # noqa C901
|
|||||||
# dots, but not the first one.
|
# dots, but not the first one.
|
||||||
return NO
|
return NO
|
||||||
|
|
||||||
elif (
|
|
||||||
p.type == syms.listmaker
|
|
||||||
or p.type == syms.testlist_gexp
|
|
||||||
or p.type == syms.subscriptlist
|
|
||||||
):
|
|
||||||
# list interior, including unpacking
|
|
||||||
if not prev:
|
|
||||||
return NO
|
|
||||||
|
|
||||||
elif p.type == syms.dictsetmaker:
|
elif p.type == syms.dictsetmaker:
|
||||||
# dict and set interior, including unpacking
|
# dict unpacking
|
||||||
if not prev:
|
if prev and prev.type == token.DOUBLESTAR:
|
||||||
return NO
|
|
||||||
|
|
||||||
if prev.type == token.DOUBLESTAR:
|
|
||||||
return NO
|
return NO
|
||||||
|
|
||||||
elif p.type in {syms.factor, syms.star_expr}:
|
elif p.type in {syms.factor, syms.star_expr}:
|
||||||
@ -1596,17 +1578,6 @@ def is_split_before_delimiter(leaf: Leaf, previous: Leaf = None) -> int:
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def is_delimiter(leaf: Leaf, previous: Leaf = None) -> int:
|
|
||||||
"""Return the priority of the `leaf` delimiter. Return 0 if not delimiter.
|
|
||||||
|
|
||||||
Higher numbers are higher priority.
|
|
||||||
"""
|
|
||||||
return max(
|
|
||||||
is_split_before_delimiter(leaf, previous),
|
|
||||||
is_split_after_delimiter(leaf, previous),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def generate_comments(leaf: Leaf) -> Iterator[Leaf]:
|
def generate_comments(leaf: Leaf) -> Iterator[Leaf]:
|
||||||
"""Clean the prefix of the `leaf` and generate comments from it, if any.
|
"""Clean the prefix of the `leaf` and generate comments from it, if any.
|
||||||
|
|
||||||
|
@ -16,8 +16,6 @@ Assertions and checks
|
|||||||
|
|
||||||
.. autofunction:: black.is_split_before_delimiter
|
.. autofunction:: black.is_split_before_delimiter
|
||||||
|
|
||||||
.. autofunction:: black.is_delimiter
|
|
||||||
|
|
||||||
.. autofunction:: black.is_empty_tuple
|
.. autofunction:: black.is_empty_tuple
|
||||||
|
|
||||||
.. autofunction:: black.is_import
|
.. autofunction:: black.is_import
|
||||||
|
Loading…
Reference in New Issue
Block a user