core: Add ruff rules ANN (type annotations) (#29271)

See https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
The interest compared to only mypy is that ruff is very fast at
detecting missing annotations.

ANN101 and ANN102 are deprecated so we ignore them 
ANN401 (no Any type) ignored to be in sync with mypy config

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
This commit is contained in:
Christophe Bornet
2025-02-22 23:46:28 +01:00
committed by GitHub
parent 979a991dc2
commit f6d4fec4d5
9 changed files with 52 additions and 29 deletions

View File

@@ -4641,7 +4641,7 @@ class RunnableLambda(Runnable[Input, Output]):
)
@wraps(func)
async def f(*args, **kwargs): # type: ignore[no-untyped-def]
async def f(*args: Any, **kwargs: Any) -> Any:
return await run_in_executor(config, func, *args, **kwargs)
afunc = f
@@ -4889,7 +4889,7 @@ class RunnableLambda(Runnable[Input, Output]):
)
@wraps(func)
async def f(*args, **kwargs): # type: ignore[no-untyped-def]
async def f(*args: Any, **kwargs: Any) -> Any:
return await run_in_executor(config, func, *args, **kwargs)
afunc = f