mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
[flake8-type-checking
] Improve flexibility of runtime-evaluated-decorators
(#15204)
Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
parent
7ca3f9515c
commit
1ef0f615f1
12 changed files with 192 additions and 10 deletions
|
@ -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]",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue