Skip to content

Commit

Permalink
[ignore] curious for diff shade output
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jul 17, 2023
1 parent 8d80aec commit 10c96b1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/black/linegen.py
Expand Up @@ -281,7 +281,7 @@ def visit_match_case(self, node: Node) -> Iterator[Line]:

def visit_suite(self, node: Node) -> Iterator[Line]:
"""Visit a suite."""
if self.mode.is_pyi and is_stub_suite(node):
if is_stub_suite(node):
yield from self.visit(node.children[2])
else:
yield from self.visit_default(node)
Expand All @@ -296,19 +296,15 @@ def visit_simple_stmt(self, node: Node) -> Iterator[Line]:

is_suite_like = node.parent and node.parent.type in STATEMENT
if is_suite_like:
if self.mode.is_pyi and is_stub_body(node):
if is_stub_body(node):
yield from self.visit_default(node)
else:
yield from self.line(+1)
yield from self.visit_default(node)
yield from self.line(-1)

else:
if (
not self.mode.is_pyi
or not node.parent
or not is_stub_suite(node.parent)
):
if not node.parent or not is_stub_suite(node.parent):
yield from self.line()
yield from self.visit_default(node)

Expand Down

0 comments on commit 10c96b1

Please sign in to comment.