Skip to content

Commit

Permalink
fix: minimize every type comment
Browse files Browse the repository at this point in the history
  • Loading branch information
15r10nk committed Nov 29, 2023
1 parent 38b94f4 commit bce8503
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pysource_minimize/_minimize_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def minimize_expr(self, node):
elif isinstance(node, ast.NamedExpr):
self.try_only_minimize(node, node.target, node.value)
else:
assert False, "expression is not handled " % (node)
assert False, "expression is not handled %s" % (node)

def minimize_optional(self, node):
if not self.try_none(node):
Expand Down Expand Up @@ -304,7 +304,7 @@ def minimize_stmt(self, node):
if self.try_only_minimize(node, node.decorator_list):
return

self.minimize_list(node.body, self.minimize_stmt)
self.minimize_list(node.body)
body = self.get_ast(node).body

if not any(
Expand Down Expand Up @@ -425,7 +425,7 @@ def minimize_stmt(self, node):
self.minimize(node.target)
return

self.minimize_list(node.body, self.minimize_stmt)
self.minimize_list(node.body)
body = self.get_ast(node)
if not any(
isinstance(n, (ast.Break, ast.Continue)) for n in ast.walk(body)
Expand All @@ -437,7 +437,7 @@ def minimize_stmt(self, node):
self.minimize(node.target)

elif isinstance(node, ast.While):
self.minimize_list(node.body, self.minimize_stmt)
self.minimize_list(node.body)
body = self.get_ast(node)
if not any(
isinstance(n, (ast.Break, ast.Continue)) for n in ast.walk(body)
Expand Down Expand Up @@ -533,7 +533,7 @@ def minimize_item(item: ast.withitem):
return

def minimize_except_handler(handler):
self.minimize_list(handler.body, self.minimize_stmt)
self.minimize_list(handler.body)

if not handler.name and not try_star:
self.minimize_optional(handler.type)
Expand Down

0 comments on commit bce8503

Please sign in to comment.