-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e496dc
commit 9ddbc95
Showing
2 changed files
with
36 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
26 changes: 24 additions & 2 deletions
26
...lint/snapshots/ruff_linter__rules__pylint__tests__PLE1141_dict_iter_missing_items.py.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,42 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pylint/mod.rs | ||
--- | ||
dict_iter_missing_items.py:8:13: PLE1141 Call `items()` when unpacking a dictionary for iteration | ||
dict_iter_missing_items.py:8:13: PLE1141 [*] Call `items()` when unpacking a dictionary for iteration | ||
| | ||
7 | # Errors | ||
8 | for k, v in d: | ||
| ^ PLE1141 | ||
9 | pass | ||
| | ||
= help: Add a call to `.items()` | ||
|
||
dict_iter_missing_items.py:12:13: PLE1141 Call `items()` when unpacking a dictionary for iteration | ||
ℹ Safe fix | ||
5 5 | s2 = {1, 2, 3} | ||
6 6 | | ||
7 7 | # Errors | ||
8 |-for k, v in d: | ||
8 |+for k, v in d.items(): | ||
9 9 | pass | ||
10 10 | | ||
11 11 | # False positive, since the keys are all tuples this is valid | ||
|
||
dict_iter_missing_items.py:12:13: PLE1141 [*] Call `items()` when unpacking a dictionary for iteration | ||
| | ||
11 | # False positive, since the keys are all tuples this is valid | ||
12 | for a, b in d_tuple: | ||
| ^^^^^^^ PLE1141 | ||
13 | pass | ||
| | ||
= help: Add a call to `.items()` | ||
|
||
ℹ Safe fix | ||
9 9 | pass | ||
10 10 | | ||
11 11 | # False positive, since the keys are all tuples this is valid | ||
12 |-for a, b in d_tuple: | ||
12 |+for a, b in d_tuple.items(): | ||
13 13 | pass | ||
14 14 | | ||
15 15 | # Non errors | ||
|
||
|