ruff
bf70c2d6 - [`flake8-pyi`] Fix false positives on quoted annotations (`PYI036`) (#29274)

Commit
13 days ago
[`flake8-pyi`] Fix false positives on quoted annotations (`PYI036`) (#29274) ## Summary `bad-exit-annotation` (`PYI036`) checked raw annotation expressions, so stringized annotations such as `tb: "TracebackType | None"` or `*args: "object"` were flagged even though they mean the same thing to a type checker as the unquoted form. Each annotation check now goes through `Checker::match_maybe_stringized_annotation`, covering all three paths in the rule: regular parameters, variadic `*args`, and `@overload`ed methods. Fixes #27755. This follows the approach reviewed in #27758, which was closed unmerged. ## Test Plan - Extended `PYI036.py` with stringized `object`, union, variadic, and overload annotations in both correct and incorrect forms. - `cargo test -p ruff_linter flake8_pyi`: 130 passed.
Author
Parents
Loading