Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit 95987b3

Browse files
committed
Integrate NormalizeFormatVisitor into AutoFormatVisitor
1 parent 805ad8a commit 95987b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rewrite/rewrite/python/format/auto_format.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from rewrite import Recipe, Tree, Cursor
44
from rewrite.java import JavaSourceFile, MethodDeclaration, J, Space
5-
from rewrite.python import PythonVisitor, SpacesStyle, IntelliJ
5+
from rewrite.python import PythonVisitor, SpacesStyle, IntelliJ, NormalizeFormatVisitor
66
from rewrite.visitor import P, T
77

88

@@ -19,6 +19,7 @@ def visit(self, tree: Optional[Tree], p: P, parent: Optional[Cursor] = None) ->
1919
self._cursor = parent if parent is not None else Cursor(None, Cursor.ROOT_VALUE)
2020
cu = tree if isinstance(tree, JavaSourceFile) else self._cursor.first_enclosing_or_throw(JavaSourceFile)
2121

22+
tree = NormalizeFormatVisitor(self._stop_after).visit(tree, p, self._cursor.fork())
2223
tree = SpacesVisitor(cu.get_style(SpacesStyle) or IntelliJ.spaces(), self._stop_after).visit(tree, p, self._cursor.fork())
2324
return tree
2425

0 commit comments

Comments
 (0)