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