ruff
c0dbcb34 - [`flake8-pyi`] Implement PYI018 (#6018)

Commit
2 years ago
[`flake8-pyi`] Implement PYI018 (#6018) ## Summary Check for unused private `TypeVar`. See [original implementation](https://github.com/PyCQA/flake8-pyi/blob/2a86db8271dc500247a8a69419536240334731cf/pyi.py#L1958). ``` $ flake8 --select Y018 crates/ruff/resources/test/fixtures/flake8_pyi/PYI018.pyi crates/ruff/resources/test/fixtures/flake8_pyi/PYI018.pyi:4:1: Y018 TypeVar "_T" is not used crates/ruff/resources/test/fixtures/flake8_pyi/PYI018.pyi:5:1: Y018 TypeVar "_P" is not used ``` ``` $ ./target/debug/ruff --select PYI018 crates/ruff/resources/test/fixtures/flake8_pyi/PYI018.pyi --no-cache crates/ruff/resources/test/fixtures/flake8_pyi/PYI018.pyi:4:1: PYI018 TypeVar `_T` is never used crates/ruff/resources/test/fixtures/flake8_pyi/PYI018.pyi:5:1: PYI018 TypeVar `_P` is never used Found 2 errors. ``` In the file `unused_private_type_declaration.rs`, I'm planning to add other rules that are similar to `PYI018` like the `PYI046`, `PYI047` and `PYI049`. ref #848 ## Test Plan Snapshots and manual runs of flake8.
Author
Parents
Loading