[flake8-simplify] Do not emit diagnostics for expressions inside string type annotations (SIM222, SIM223)#15405
Conversation
…ring type annotations (`SIM222`, `SIM223`)
|
|
I think we should still emit diagnostics here; we just may not want to offer a fix. |
dhruvmanila
left a comment
There was a problem hiding this comment.
I agree with Charlie that we should keep highlighting this but avoid providing a fix. As such, this is an invalid type expression.
|
It should be up to |
dhruvmanila
left a comment
There was a problem hiding this comment.
Related #10586
I thought about this more and I think this should be fine. We've done this kind of fixes before.
* main: [red-knot] Inline `SubclassOfType::as_instance_type_of_metaclass()` (#15556) [`flake8-comprehensions`] strip parentheses around generators in `unnecessary-generator-set` (`C401`) (#15553) [`pylint`] Implement `redefined-slots-in-subclass` (`W0244`) (#9640) [`flake8-bugbear`] Do not raise error if keyword argument is present and target-python version is less or equals than 3.9 (`B903`) (#15549) [red-knot] `type[T]` is disjoint from `type[S]` if the metaclass of `T` is disjoint from the metaclass of `S` (#15547) [red-knot] Pure instance variables declared in class body (#15515) Update snapshots of #15507 with new annotated snipetts rendering (#15546) [`pylint`] Do not report methods with only one `EM101`-compatible `raise` (`PLR6301`) (#15507) Fix unstable f-string formatting for expressions containing a trailing comma (#15545) Support `knot.toml` files in project discovery (#15505) Add support for configuring knot in `pyproject.toml` files (#15493) Fix bracket spacing for single-element tuples in f-string expressions (#15537) [`flake8-simplify`] Do not emit diagnostics for expressions inside string type annotations (`SIM222`, `SIM223`) (#15405) [`flake8-pytest-style`] Do not emit diagnostics for empty `for` loops (`PT012`, `PT031`) (#15542)
Summary
Resolves #7127.
Test Plan
cargo nextest runandcargo insta test.