Skip to content

Commit

Permalink
fix snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
diceroll123 committed Nov 30, 2023
1 parent 9ae5ed2 commit b4b47fb
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
unnecessary_dict_index_lookup.py:4:6: PLR1733 [*] Unnecessary dict index lookup
unnecessary_dict_index_lookup.py:4:6: PLR1733 [*] Unnecessary lookup of dict item by index
|
3 | def fix_these():
4 | [FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()] # PLR1733
| ^^^^^^^^^^^^^^^^^^ PLR1733
5 | {FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()} # PLR1733
6 | {fruit_name: FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()} # PLR1733
|
= help: Remove unnecessary dict index lookup
= help: Use existing item variable instead

Safe fix
1 1 | FRUITS = {"apple": 1, "orange": 10, "berry": 22}
Expand All @@ -21,15 +21,15 @@ unnecessary_dict_index_lookup.py:4:6: PLR1733 [*] Unnecessary dict index lookup
6 6 | {fruit_name: FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()} # PLR1733
7 7 |

unnecessary_dict_index_lookup.py:5:6: PLR1733 [*] Unnecessary dict index lookup
unnecessary_dict_index_lookup.py:5:6: PLR1733 [*] Unnecessary lookup of dict item by index
|
3 | def fix_these():
4 | [FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()] # PLR1733
5 | {FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()} # PLR1733
| ^^^^^^^^^^^^^^^^^^ PLR1733
6 | {fruit_name: FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()} # PLR1733
|
= help: Remove unnecessary dict index lookup
= help: Use existing item variable instead

Safe fix
2 2 |
Expand All @@ -41,7 +41,7 @@ unnecessary_dict_index_lookup.py:5:6: PLR1733 [*] Unnecessary dict index lookup
7 7 |
8 8 | for fruit_name, fruit_count in FRUITS.items():

unnecessary_dict_index_lookup.py:6:18: PLR1733 [*] Unnecessary dict index lookup
unnecessary_dict_index_lookup.py:6:18: PLR1733 [*] Unnecessary lookup of dict item by index
|
4 | [FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()] # PLR1733
5 | {FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()} # PLR1733
Expand All @@ -50,7 +50,7 @@ unnecessary_dict_index_lookup.py:6:18: PLR1733 [*] Unnecessary dict index lookup
7 |
8 | for fruit_name, fruit_count in FRUITS.items():
|
= help: Remove unnecessary dict index lookup
= help: Use existing item variable instead

Safe fix
3 3 | def fix_these():
Expand All @@ -62,15 +62,15 @@ unnecessary_dict_index_lookup.py:6:18: PLR1733 [*] Unnecessary dict index lookup
8 8 | for fruit_name, fruit_count in FRUITS.items():
9 9 | print(FRUITS[fruit_name]) # PLR1733

unnecessary_dict_index_lookup.py:9:15: PLR1733 [*] Unnecessary dict index lookup
unnecessary_dict_index_lookup.py:9:15: PLR1733 [*] Unnecessary lookup of dict item by index
|
8 | for fruit_name, fruit_count in FRUITS.items():
9 | print(FRUITS[fruit_name]) # PLR1733
| ^^^^^^^^^^^^^^^^^^ PLR1733
10 | blah = FRUITS[fruit_name] # PLR1733
11 | assert FRUITS[fruit_name] == "pear" # PLR1733
|
= help: Remove unnecessary dict index lookup
= help: Use existing item variable instead

Safe fix
6 6 | {fruit_name: FRUITS[fruit_name] for fruit_name, fruit_count in FRUITS.items()} # PLR1733
Expand All @@ -82,15 +82,15 @@ unnecessary_dict_index_lookup.py:9:15: PLR1733 [*] Unnecessary dict index lookup
11 11 | assert FRUITS[fruit_name] == "pear" # PLR1733
12 12 |

unnecessary_dict_index_lookup.py:10:16: PLR1733 [*] Unnecessary dict index lookup
unnecessary_dict_index_lookup.py:10:16: PLR1733 [*] Unnecessary lookup of dict item by index
|
8 | for fruit_name, fruit_count in FRUITS.items():
9 | print(FRUITS[fruit_name]) # PLR1733
10 | blah = FRUITS[fruit_name] # PLR1733
| ^^^^^^^^^^^^^^^^^^ PLR1733
11 | assert FRUITS[fruit_name] == "pear" # PLR1733
|
= help: Remove unnecessary dict index lookup
= help: Use existing item variable instead

Safe fix
7 7 |
Expand All @@ -102,14 +102,14 @@ unnecessary_dict_index_lookup.py:10:16: PLR1733 [*] Unnecessary dict index looku
12 12 |
13 13 |

unnecessary_dict_index_lookup.py:11:16: PLR1733 [*] Unnecessary dict index lookup
unnecessary_dict_index_lookup.py:11:16: PLR1733 [*] Unnecessary lookup of dict item by index
|
9 | print(FRUITS[fruit_name]) # PLR1733
10 | blah = FRUITS[fruit_name] # PLR1733
11 | assert FRUITS[fruit_name] == "pear" # PLR1733
| ^^^^^^^^^^^^^^^^^^ PLR1733
|
= help: Remove unnecessary dict index lookup
= help: Use existing item variable instead

Safe fix
8 8 | for fruit_name, fruit_count in FRUITS.items():
Expand Down

0 comments on commit b4b47fb

Please sign in to comment.