ruff/crates/ruff_python_formatter/Docs.md

9 lines
466 B
Markdown

# 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](orphan_rules_in_the_formatter.svg)