mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Enable the entire D category in Ruff
This commit is contained in:
@@ -7,8 +7,7 @@ module_level_var: int = 99
|
||||
|
||||
|
||||
class PEP526NumpyClass:
|
||||
"""
|
||||
Sample class with PEP 526 annotations and numpy docstring
|
||||
"""Sample class with PEP 526 annotations and numpy docstring
|
||||
|
||||
Attributes
|
||||
----------
|
||||
|
@@ -243,8 +243,7 @@ def test_format_signature(app):
|
||||
"""some docstring for F2."""
|
||||
|
||||
def __init__(self, *args, **kw):
|
||||
"""
|
||||
__init__(a1, a2, kw1=True, kw2=False)
|
||||
"""__init__(a1, a2, kw1=True, kw2=False)
|
||||
|
||||
some docstring for __init__.
|
||||
"""
|
||||
@@ -363,9 +362,7 @@ def test_get_doc(app):
|
||||
"""Docstring"""
|
||||
|
||||
def g():
|
||||
"""
|
||||
Docstring
|
||||
"""
|
||||
"""Docstring"""
|
||||
|
||||
for func in (f, g):
|
||||
assert getdocl('function', func) == ['Docstring']
|
||||
|
@@ -13,9 +13,7 @@ from sphinx.ext.napoleon import Config, _process_docstring, _skip_member, setup
|
||||
|
||||
|
||||
def simple_decorator(f):
|
||||
"""
|
||||
A simple decorator that does nothing, for tests to use.
|
||||
"""
|
||||
"""A simple decorator that does nothing, for tests to use."""
|
||||
|
||||
@functools.wraps(f)
|
||||
def wrapper(*args, **kwargs):
|
||||
|
@@ -94,8 +94,7 @@ def test_todo_not_included(app):
|
||||
confoverrides={'todo_include_todos': True},
|
||||
)
|
||||
def test_todo_valid_link(app):
|
||||
"""
|
||||
Test that the inserted "original entry" links for todo items have a target
|
||||
"""Test that the inserted "original entry" links for todo items have a target
|
||||
that exists in the LaTeX output. The target was previously incorrectly
|
||||
omitted (GitHub issue #1020).
|
||||
"""
|
||||
|
@@ -48,9 +48,10 @@ def check_viewcode_output(app: SphinxTestApp) -> str:
|
||||
) in result
|
||||
assert '<span>@decorator</span>\n' in result
|
||||
assert f'<span>class</span>{sp}<span>Class1</span><span>:</span>\n' in result
|
||||
assert '<span> </span><span>"""</span>\n' in result
|
||||
assert '<span> this is Class1</span>\n' in result
|
||||
assert '<span> """</span>\n' in result
|
||||
assert (
|
||||
'<span> </span>'
|
||||
'<span>"""this is Class1"""</span></div>\n'
|
||||
) in result
|
||||
|
||||
return result
|
||||
|
||||
|
Reference in New Issue
Block a user