Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
make B405 rules more specific. Because not all in the module is related to parse xml. Some of them is needed for typing, for example
Element
. the reason why only theElementTree
module is updated is because defusedxml says in its readme thatcElementTree
is deprecated.This PR update the B405 rules, and make it more specific by add these
parse()
,iterparse()
,fromstring()
,XMLParser
.This is necessary because the contents of the
ElementTree
module are not all related to parsing xml. Some of them are needed for typing, such asElement
.From the docs stated that there is more functions or classes that relates with parsing. Here are some, but i may miss some.
The main reason why only these
parse()
,iterparse()
,fromstring()
,XMLParser
that is included in B405 rules, because defusedxml document it and the test example files test it. Maybe some functions or classes listed above could be included. So this PR will change the B405 rules which previously would give warnings about the entire contents of theElementTree
module, to justIssue: #709
Tagging people related on issue: @vanschelven @seanmceligot to find out what is missed in this PR.