-
Notifications
You must be signed in to change notification settings - Fork 16.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: Add ruff rules ANN (type annotations) #29271
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
286dcce
to
c0427b3
Compare
if instance is not None or owner is not None: | ||
emit_warning() | ||
if self.fget is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other possibility could be to call super().__get__
?
c0427b3
to
6b05ffa
Compare
@@ -2186,7 +2186,7 @@ class Foo(BaseModelV2): | |||
) | |||
|
|||
@tool(args_schema=Foo) | |||
def foo(x): # type: ignore[no-untyped-def] | |||
def foo(x: list[int]) -> list[int]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably reasonable to not update this type signature -- this test is attempting to verify that all the information is getting picked up from the args_schema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed!
Done in 454b292
454b292
to
eda139c
Compare
eda139c
to
d0358e9
Compare
d0358e9
to
04dfa99
Compare
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