mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
[flake8-type-checking] Improve flexibility of runtime-evaluated-decorators (#15204)
Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
2
ruff.schema.json
generated
2
ruff.schema.json
generated
@@ -1387,7 +1387,7 @@
|
||||
}
|
||||
},
|
||||
"runtime-evaluated-decorators": {
|
||||
"description": "Exempt classes and functions decorated with any of the enumerated decorators from being moved into type-checking blocks.\n\nCommon examples include Pydantic's `@pydantic.validate_call` decorator (for functions) and attrs' `@attrs.define` decorator (for classes).",
|
||||
"description": "Exempt classes and functions decorated with any of the enumerated decorators from being moved into type-checking blocks.\n\nCommon examples include Pydantic's `@pydantic.validate_call` decorator (for functions) and attrs' `@attrs.define` decorator (for classes).\n\nThis also supports framework decorators like FastAPI's `fastapi.FastAPI.get` which will work across assignments in the same module.\n\nFor example: ```python import fastapi\n\napp = FastAPI(\"app\")\n\n@app.get(\"/home\") def home() -> str: ... ```\n\nHere `app.get` will correctly be identified as `fastapi.FastAPI.get`.",
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
|
||||
Reference in New Issue
Block a user