ruff/crates/ruff_python_formatter/Docs.md

466 B

Rust Python Formatter

For the formatter, we would like to implement Format from the rust_formatter crate for all AST nodes, defined in the rustpython_parser crate. This violates rust's orphan rules. We therefore generate in generate.py a newtype for each AST node with implementations of FormatNodeRule, FormatRule, AsFormat and IntoFormat on it.

excalidraw showing the relationships between the different types