Skip to content

Commit 716ddb3

Browse files
committed
Remove lxml from DUO107
defusedxml.lxml [was only ever an example](https://github.com/tiran/defusedxml#defusedxmllxml) and tiran/defusedxml#38.
1 parent ce0b19c commit 716ddb3

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

dlint/linters/bad_xml_use.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class BadXMLUseLinter(bad_module_use.BadModuleUseLinter):
2323
@property
2424
def illegal_modules(self):
2525
return [
26-
'lxml',
2726
'xml',
2827
'xmlrpclib',
2928
]

docs/linters/DUO107.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DUO107
22

3-
This linter searches for use of the `lxml`, `xml`, `xmlrpclib` modules. These
3+
This linter searches for use of the `xml`, `xmlrpclib` modules. These
44
libraries are not hardened against many common XML attacks. The `defusedxml`
55
library should be preferred to these modules.
66

tests/test_bad_xml_use.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def test_xml_import_usage(self):
1919
"""
2020
import xml
2121
import xmlrpclib
22-
import lxml
2322
"""
2423
)
2524

@@ -37,11 +36,6 @@ def test_xml_import_usage(self):
3736
lineno=3,
3837
col_offset=0,
3938
message=dlint.linters.BadXMLUseLinter._error_tmpl
40-
),
41-
dlint.linters.base.Flake8Result(
42-
lineno=4,
43-
col_offset=0,
44-
message=dlint.linters.BadXMLUseLinter._error_tmpl
4539
)
4640
]
4741

@@ -108,21 +102,6 @@ def test_element_parse_import_usage(self):
108102

109103
assert result == expected
110104

111-
def test_defused_lxml_usage(self):
112-
python_node = self.get_ast_node(
113-
"""
114-
from defusedxml import lxml
115-
"""
116-
)
117-
118-
linter = dlint.linters.BadXMLUseLinter()
119-
linter.visit(python_node)
120-
121-
result = linter.get_results()
122-
expected = []
123-
124-
assert result == expected
125-
126105

127106
if __name__ == "__main__":
128107
unittest.main()

0 commit comments

Comments
 (0)