ruff/crates/ruff
qdegraaf 38e618cd18
[`perflint`] Add `PERF101` with autofix (#5121)
## Summary

Adds PERF101 which checks for unnecessary casts to `list` in for loops. 

NOTE: Is not fully equal to its upstream implementation as this
implementation does not flag based on type annotations
(i.e.):
```python
def foo(x: List[str]):
    for y in list(x):
        ...
```

With the current set-up it's quite hard to get the annotation from a
function arg from its binding. Problem is best considered broader than
this implementation.

## Test Plan

Added fixture. 

## Issue links

Refers: https://github.com/astral-sh/ruff/issues/4789

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-06-22 20:44:26 +00:00
..
resources/test [`perflint`] Add `PERF101` with autofix (#5121) 2023-06-22 20:44:26 +00:00
src [`perflint`] Add `PERF101` with autofix (#5121) 2023-06-22 20:44:26 +00:00
Cargo.toml Bump version to 0.0.275 (#5276) 2023-06-21 21:53:37 -04:00