-
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.
…15822) ## Summary Permits suspicious imports (the `S4` namespaced diagnostics) from stub files. Closes #15207. ## Test Plan Added tests and ran `cargo nextest run`. The test files are copied from the `.py` variants.
- Loading branch information
Showing
30 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S401.pyi
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,2 @@ | ||
import telnetlib | ||
from telnetlib import Telnet |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S402.pyi
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,2 @@ | ||
import ftplib | ||
from ftplib import FTP |
8 changes: 8 additions & 0 deletions
8
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S403.pyi
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,8 @@ | ||
import dill | ||
from dill import objects | ||
import shelve | ||
from shelve import open | ||
import cPickle | ||
from cPickle import load | ||
import pickle | ||
from pickle import load |
3 changes: 3 additions & 0 deletions
3
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S404.pyi
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 @@ | ||
import subprocess | ||
from subprocess import Popen | ||
from subprocess import Popen as pop |
4 changes: 4 additions & 0 deletions
4
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S405.pyi
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,4 @@ | ||
import xml.etree.cElementTree | ||
from xml.etree import cElementTree | ||
import xml.etree.ElementTree | ||
from xml.etree import ElementTree |
3 changes: 3 additions & 0 deletions
3
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S406.pyi
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 @@ | ||
from xml import sax | ||
import xml.sax as xmls | ||
import xml.sax |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S407.pyi
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,2 @@ | ||
from xml.dom import expatbuilder | ||
import xml.dom.expatbuilder |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S408.pyi
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,2 @@ | ||
from xml.dom.minidom import parseString | ||
import xml.dom.minidom |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S409.pyi
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,2 @@ | ||
from xml.dom.pulldom import parseString | ||
import xml.dom.pulldom |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S410.pyi
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,2 @@ | ||
import lxml | ||
from lxml import etree |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S411.pyi
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,2 @@ | ||
import xmlrpc | ||
from xmlrpc import server |
1 change: 1 addition & 0 deletions
1
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S412.pyi
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 @@ | ||
from twisted.web.twcgi import CGIScript |
4 changes: 4 additions & 0 deletions
4
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S413.pyi
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,4 @@ | ||
import Crypto.Hash | ||
from Crypto.Hash import MD2 | ||
import Crypto.PublicKey | ||
from Crypto.PublicKey import RSA |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S415.pyi
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,2 @@ | ||
import pyghmi | ||
from pyghmi import foo |
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
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S401_S401.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S402_S402.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S403_S403.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S404_S404.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S405_S405.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S406_S406.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S407_S407.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S408_S408.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S409_S409.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S410_S410.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S411_S411.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S412_S412.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S413_S413.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|
5 changes: 5 additions & 0 deletions
5
...ules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S415_S415.pyi.snap
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,5 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
snapshot_kind: text | ||
--- | ||
|