Skip to content

Commit b2ab699

Browse files
Remove overly broad parent binary operation inclusion logic
1 parent 49ae806 commit b2ab699

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/black/comments.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -802,22 +802,6 @@ def _generate_ignored_nodes_from_fmt_skip(
802802
ignored_nodes = [node for node in ignored_nodes if node.parent != parent]
803803
ignored_nodes.append(parent)
804804

805-
# If the atom's parent is a binary operation (comparison, arithmetic, etc.)
806-
# and we've also captured siblings of the atom from the same parent, then
807-
# include the entire parent to avoid leaving an incomplete binary operation
808-
if (
809-
parent.parent is not None
810-
and isinstance(parent.parent, Node)
811-
and any(
812-
node.parent == parent.parent and node != parent
813-
for node in ignored_nodes
814-
)
815-
):
816-
ignored_nodes = [
817-
node for node in ignored_nodes if node.parent != parent.parent
818-
]
819-
ignored_nodes.append(parent.parent)
820-
821805
yield from ignored_nodes
822806
elif (
823807
parent is not None and parent.type == syms.suite and leaf.type == token.NEWLINE

0 commit comments

Comments
 (0)