-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Detect unreachable code after sys.exit, quit, exit, and os._exit #7520
Detect unreachable code after sys.exit, quit, exit, and os._exit #7520
Conversation
Pull Request Test Coverage Report for Build 3457101611
💛 - Coveralls |
af5fede
to
7eeec69
Compare
This comment has been minimized.
This comment has been minimized.
Thanks for tackling this @clavedeluna! I think the Django primer result shows that some control flow is needed since the message shouldn't emit in this case in the |
This comment has been minimized.
This comment has been minimized.
I'm still trying to figure out how to use the primer results, it's confusing because the run hasn't finished but there's an output above in the PR |
There's a new comment each time the primer is run, the new one should appear shortly. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
It's starting to look pretty good, thank you @clavedeluna :)
""" | ||
if self._is_sys_exit(node): | ||
self._check_unreachable(node) |
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.
The confidence need to be INFERENCE in this case, but it should still be HIGH when we don't need inference.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
6b49d70
to
6857803
Compare
Rebased on upstream/main so the pipeline can run properly. |
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit 6857803 |
Type of Changes
Description
Pylint can now detect unreachable code for any code that follows a sys.exit call
Refs #519