ruff/crates/ruff_python_formatter/tests
Charlie Marsh 928ab63a64
Add empty lines before nested functions and classes (#6206)
## Summary

This PR ensures that if a function or class is the first statement in a
nested suite that _isn't_ a function or class body, we insert a leading
newline.

For example, given:

```python
def f():
    if True:

        def register_type():
            pass
```

We _want_ to preserve the newline, whereas today, we remove it.

Note that this only applies when the function or class doesn't have any
leading comments.

Closes https://github.com/astral-sh/ruff/issues/6066.
2023-08-01 15:30:59 +00:00
..
snapshots Add empty lines before nested functions and classes (#6206) 2023-08-01 15:30:59 +00:00
fixtures.rs Format target: annotation = value? expressions (#5661) 2023-07-11 16:40:28 +02:00