File tree Expand file tree Collapse file tree 6 files changed +11
-10
lines changed
src/docstring_inheritance
docstring_inheritors/bases Expand file tree Collapse file tree 6 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ class GoogleDocstringInheritanceMeta(_BaseDocstringInheritanceMeta):
81
81
"""Metaclass for inheriting docstrings in Google format."""
82
82
83
83
def __init__ (
84
- self ,
84
+ cls ,
85
85
class_name : str ,
86
86
class_bases : tuple [type ],
87
87
class_dict : dict [str , Any ],
@@ -99,7 +99,7 @@ class GoogleDocstringInheritanceInitMeta(_BaseDocstringInheritanceMeta):
99
99
"""Metaclass for inheriting docstrings in Google format with init-in-class."""
100
100
101
101
def __init__ (
102
- self ,
102
+ cls ,
103
103
class_name : str ,
104
104
class_bases : tuple [type ],
105
105
class_dict : dict [str , Any ],
@@ -117,7 +117,7 @@ class NumpyDocstringInheritanceMeta(_BaseDocstringInheritanceMeta):
117
117
"""Metaclass for inheriting docstrings in Numpy format."""
118
118
119
119
def __init__ (
120
- self ,
120
+ cls ,
121
121
class_name : str ,
122
122
class_bases : tuple [type ],
123
123
class_dict : dict [str , Any ],
@@ -135,7 +135,7 @@ class NumpyDocstringInheritanceInitMeta(_BaseDocstringInheritanceMeta):
135
135
"""Metaclass for inheriting docstrings in Numpy format with init-in-class."""
136
136
137
137
def __init__ (
138
- self ,
138
+ cls ,
139
139
class_name : str ,
140
140
class_bases : tuple [type ],
141
141
class_dict : dict [str , Any ],
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ def __init__(
61
61
docstring_inheritor: The docstring inheritor.
62
62
init_in_class: Whether the ``__init__`` arguments documentation is in the
63
63
class docstring.
64
- """
64
+ """ # noqa: D205, D212
65
65
# Remove the new class itself and the object class from the mro,
66
66
# object's docstrings have no interest.
67
67
self .__mro_classes = cls .mro ()[1 :- 1 ]
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ def inherit(
116
116
Args:
117
117
parent_doc: The docstring of the parent.
118
118
child_func: The child function which docstring inherit from the parent.
119
- """
119
+ """ # noqa: D205, D212
120
120
if parent_doc is not None :
121
121
cls (child_func )._inherit (parent_doc )
122
122
@@ -150,7 +150,7 @@ def _warn_similar_sections(
150
150
Args:
151
151
parent_sections: The parent sections.
152
152
child_sections: The child sections.
153
- section_path : The hierarchy of section names .
153
+ super_section_name : The name of the parent section .
154
154
"""
155
155
if self .__similarity_ratio == 0.0 :
156
156
return
@@ -187,7 +187,8 @@ def _warn_similar_section(
187
187
Args:
188
188
parent_doc: The parent documentation.
189
189
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.
191
192
"""
192
193
ratio = difflib .SequenceMatcher (None , parent_doc , child_doc ).ratio ()
193
194
if ratio >= self .__similarity_ratio :
Original file line number Diff line number Diff line change 41
41
from itertools import pairwise
42
42
else : # pragma: <3.10 cover
43
43
# See https://docs.python.org/3/library/itertools.html#itertools.pairwise
44
- def pairwise (iterable ):
44
+ def pairwise (iterable ): # noqa: D103
45
45
a , b = tee (iterable )
46
46
next (b , None )
47
47
return zip (a , b )
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ class DummyParser(BaseDocstringParser):
98
98
}
99
99
100
100
101
- @pytest .fixture ()
101
+ @pytest .fixture
102
102
def patch_class ():
103
103
"""Monkey patch BaseDocstringInheritor with docstring parser constants."""
104
104
BaseDocstringInheritor ._DOCSTRING_PARSER = DummyParser
You can’t perform that action at this time.
0 commit comments