Skip to content
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

WIP: Change end line and column for untyped function defs to line of function definition #17006

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mschoettle
Copy link

Work in progress for #16746

(Explain how this PR changes mypy.)

@mschoettle mschoettle changed the title WIP: Add test for line and column end for missing function type annotation WIP: Change end line and column for untyped function defs to line of function definition Mar 9, 2024

This comment has been minimized.

mypy/messages.py Outdated

# set end line and column to same as start of context for function definitions
# this avoids errors being reported in IDEs for the whole function
# TODO: figure out if it's possible to find the end of the function definition line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One approach for this could be to add a new attribute to the FuncDef class and set it when we're creating the FuncDef object in fastparse.py.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented May 8, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants