ruff/crates
konsti 9a817a2922
Insert empty line between suite and alternative branch after def/class (#12294)
When there is a function or class definition at the end of a suite
followed by the beginning of an alternative block, we have to insert a
single empty line between them.

In the if-else-statement example below, we insert an empty line after
the `foo` in the if-block, but none after the else-block `foo`, since in
the latter case the enclosing suite already adds empty lines.

```python
if sys.version_info >= (3, 10):
    def foo():
        return "new"
else:
    def foo():
        return "old"
class Bar:
    pass
```

To do so, we track whether the current suite is the last one in the
current statement with a new option on the suite kind.

Fixes #12199

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2024-07-15 12:59:33 +02:00
..
red_knot Change File::touch_path to only take a SystemPath (#12273) 2024-07-10 12:15:14 +00:00
red_knot_module_resolver Sync vendored typeshed stubs (#12325) 2024-07-15 07:46:55 +01:00
red_knot_python_semantic [red-knot] Add more stress tests for module resolver invalidation (#12272) 2024-07-10 14:34:06 +00:00
ruff Bump version to v0.5.2 (#12316) 2024-07-14 10:43:58 -04:00
ruff_benchmark [red-knot] Rename FileSystem to System (#12214) 2024-07-09 07:20:51 +00:00
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db [red-knot] Add a read_directory() method to the ruff_db::system::System trait (#12289) 2024-07-12 12:31:05 +00:00
ruff_dev Drop deprecated nursery rule group (#10172) 2024-06-27 13:44:11 +02:00
ruff_diagnostics
ruff_formatter Use indentation consistently (#12293) 2024-07-12 14:08:56 +02:00
ruff_index
ruff_linter [flake8-bandit] Support explicit string concatenations in S310 HTTP detection (#12315) 2024-07-14 10:44:08 -04:00
ruff_macros Drop deprecated nursery rule group (#10172) 2024-06-27 13:44:11 +02:00
ruff_notebook Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
ruff_python_ast Update Rust crate compact_str to 0.8.0 (#12333) 2024-07-15 06:03:23 +00:00
ruff_python_ast_integration_tests Rename PreorderVisitor to SourceOrderVisitor (#11798) 2024-06-07 17:01:58 +00:00
ruff_python_codegen Use indentation consistently (#12293) 2024-07-12 14:08:56 +02:00
ruff_python_formatter Insert empty line between suite and alternative branch after def/class (#12294) 2024-07-15 12:59:33 +02:00
ruff_python_index Enable token-based rules on source with syntax errors (#11950) 2024-07-02 08:57:46 +00:00
ruff_python_literal
ruff_python_parser Enable token-based rules on source with syntax errors (#11950) 2024-07-02 08:57:46 +00:00
ruff_python_resolver
ruff_python_semantic [flake8-async] Update ASYNC109 to match upstream (#12236) 2024-07-09 04:14:27 +00:00
ruff_python_stdlib
ruff_python_trivia Mention that Cursor is based on rustc's implementation. (#12109) 2024-06-30 16:53:25 +01:00
ruff_python_trivia_integration_tests Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_server Build settings index in parallel for the native server (#12299) 2024-07-15 09:57:54 +00:00
ruff_source_file red-knot: source_text, line_index, and parsed_module queries (#11822) 2024-06-13 07:37:02 +00:00
ruff_text_size Upgrade to Rust 1.79 (#11875) 2024-06-17 07:15:10 +01:00
ruff_wasm Show syntax errors on the playground (#12083) 2024-06-28 13:06:15 +05:30
ruff_workspace Use more threads when discovering python files (#12258) 2024-07-10 09:29:17 +02:00