ruff/crates
Charlie Marsh 2d505e2b04
Remove suite body tracking from SemanticModel (#5848)
## Summary

The `SemanticModel` currently stores the "body" of a given `Suite`,
along with the current statement index. This is used to support "next
sibling" queries, but we only use this in exactly one place -- the rule
that simplifies constructs like this to `any` or `all`:

```python
for x in y:
    if x == 0:
        return True
return False
```

Instead of tracking the state, we can just do a (slightly more
expensive) traversal, by finding the node within its parent and
returning the next node in the body.

Note that we'll only have to do this extremely rarely -- namely, for
functions that contain something like:

```python
for x in y:
    if x == 0:
        return True
```
2023-07-18 18:58:31 -04:00
..
flake8_to_ruff Fix nested lists in CONTRIBUTING.md (#5721) 2023-07-13 16:32:59 +00:00
ruff Remove suite body tracking from SemanticModel (#5848) 2023-07-18 18:58:31 -04:00
ruff_benchmark Create PyFormatOptions 2023-06-26 14:02:17 +02:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Ignore Jupyter Notebooks for --add-noqa (#5727) 2023-07-13 13:26:47 +05:30
ruff_dev Add a tool for shrinking failing examples (#5731) 2023-07-18 08:03:35 +00:00
ruff_diagnostics Run nightly Clippy over the Ruff repo (#5670) 2023-07-10 23:44:38 -04:00
ruff_formatter Remove mode from BestFitting 2023-07-11 14:19:26 +02:00
ruff_index Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
ruff_macros Run nightly Clippy over the Ruff repo (#5670) 2023-07-10 23:44:38 -04:00
ruff_python_ast Remove suite body tracking from SemanticModel (#5848) 2023-07-18 18:58:31 -04:00
ruff_python_formatter Remove exception-handler lexing from unused-bound-exception fix (#5851) 2023-07-18 18:27:46 +00:00
ruff_python_resolver Fix CI by downgrading to cargo insta 1.29.0 (#5589) 2023-07-08 14:54:49 +00:00
ruff_python_semantic Remove suite body tracking from SemanticModel (#5848) 2023-07-18 18:58:31 -04:00
ruff_python_stdlib Use a match statement for builtin detection (#5798) 2023-07-16 04:57:57 +00:00
ruff_python_whitespace perf(formatter): Use memchar for faster back tokenization (#5823) 2023-07-18 21:05:55 +00:00
ruff_rustpython Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_shrinking Add a tool for shrinking failing examples (#5731) 2023-07-18 08:03:35 +00:00
ruff_textwrap Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_wasm Refactor StmtIf: Formatter and Linter (#5459) 2023-07-18 13:40:15 +02:00