diff --git a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1733_unnecessary_dict_index_lookup.py.snap b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1733_unnecessary_dict_index_lookup.py.snap index 45efa392dac50..aeaad23437783 100644 --- a/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1733_unnecessary_dict_index_lookup.py.snap +++ b/crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLR1733_unnecessary_dict_index_lookup.py.snap @@ -1,7 +1,7 @@ --- 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 @@ -9,7 +9,7 @@ unnecessary_dict_index_lookup.py:4:6: PLR1733 [*] Unnecessary dict index lookup 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} @@ -21,7 +21,7 @@ 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 @@ -29,7 +29,7 @@ unnecessary_dict_index_lookup.py:5:6: PLR1733 [*] Unnecessary dict index lookup | ^^^^^^^^^^^^^^^^^^ 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 | @@ -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 @@ -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(): @@ -62,7 +62,7 @@ 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 @@ -70,7 +70,7 @@ unnecessary_dict_index_lookup.py:9:15: PLR1733 [*] Unnecessary dict index lookup 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 @@ -82,7 +82,7 @@ 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 @@ -90,7 +90,7 @@ unnecessary_dict_index_lookup.py:10:16: PLR1733 [*] Unnecessary dict index looku | ^^^^^^^^^^^^^^^^^^ PLR1733 11 | assert FRUITS[fruit_name] == "pear" # PLR1733 | - = help: Remove unnecessary dict index lookup + = help: Use existing item variable instead ℹ Safe fix 7 7 | @@ -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():