mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix Ruff errors
This commit is contained in:
parent
b2afe12eb7
commit
3385ce10a1
@ -583,12 +583,15 @@ select = [
|
||||
# whitelist ``print`` for stdout messages
|
||||
"sphinx/testing/fixtures.py" = ["T201"]
|
||||
|
||||
# allow returning ``open()``
|
||||
"sphinx/testing/path.py" = ["SIM115"]
|
||||
|
||||
# Ruff bug: https://github.com/astral-sh/ruff/issues/6540
|
||||
"sphinx/transforms/i18n.py" = ["PGH004"]
|
||||
|
||||
"tests/*" = [
|
||||
"E501",
|
||||
"T201" # whitelist ``print`` for tests
|
||||
"T201", # whitelist ``print`` for tests
|
||||
]
|
||||
|
||||
# these tests need old ``typing`` generic aliases
|
||||
|
@ -1233,7 +1233,7 @@ class NumpyDocstring(GoogleDocstring):
|
||||
line1, line2 = self._lines.get(0), self._lines.get(1)
|
||||
return (not self._lines or
|
||||
self._is_section_header() or
|
||||
['', ''] == [line1, line2] or
|
||||
(line1 == line2 == '') or
|
||||
(self._is_in_section and
|
||||
line1 and
|
||||
not self._is_indented(line1, self._section_indent)))
|
||||
|
@ -202,7 +202,7 @@ def parselinenos(spec: str, total: int) -> list[int]:
|
||||
for part in parts:
|
||||
try:
|
||||
begend = part.strip().split('-')
|
||||
if ['', ''] == begend:
|
||||
if begend == ['', '']:
|
||||
raise ValueError
|
||||
if len(begend) == 1:
|
||||
items.append(int(begend[0]) - 1)
|
||||
|
Loading…
Reference in New Issue
Block a user