mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Resolve lint errors from Ruff 0.0.259
This commit is contained in:
parent
54f531e978
commit
9df3b59e00
@ -247,6 +247,7 @@ ignore = [
|
||||
"S105", # possible hardcoded password
|
||||
"S110", # try/except/pass detected
|
||||
"S113", # probable use of requests call without timeout
|
||||
"S301", # 'pickle' unsafe when loading untrusted data
|
||||
"S324", # probable use of insecure hash functions
|
||||
"S701", # use autoescape=True for Jinja
|
||||
# flake8-simplify
|
||||
|
@ -82,7 +82,7 @@ def assert_node(node: Node, cls: Any = None, xpath: str = "", **kwargs: Any) ->
|
||||
def etree_parse(path: str) -> Any:
|
||||
with warnings.catch_warnings(record=False):
|
||||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||
return ElementTree.parse(path)
|
||||
return ElementTree.parse(path) # NoQA: S314 # using known data in tests
|
||||
|
||||
|
||||
class Struct:
|
||||
|
@ -36,7 +36,8 @@ class EPUBElementTree:
|
||||
|
||||
@classmethod
|
||||
def fromstring(cls, string):
|
||||
return cls(ElementTree.fromstring(string))
|
||||
tree = ElementTree.fromstring(string) # NoQA: S314 # using known data in tests
|
||||
return cls(tree)
|
||||
|
||||
def find(self, match):
|
||||
ret = self.tree.find(match, namespaces=self.namespaces)
|
||||
|
@ -862,7 +862,7 @@ def test_latex_show_urls_is_inline(app, status, warning):
|
||||
'(http://sphinx\\sphinxhyphen{}doc.org/)}\n'
|
||||
'\\sphinxAtStartPar\nDescription' in result)
|
||||
assert ('\\sphinxlineitem{Footnote in term \\sphinxfootnotemark[7]}%\n'
|
||||
'\\begin{footnotetext}[7]\\sphinxAtStartFootnote\n')
|
||||
'\\begin{footnotetext}[7]\\sphinxAtStartFootnote\n' in result)
|
||||
assert ('\\sphinxlineitem{\\sphinxhref{http://sphinx-doc.org/}{URL in term} '
|
||||
'(http://sphinx\\sphinxhyphen{}doc.org/)}\n'
|
||||
'\\sphinxAtStartPar\nDescription' in result)
|
||||
|
@ -630,7 +630,7 @@ def extract_role_links(app, filename):
|
||||
lis = [l for l in t.split('\n') if l.startswith("<li")]
|
||||
entries = []
|
||||
for l in lis:
|
||||
li = ElementTree.fromstring(l)
|
||||
li = ElementTree.fromstring(l) # NoQA: S314 # using known data in tests
|
||||
aList = list(li.iter('a'))
|
||||
assert len(aList) == 1
|
||||
a = aList[0]
|
||||
|
@ -18,7 +18,7 @@ def test_build(app, status, warning):
|
||||
assert ' * function\n' not in py_undoc # these two are documented
|
||||
assert ' * Class\n' not in py_undoc # in autodoc.txt
|
||||
|
||||
assert ' * mod -- No module named mod' # in the "failed import" section
|
||||
assert " * mod -- No module named 'mod'" in py_undoc # in the "failed import" section
|
||||
|
||||
assert "undocumented py" not in status.getvalue()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user