ruff/crates/ruff
qdegraaf 2cde9b8aa6
[`flake8-pyi`] Implement PYI017 (#5895)
## Summary

Implements `PYI017` or `Y017` from `flake8-pyi` plug-in. Mirrors
[upstream
implementation](ceab86d16b/pyi.py (L1039-L1048)).
It checks for any assignment with more than 1 target or an assignment to
anything other than a name, and raises a violation for these in stub
files.

Couldn't find a clear and concise explanation for why this is to be
avoided and what is preferred for attribute cases like:

```python
a.b = int
```
So welcome some input there, to learn and to finish up the docs.

## Test Plan

Added test cases from upstream plug-in in a fixture (both `.py` and
`.pyi`). Added a few more.

## Issue link

Refers: https://github.com/astral-sh/ruff/issues/848
2023-07-20 16:35:38 +00:00
..
resources/test [`flake8-pyi`] Implement PYI017 (#5895) 2023-07-20 16:35:38 +00:00
src [`flake8-pyi`] Implement PYI017 (#5895) 2023-07-20 16:35:38 +00:00
Cargo.toml Handle io errors gracefully (#5611) 2023-07-20 11:30:14 +02:00