-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fixed false negative of consider-using-enumerate
on attributes
#4508
Conversation
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.
👍
for i, _ in enumerate(self.options_providers): | ||
if provider.priority > self.options_providers[i].priority: | ||
self.options_providers.insert(i, provider) | ||
break |
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.
for i, _ in enumerate(self.options_providers): | |
if provider.priority > self.options_providers[i].priority: | |
self.options_providers.insert(i, provider) | |
break | |
for i, options_provider in enumerate(self.options_providers): | |
if provider.priority > options_provider.priority: | |
self.options_providers.insert(i, provider) | |
break |
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.
oops, oversight on my part -- will accept this suggestion. Thanks!
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.
We can probably add a new checker for it ;)
Something like list-index-lookup
?
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.
sounds good, was thinking something along the lines too
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
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! Thanks 🐬
Steps
Description
Fixed false negative of
consider-using-enumerate
not emitting when iterating over an attribute.Also, included test scenario described in #3657
Type of Changes
Related Issue
Closes #3657