Skip to content

Commit fe8e96f

Browse files
committed
refactor: Swallow kwargs in all parsers constructors
1 parent 29559e8 commit fe8e96f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Diff for: src/pytkdocs/parsers/docstrings/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class Parser(metaclass=ABCMeta):
134134
It also return the list of errors that occurred during parsing.
135135
"""
136136

137-
def __init__(self) -> None:
137+
def __init__(self, **kwargs: Any) -> None: # noqa: ARG002
138138
"""Initialize the object."""
139139
self.context: dict = {}
140140
self.errors: List[str] = []

Diff for: src/pytkdocs/parsers/docstrings/google.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
class Google(Parser):
3939
"""A Google-style docstrings parser."""
4040

41-
def __init__(self, replace_admonitions: bool = True, trim_doctest_flags: bool = True) -> None: # noqa: FBT001, FBT002
41+
def __init__(self, replace_admonitions: bool = True, trim_doctest_flags: bool = True, **kwargs: Any) -> None: # noqa: FBT001, FBT002, ARG002
4242
"""Initialize the object.
4343
4444
Arguments:

Diff for: src/pytkdocs/parsers/docstrings/numpy.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""This module defines functions and classes to parse docstrings into structured data."""
22

33
import re
4-
from typing import List, Optional, Pattern
4+
from typing import Any, List, Optional, Pattern
55

66
from docstring_parser import parse
77
from docstring_parser.common import Docstring, DocstringMeta
@@ -17,7 +17,7 @@
1717
class Numpy(Parser):
1818
"""A Numpy-style docstrings parser."""
1919

20-
def __init__(self, trim_doctest_flags: bool = True) -> None: # noqa: FBT001, FBT002
20+
def __init__(self, trim_doctest_flags: bool = True, **kwargs: Any) -> None: # noqa: FBT001, FBT002, ARG002
2121
"""Initialize the objects.
2222
2323
Arguments:

Diff for: src/pytkdocs/parsers/docstrings/restructured_text.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ParsedValues:
103103
class RestructuredText(Parser):
104104
"""A reStructuredText docstrings parser."""
105105

106-
def __init__(self) -> None:
106+
def __init__(self, **kwargs: Any) -> None: # noqa: ARG002
107107
"""Initialize the object."""
108108
super().__init__()
109109
self._typed_context = ParseContext({"obj": None})

0 commit comments

Comments
 (0)