-
Notifications
You must be signed in to change notification settings - Fork 115
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
[6.14.z] Add Ruff rule group B (flake8-bugbear) #13695
Conversation
This change includes the rule addition and mostly manual changes to existing code in order to bring it in line with the new rules and avoid as many ignores as is reasonable. I added a number of {{from err}} statements to the end of exceptions that currently include the error message. The error message being included in the raised string can be removed later, but keeping for consistency for now. In cases where I raised from None, the raised exception is clear enough that the additional context of the parent exception isn't helpful. cli/test\_ping.py has a zip that should probably be strict.
@@ -235,9 +235,9 @@ def available_capsule_port(self): | |||
:rtype: int | |||
""" | |||
port_pool_range = settings.fake_capsules.port_range | |||
if type(port_pool_range) is str: | |||
if isinstance(port_pool_range, list): |
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.
is it correct?
if isinstance(port_pool_range, list): | |
if isinstance(port_pool_range, str): |
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.
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.
nice catch!
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.
@JacobCallahan Could you fix this in master branch manually?
I'll add similar comments to your other cherrypick PRs and we can commit this suggestion in same way
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.
manual fix required for master and 6.15.z branches*
fix type check from list to str Co-authored-by: Gaurav Talreja <[email protected]>
Cherry-pick of #13491
This change includes the rule addition and mostly manual changes to existing code in order to bring it in line with the new rules and avoid as many ignores as is reasonable.
I added a number of {{from err}} statements to the end of exceptions that currently include the error message. The error message being included in the raised string can be removed later, but keeping for consistency for now.
In cases where I raised from None, the raised exception is clear enough that the additional context of the parent exception isn't helpful.
cli/test_ping.py has a zip that should probably be strict.
fixes #13688