ruff/crates
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
..
flake8_to_ruff Bump version to 0.0.275 (#5276) 2023-06-21 21:53:37 -04:00
ruff [perflint] Add PERF101 with autofix (#5121) 2023-06-22 20:44:26 +00:00
ruff_benchmark Unify benchmarking and profiling docs (#5145) 2023-06-21 09:39:56 +00:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Bump version to 0.0.275 (#5276) 2023-06-21 21:53:37 -04:00
ruff_dev More stability checker options (#5299) 2023-06-22 15:48:11 +00:00
ruff_diagnostics Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_formatter Use trait for labels instead of TypeId (#5270) 2023-06-21 22:26:09 +01:00
ruff_index Run rustfmt on nightly to clean up erroneous comments (#5106) 2023-06-15 00:19:05 +00:00
ruff_macros Avoid including nursery rules in linter-level selectors (#5268) 2023-06-21 20:11:40 +00:00
ruff_python_ast Remove visit_arg_with_default (#5265) 2023-06-21 16:00:24 -04:00
ruff_python_formatter Fix formatter panic with comment after parenthesized dict value (#5293) 2023-06-22 16:52:48 +02:00
ruff_python_semantic Respect abc decorators when classifying function types (#5315) 2023-06-22 19:52:36 +00:00
ruff_python_stdlib Replace static CallPath vectors with matches! macros (#5148) 2023-06-16 17:34:42 +00:00
ruff_python_whitespace Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_rustpython Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_testing_macros Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_textwrap Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_wasm Move copyright rules to flake8_copyright module (#5236) 2023-06-21 01:56:40 +00:00