-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: handle inconsistent-return-statements
false positive with quit()
/exit()
#10572
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
Conversation
…t()`/`exit()` Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
for more information, see https://pre-commit.ci
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, elegant fix, loads of tests, thank you !
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10572 +/- ##
=======================================
Coverage 95.90% 95.90%
=======================================
Files 176 176
Lines 19456 19458 +2
=======================================
+ Hits 18659 18661 +2
Misses 797 797
🚀 New features to boost your workflow:
|
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit 3a2f5f1 |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-maintenance/3.3.x maintenance/3.3.x
# Navigate to the new working tree
cd .worktrees/backport-maintenance/3.3.x
# Create a new branch
git switch --create backport-10572-to-maintenance/3.3.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e694467ce0754d7b051b1b868820802cb1496703
# Push it to GitHub
git push --set-upstream origin backport-10572-to-maintenance/3.3.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-maintenance/3.3.x Then, create a pull request where the |
…t()`/`exit()` (#10572) Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Type of Changes
Description
This PR fixes a false positive in the
inconsistent-return-statements
checker where functions usingquit()
orexit()
were incorrectly flagged as having inconsistent returns The fix leverages the existingutils.is_terminating_func()
utility that already recognizes_sitebuiltins.Quitter
(the type ofquit
/exit
objects) as terminating.Example:
Closes #10508