-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add broken NoReturn check #5304
Conversation
c61a20d
to
cfb04c3
Compare
Shouldn't this be in flake8-typing-imports instead ? We were going to add it to our own pre-commit configuration in #5070 (and astroid too) |
Not sure Anthony will add it ;) |
Ok, that makes sense. Trying not to add anything in 2.12 so we can release though :)
Yeah, it's often a struggle. |
Pull Request Test Coverage Report for Build 1963926454
💛 - Coveralls |
|
Doesn't really fit IMO. |
I thought this usage where it's not valid was when it's used as a typing argument ? |
You can still use it like this def func() -> NoReturn:
...
Alias = Union[None, 'NoReturn'] # note the use of ' ' at least if you don't need to call |
The uses are valid. It just breaks because of https://bugs.python.org/issue34921 |
@cdce8p Is this ready for review (barring the merge conflicts)? |
2acf2e8
to
5edeed8
Compare
Yes. I just resolved the merged conflicts. |
This reverts commit 5300d31.
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 little question. Rest looks good!
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 !
Need to do one more change. So far I've ignored Update: cc7fb08 |
Type of Changes
Description
Response to: pylint-dev/astroid#1239
Add a new check to detect broken uses for
typing.NoReturn
in3.7.0
/3.7.1
.I'm open to changing the checker name if something better than
broken-noreturn
is found :)