ruff/crates/ruff_python_formatter/src/module
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
..
mod.rs Remove unused parser modes 2023-08-01 13:10:07 +02:00
mod_expression.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
mod_module.rs Add empty lines before nested functions and classes (#6206) 2023-08-01 15:30:59 +00:00