-
-
Notifications
You must be signed in to change notification settings - Fork 506
Allow to annotate existing model field de-selected via prior .values
/.values_list
calls
#2836
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
Allow to annotate existing model field de-selected via prior .values
/.values_list
calls
#2836
Conversation
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.
LGTM, except one question :)
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.
one nit :)
mypy_django_plugin/lib/helpers.py
Outdated
), | ||
mod_name=None, | ||
) | ||
else: |
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.
else: |
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.
I've made the change, should we add RET505 from ruff to enforce this convention ?
I can make a followup PR for this, it does affect ~10 files. I also find these valueable:
"RET504", # Unnecessary assignment to {name} before return statement
"RET505", # Unnecessary {branch} after return statement
"RET506", # Unnecessary {branch} after raise statement
"RET507", # Unnecessary {branch} after continue statement
"RET508", # Unnecessary {branch} after break statement
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.
Thanks a lot!
btw, asotille recently left sentry so we wont probably hear from him on this issue. |
|
Seem to be a conflict with the branch removing automatically added contentypes, will send a fix |
I have made things!
I've tried to avoid as much as possible false positive on loosely typed cases.
cc @asottile-sentry , would be awesome if can try to cherry-pick a1f80ea to see if it fixes your issue.
Related issues
Fixes #2818