ruff/crates/ruff_python_formatter/src
Charlie Marsh 8a0f844642
Box type params and arguments fields on the class definition node (#6275)
## Summary

This PR boxes the `TypeParams` and `Arguments` fields on the class
definition node. These fields are optional and often emitted, and given
that class definition is our largest enum variant, we pay the cost of
including them for every statement in the AST. Boxing these types
reduces the statement size by 40 bytes, which seems like a good tradeoff
given how infrequently these are accessed.

## Test Plan

Need to benchmark, but no behavior changes.
2023-08-02 16:47:06 +00:00
..
comments Add formatter support for call and class definition `Arguments` (#6274) 2023-08-02 11:54:22 -04:00
expression Add formatter support for call and class definition `Arguments` (#6274) 2023-08-02 11:54:22 -04:00
module Add empty lines before nested functions and classes (#6206) 2023-08-01 15:30:59 +00:00
other Add formatter support for call and class definition `Arguments` (#6274) 2023-08-02 11:54:22 -04:00
pattern Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
snapshots Remove exception-handler lexing from `unused-bound-exception` fix (#5851) 2023-07-18 18:27:46 +00:00
statement Box type params and arguments fields on the class definition node (#6275) 2023-08-02 16:47:06 +00:00
builders.rs Add formatter support for call and class definition `Arguments` (#6274) 2023-08-02 11:54:22 -04:00
cli.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
context.rs formatter: `WithNodeLevel` helper (#6212) 2023-07-31 21:22:17 +00:00
generated.rs Add formatter support for call and class definition `Arguments` (#6274) 2023-08-02 11:54:22 -04:00
lib.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
main.rs Add a formatter CLI for debugging (#4809) 2023-06-05 07:33:33 +00:00
options.rs Prefer the configured quote style 2023-06-26 14:24:25 +02:00
prelude.rs Accept any `Into<AnyNodeRef>` as `Comments` arguments (#5205) 2023-06-20 16:49:21 +00:00