-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider using with no assign (#4476)
* Emit ``consider-using-with`` also if calls like ``open()`` are used without an assignment
- Loading branch information
Showing
10 changed files
with
59 additions
and
47 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
bad-open-mode:11:0::"""rwx"" is not a valid mode for open." | ||
bad-open-mode:12:0::"""rr"" is not a valid mode for open." | ||
bad-open-mode:13:0::"""+"" is not a valid mode for open." | ||
bad-open-mode:14:0::"""xw"" is not a valid mode for open." | ||
bad-open-mode:20:0::"""Ua"" is not a valid mode for open." | ||
bad-open-mode:21:0::"""Ur++"" is not a valid mode for open." | ||
bad-open-mode:12:0::"""rwx"" is not a valid mode for open." | ||
bad-open-mode:13:0::"""rr"" is not a valid mode for open." | ||
bad-open-mode:14:0::"""+"" is not a valid mode for open." | ||
bad-open-mode:15:0::"""xw"" is not a valid mode for open." | ||
bad-open-mode:21:0::"""Ua"" is not a valid mode for open." | ||
bad-open-mode:22:0::"""Ur++"" is not a valid mode for open." |
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,22 +1,22 @@ | ||
consider-using-with:15:4:test_codecs_open:Consider using 'with' for resource-allocating operations | ||
consider-using-with:20:4:test_urlopen:Consider using 'with' for resource-allocating operations | ||
consider-using-with:24:4:test_temporary_file:Consider using 'with' for resource-allocating operations | ||
consider-using-with:28:4:test_named_temporary_file:Consider using 'with' for resource-allocating operations | ||
consider-using-with:32:4:test_spooled_temporary_file:Consider using 'with' for resource-allocating operations | ||
consider-using-with:36:4:test_temporary_directory:Consider using 'with' for resource-allocating operations | ||
consider-using-with:40:4:test_zipfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:41:4:test_zipfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:45:4:test_pyzipfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:50:4:test_pyzipfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:57:4:test_tarfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:63:4:test_tarfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:15:9:test_codecs_open:Consider using 'with' for resource-allocating operations | ||
consider-using-with:20:8:test_urlopen:Consider using 'with' for resource-allocating operations | ||
consider-using-with:24:8:test_temporary_file:Consider using 'with' for resource-allocating operations | ||
consider-using-with:28:8:test_named_temporary_file:Consider using 'with' for resource-allocating operations | ||
consider-using-with:32:8:test_spooled_temporary_file:Consider using 'with' for resource-allocating operations | ||
consider-using-with:36:8:test_temporary_directory:Consider using 'with' for resource-allocating operations | ||
consider-using-with:40:12:test_zipfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:41:8:test_zipfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:45:12:test_pyzipfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:50:8:test_pyzipfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:57:9:test_tarfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:63:9:test_tarfile:Consider using 'with' for resource-allocating operations | ||
consider-using-with:72:4:test_lock_acquisition:Consider using 'with' for resource-allocating operations | ||
consider-using-with:79:4:test_lock_acquisition:Consider using 'with' for resource-allocating operations | ||
consider-using-with:86:4:test_lock_acquisition:Consider using 'with' for resource-allocating operations | ||
consider-using-with:93:4:test_lock_acquisition:Consider using 'with' for resource-allocating operations | ||
consider-using-with:128:4:test_multiprocessing:Consider using 'with' for resource-allocating operations | ||
consider-using-with:128:8:test_multiprocessing:Consider using 'with' for resource-allocating operations | ||
consider-using-with:133:4:test_multiprocessing:Consider using 'with' for resource-allocating operations | ||
consider-using-with:138:4:test_multiprocessing:Consider using 'with' for resource-allocating operations | ||
consider-using-with:144:4:test_futures:Consider using 'with' for resource-allocating operations | ||
consider-using-with:148:4:test_futures:Consider using 'with' for resource-allocating operations | ||
consider-using-with:154:4:test_popen:Consider using 'with' for resource-allocating operations | ||
consider-using-with:144:8:test_futures:Consider using 'with' for resource-allocating operations | ||
consider-using-with:148:8:test_futures:Consider using 'with' for resource-allocating operations | ||
consider-using-with:154:8:test_popen:Consider using 'with' for resource-allocating operations |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
consider-using-with:12:0::Consider using 'with' for resource-allocating operations | ||
consider-using-with:16:4:test_open:Consider using 'with' for resource-allocating operations | ||
consider-using-with:12:9::Consider using 'with' for resource-allocating operations | ||
consider-using-with:16:9:test_open:Consider using 'with' for resource-allocating operations | ||
consider-using-with:45:4:test_open_outside_assignment:Consider using 'with' for resource-allocating operations | ||
consider-using-with:46:14:test_open_outside_assignment:Consider using 'with' for resource-allocating operations | ||
consider-using-with:51:8:test_open_inside_with_block:Consider using 'with' for resource-allocating operations |
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