Skip to content

Commit

Permalink
refactor: Swallow kwargs in all parsers constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Sep 7, 2024
1 parent 29559e8 commit fe8e96f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pytkdocs/parsers/docstrings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Parser(metaclass=ABCMeta):
It also return the list of errors that occurred during parsing.
"""

def __init__(self) -> None:
def __init__(self, **kwargs: Any) -> None: # noqa: ARG002
"""Initialize the object."""
self.context: dict = {}
self.errors: List[str] = []
Expand Down
2 changes: 1 addition & 1 deletion src/pytkdocs/parsers/docstrings/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
class Google(Parser):
"""A Google-style docstrings parser."""

def __init__(self, replace_admonitions: bool = True, trim_doctest_flags: bool = True) -> None: # noqa: FBT001, FBT002
def __init__(self, replace_admonitions: bool = True, trim_doctest_flags: bool = True, **kwargs: Any) -> None: # noqa: FBT001, FBT002, ARG002
"""Initialize the object.
Arguments:
Expand Down
4 changes: 2 additions & 2 deletions src/pytkdocs/parsers/docstrings/numpy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""This module defines functions and classes to parse docstrings into structured data."""

import re
from typing import List, Optional, Pattern
from typing import Any, List, Optional, Pattern

from docstring_parser import parse
from docstring_parser.common import Docstring, DocstringMeta
Expand All @@ -17,7 +17,7 @@
class Numpy(Parser):
"""A Numpy-style docstrings parser."""

def __init__(self, trim_doctest_flags: bool = True) -> None: # noqa: FBT001, FBT002
def __init__(self, trim_doctest_flags: bool = True, **kwargs: Any) -> None: # noqa: FBT001, FBT002, ARG002
"""Initialize the objects.
Arguments:
Expand Down
2 changes: 1 addition & 1 deletion src/pytkdocs/parsers/docstrings/restructured_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ParsedValues:
class RestructuredText(Parser):
"""A reStructuredText docstrings parser."""

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

0 comments on commit fe8e96f

Please sign in to comment.