-
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.
[
flake8-bandit
] Report all references to suspicious functions (S3
) (
#15541) ## Summary Resolves #15522. ## Test Plan `cargo nextest run` and `cargo insta test`. --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
- Loading branch information
1 parent
4eb465e
commit 5cd1f79
Showing
16 changed files
with
789 additions
and
30 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S301.py
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,3 +1,8 @@ | ||
import pickle | ||
|
||
pickle.loads() | ||
|
||
|
||
# https://github.com/astral-sh/ruff/issues/15522 | ||
map(pickle.load, []) | ||
foo = pickle.load |
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
13 changes: 13 additions & 0 deletions
13
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S312.py
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,3 +1,16 @@ | ||
from telnetlib import Telnet | ||
|
||
Telnet("localhost", 23) | ||
|
||
|
||
# https://github.com/astral-sh/ruff/issues/15522 | ||
map(Telnet, []) | ||
foo = Telnet | ||
|
||
import telnetlib | ||
_ = telnetlib.Telnet | ||
|
||
from typing import Annotated | ||
foo: Annotated[Telnet, telnetlib.Telnet()] | ||
|
||
def _() -> Telnet: ... |
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
Oops, something went wrong.