Enable the entire D category in Ruff

This commit is contained in:
Adam Turner
2025-01-14 15:55:02 +00:00
parent dbf62cd503
commit c4daa95c09
96 changed files with 310 additions and 706 deletions

View File

@@ -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
----------

View File

@@ -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']

View File

@@ -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):

View File

@@ -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).
"""

View File

@@ -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>&quot;&quot;&quot;</span>\n' in result
assert '<span> this is Class1</span>\n' in result
assert '<span> &quot;&quot;&quot;</span>\n' in result
assert (
'<span> </span>'
'<span>&quot;&quot;&quot;this is Class1&quot;&quot;&quot;</span></div>\n'
) in result
return result