mirror of https://github.com/astral-sh/ruff
Closes issue #21565 ## Summary As pointed out in the issue, slices are currently flagged by B008 but this behavior is incorrect because slices are immutable. ## Test Plan Added a test case in the "B006_B008.py" fixture. Sorry for the diff in the snapshots, the only thing that changes in those flies is the line numbers, though. You can also test this manually with this file: ```py # test_slice.py def c(d=slice(0, 3)): ... ``` ```sh > target/debug/ruff check tmp/test_slice.py --no-cache --select B008 All checks passed! ``` |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||