-
-
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.
Fix a false positive for
consider-using-dict-items
(#9594)
When iterating ``os.environ`` using the ``os.environ.keys()`` operation and then deleting an item using the key as a lookup. Closes #9554 Co-authored-by: Pierre Sassoulas <[email protected]>>
- Loading branch information
Showing
4 changed files
with
48 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Fix a false positive for ``consider-using-dict-items`` when iterating using ``keys()`` and then deleting an item using the key as a lookup. | ||
|
||
Closes #9554 |
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
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
33 changes: 17 additions & 16 deletions
33
tests/functional/c/consider/consider_using_dict_items.txt
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,16 +1,17 @@ | ||
consider-using-dict-items:6:4:7:24:bad:Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:9:4:10:30:bad:Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:21:4:22:35:another_bad:Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:40:0:42:18::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:44:0:45:20::Consider iterating with .items():UNDEFINED | ||
consider-iterating-dictionary:47:10:47:23::Consider iterating the dictionary directly instead of calling .keys():INFERENCE | ||
consider-using-dict-items:47:0:48:20::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:54:0:55:24::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:67:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:68:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:71:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:72:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:75:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-iterating-dictionary:86:25:86:42::Consider iterating the dictionary directly instead of calling .keys():INFERENCE | ||
consider-using-dict-items:86:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:103:0:105:24::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:10:4:11:24:bad:Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:13:4:14:30:bad:Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:27:4:28:35:another_bad:Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:47:0:49:18::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:51:0:52:20::Consider iterating with .items():UNDEFINED | ||
consider-iterating-dictionary:54:10:54:23::Consider iterating the dictionary directly instead of calling .keys():INFERENCE | ||
consider-using-dict-items:54:0:55:20::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:63:0:64:24::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:76:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:77:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:80:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:81:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:84:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-iterating-dictionary:95:25:95:42::Consider iterating the dictionary directly instead of calling .keys():INFERENCE | ||
consider-using-dict-items:95:0:None:None::Consider iterating with .items():UNDEFINED | ||
consider-using-dict-items:112:0:114:24::Consider iterating with .items():UNDEFINED | ||
consider-iterating-dictionary:119:11:119:28::Consider iterating the dictionary directly instead of calling .keys():INFERENCE |