You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For not using items() to extract the value out of the dict. We ignore the case of an assignment, as you can't modify the underlying representation with the value in the list of tuples returned.
No prob! One thing I did in a few places was change x.is_none() followed by x.unwrap() to if let Some(x) = x, which couples "checking if the condition is met" with "getting access to the value".
The reason will be displayed to describe this comment to others. Learn more.
It would be quite useful to have a infrastructure to provide additional details here similar to Biome. That would avoid highlighting the entire for statement and instead we could highlight individual pieces of code with details.
max-muoto
changed the title
[pylint] Implement dict-iter-missing-items (C0206)
[pylint] Implement consider-dict-items (C0206)
Jun 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
previewRelated to preview mode featuresruleImplementing or modifying a lint rule
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the consider dict items rule from Pylint. Enabling this rule flags:
For not using
items()to extract the value out of the dict. We ignore the case of an assignment, as you can't modify the underlying representation with the value in the list of tuples returned.Test Plan
cargo test.