ruff/crates
Charlie Marsh 615337a54d
Remove newline-insertion logic from JoinNodesBuilder (#6205)
## Summary

This PR moves the "insert empty lines" behavior out of
`JoinNodesBuilder` and into the `Suite` formatter. I find it a little
confusing that the logic is split between those two formatters right
now, and since this is _only_ used in that one place, IMO it is a bit
simpler to just inline it and use a single approach to tracking state
(right now, both are stateful).

The only other place this was used was for decorators. As a side effect,
we now remove blank lines in both of these cases, which is a known but
intentional deviation from Black (which preserves the empty line before
the comment in the first case):

```python
@foo

# Hello
@bar
def baz():
    pass

@foo

@bar
def baz():
    pass
```
2023-07-31 16:58:15 -04:00
..
flake8_to_ruff Bump version to 0.0.281 (#6195) 2023-07-31 13:21:43 -04:00
ruff Reset model state when exiting deferred visitors (#6208) 2023-07-31 19:46:52 +00:00
ruff_benchmark Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Log configuration in ruff_dev (#6193) 2023-07-31 17:52:38 +00:00
ruff_dev Use tracing for format_dev (#6177) 2023-07-31 19:14:01 +00:00
ruff_diagnostics Skip partial duplicates when applying multi-edit fixes (#6144) 2023-07-29 12:11:57 +00:00
ruff_formatter Respect indent when measuring with MeasureMode::AllLines (#6120) 2023-07-27 10:22:13 -04:00
ruff_index Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
ruff_macros Remove parser dependency from ruff-python-ast (#6096) 2023-07-26 17:47:22 +02:00
ruff_python_ast Ignore end-of-line file exemption comments (#6160) 2023-07-29 00:40:32 +00:00
ruff_python_codegen Avoid parenthesizing comprehension element (#6198) 2023-07-31 20:56:42 +05:30
ruff_python_formatter Remove newline-insertion logic from JoinNodesBuilder (#6205) 2023-07-31 16:58:15 -04:00
ruff_python_index Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_literal Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_resolver Avoid walking past root when resolving imports (#6126) 2023-07-27 10:22:13 -04:00
ruff_python_semantic Avoid falsely marking non-submodules as submodule aliases (#6182) 2023-07-30 22:16:25 +00:00
ruff_python_stdlib Fix logging rules with whitespace around dot (#6022) 2023-07-24 05:14:48 +00:00
ruff_python_trivia Ignore end-of-line file exemption comments (#6160) 2023-07-29 00:40:32 +00:00
ruff_shrinking Use tracing for format_dev (#6177) 2023-07-31 19:14:01 +00:00
ruff_source_file Skip BOM when determining Locator's line starts (#6159) 2023-07-29 11:47:13 +00:00
ruff_text_size Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_wasm Skip partial duplicates when applying multi-edit fixes (#6144) 2023-07-29 12:11:57 +00:00