[flake8-type-checking] Improve flexibility of runtime-evaluated-decorators (#15204)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
David Salvisberg 2024-12-31 17:28:10 +01:00 committed by GitHub
parent 7ca3f9515c
commit 1ef0f615f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 192 additions and 10 deletions

View file

@ -1819,6 +1819,21 @@ pub struct Flake8TypeCheckingOptions {
///
/// Common examples include Pydantic's `@pydantic.validate_call` decorator
/// (for functions) and attrs' `@attrs.define` decorator (for classes).
///
/// This also supports framework decorators like FastAPI's `fastapi.FastAPI.get`
/// which will work across assignments in the same module.
///
/// For example:
/// ```python
/// import fastapi
///
/// app = FastAPI("app")
///
/// @app.get("/home")
/// def home() -> str: ...
/// ```
///
/// Here `app.get` will correctly be identified as `fastapi.FastAPI.get`.
#[option(
default = "[]",
value_type = "list[str]",