Skip to content

Commit 1f4f0d6

Browse files
author
Antoine DECHAUME
committed
Fix ruff violations
1 parent 100ca61 commit 1f4f0d6

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

src/docstring_inheritance/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class GoogleDocstringInheritanceMeta(_BaseDocstringInheritanceMeta):
8181
"""Metaclass for inheriting docstrings in Google format."""
8282

8383
def __init__(
84-
self,
84+
cls,
8585
class_name: str,
8686
class_bases: tuple[type],
8787
class_dict: dict[str, Any],
@@ -99,7 +99,7 @@ class GoogleDocstringInheritanceInitMeta(_BaseDocstringInheritanceMeta):
9999
"""Metaclass for inheriting docstrings in Google format with init-in-class."""
100100

101101
def __init__(
102-
self,
102+
cls,
103103
class_name: str,
104104
class_bases: tuple[type],
105105
class_dict: dict[str, Any],
@@ -117,7 +117,7 @@ class NumpyDocstringInheritanceMeta(_BaseDocstringInheritanceMeta):
117117
"""Metaclass for inheriting docstrings in Numpy format."""
118118

119119
def __init__(
120-
self,
120+
cls,
121121
class_name: str,
122122
class_bases: tuple[type],
123123
class_dict: dict[str, Any],
@@ -135,7 +135,7 @@ class NumpyDocstringInheritanceInitMeta(_BaseDocstringInheritanceMeta):
135135
"""Metaclass for inheriting docstrings in Numpy format with init-in-class."""
136136

137137
def __init__(
138-
self,
138+
cls,
139139
class_name: str,
140140
class_bases: tuple[type],
141141
class_dict: dict[str, Any],

src/docstring_inheritance/class_docstrings_inheritor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(
6161
docstring_inheritor: The docstring inheritor.
6262
init_in_class: Whether the ``__init__`` arguments documentation is in the
6363
class docstring.
64-
"""
64+
""" # noqa: D205, D212
6565
# Remove the new class itself and the object class from the mro,
6666
# object's docstrings have no interest.
6767
self.__mro_classes = cls.mro()[1:-1]

src/docstring_inheritance/docstring_inheritors/bases/inheritor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def inherit(
116116
Args:
117117
parent_doc: The docstring of the parent.
118118
child_func: The child function which docstring inherit from the parent.
119-
"""
119+
""" # noqa: D205, D212
120120
if parent_doc is not None:
121121
cls(child_func)._inherit(parent_doc)
122122

@@ -150,7 +150,7 @@ def _warn_similar_sections(
150150
Args:
151151
parent_sections: The parent sections.
152152
child_sections: The child sections.
153-
section_path: The hierarchy of section names.
153+
super_section_name: The name of the parent section.
154154
"""
155155
if self.__similarity_ratio == 0.0:
156156
return
@@ -187,7 +187,8 @@ def _warn_similar_section(
187187
Args:
188188
parent_doc: The parent documentation.
189189
child_doc: The child documentation.
190-
section_path: The hierarchy of section names.
190+
super_section_name: The name of the parent section.
191+
section_name: The name of the section.
191192
"""
192193
ratio = difflib.SequenceMatcher(None, parent_doc, child_doc).ratio()
193194
if ratio >= self.__similarity_ratio:

src/docstring_inheritance/docstring_inheritors/bases/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from itertools import pairwise
4242
else: # pragma: <3.10 cover
4343
# See https://docs.python.org/3/library/itertools.html#itertools.pairwise
44-
def pairwise(iterable):
44+
def pairwise(iterable): # noqa: D103
4545
a, b = tee(iterable)
4646
next(b, None)
4747
return zip(a, b)

tests/__init__.py

Whitespace-only changes.

tests/test_base_inheritor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class DummyParser(BaseDocstringParser):
9898
}
9999

100100

101-
@pytest.fixture()
101+
@pytest.fixture
102102
def patch_class():
103103
"""Monkey patch BaseDocstringInheritor with docstring parser constants."""
104104
BaseDocstringInheritor._DOCSTRING_PARSER = DummyParser

0 commit comments

Comments
 (0)