You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
We now allow RUF015 to fix cases like:
```python
list(range(10))[0]
list(x.y)[0]
list(x["y"])[0]
```
Further, we fix generators like:
```python
[i + 1 for i in x][0]
```
By rewriting to `next(iter(i + 1 for i in x))`.
I've retained the special-case that rewrites `[i for i in x][0]` to
`next(iter(x))`.
Closes#5764.
Ruff version: 0.0.278
Command:
ruff --config=ruff.toml file.py
ruff.toml
:Code snippet:
The code snippet was taken from the Ruff documentation
I expected it to give me a RUF015 warning but instead it completely ignores it. Changing the snippet to the following does throw a warning.
The text was updated successfully, but these errors were encountered: