ruff/crates
Charlie Marsh 134d447d4c
Avoid refactoring x[:1]-like slices in RUF015 (#6150)
## Summary

Right now, `RUF015` will try to rewrite `x[:1]` as `[next(x)]`. This
isn't equivalent if `x`, for example, is empty, where slicing like
`x[:1]` is forgiving, but `next` raises `StopIteration`. For me this is
a little too much of a deviation to be comfortable with, and most of the
value in this rule is the `x[0]` to `next(x)` conversion anyway.

Closes https://github.com/astral-sh/ruff/issues/6148.
2023-07-28 09:38:13 -04:00
..
flake8_to_ruff Bump version to 0.0.280 (#5965) 2023-07-21 22:36:13 -04:00
ruff Avoid refactoring x[:1]-like slices in RUF015 (#6150) 2023-07-28 09:38:13 -04:00
ruff_benchmark Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_cache
ruff_cli Fix windows test warnings (#6124) 2023-07-27 10:22:13 -04:00
ruff_dev Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_diagnostics Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_formatter Respect indent when measuring with MeasureMode::AllLines (#6120) 2023-07-27 10:22:13 -04:00
ruff_index
ruff_macros Remove parser dependency from ruff-python-ast (#6096) 2023-07-26 17:47:22 +02:00
ruff_python_ast Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_codegen Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_formatter Add AnyExpressionYield to consolidate ExprYield and ExprYieldFrom (#6127) 2023-07-27 16:01:16 +00: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 Add documentation and test cases for redefinition (#6135) 2023-07-28 00:01:42 +00:00
ruff_python_stdlib Fix logging rules with whitespace around dot (#6022) 2023-07-24 05:14:48 +00:00
ruff_python_trivia Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_shrinking Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_source_file Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_text_size Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_wasm Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00