-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
style: Fix needless-bool (SIM103) #4055
Conversation
Return the condition directly Ruff rule: https://docs.astral.sh/ruff/rules/needless-bool/ Added bool return type annotations when possible to confirm no other type was possible on changed functions
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.
Looks good in princple. Shortens and simplifies the code (reduces branches)...
I have some comments and suggestions for even further-reaching implementation.
But also here, you may have reasons to not include all possible changes... If so, I will approve after your reply...
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
Checked with ruff 0.5.4 and still passes. |
* style: Fix needless-bool (SIM103) Return the condition directly Ruff rule: https://docs.astral.sh/ruff/rules/needless-bool/ Added bool return type annotations when possible to confirm no other type was possible on changed functions * Update frame.py * Apply suggestions from code review Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com> * style: Merge more if conditions per review --------- Co-authored-by: Stefan Blumentrath <stefan.blumentrath@gmx.de>
Return the condition directly
Ruff rule: https://docs.astral.sh/ruff/rules/needless-bool/
Added bool return type annotations when possible to confirm no other type was possible on changed functions