Skip to content

Commit

Permalink
fix: Removed the Epydoc parser (#89)
Browse files Browse the repository at this point in the history
### Summary of Changes
I removed everything concerning the epydoc parser.

---------

Co-authored-by: Lars Reimann <[email protected]>
  • Loading branch information
Masara and lars-reimann authored Mar 30, 2024
1 parent 81b9b1d commit 684a101
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 1,019 deletions.
2 changes: 0 additions & 2 deletions src/safeds_stubgen/docstring_parsing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from ._create_docstring_parser import create_docstring_parser
from ._docstring import AttributeDocstring, ClassDocstring, FunctionDocstring, ParameterDocstring, ResultDocstring
from ._docstring_style import DocstringStyle
from ._epydoc_parser import EpydocParser
from ._googledoc_parser import GoogleDocParser
from ._numpydoc_parser import NumpyDocParser
from ._plaintext_docstring_parser import PlaintextDocstringParser
Expand All @@ -16,7 +15,6 @@
"ClassDocstring",
"create_docstring_parser",
"DocstringStyle",
"EpydocParser",
"FunctionDocstring",
"GoogleDocParser",
"NumpyDocParser",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import TYPE_CHECKING

from ._docstring_style import DocstringStyle
from ._epydoc_parser import EpydocParser
from ._googledoc_parser import GoogleDocParser
from ._numpydoc_parser import NumpyDocParser
from ._plaintext_docstring_parser import PlaintextDocstringParser
Expand All @@ -14,9 +13,7 @@


def create_docstring_parser(style: DocstringStyle) -> AbstractDocstringParser:
if style == DocstringStyle.EPYDOC:
return EpydocParser()
elif style == DocstringStyle.GOOGLE:
if style == DocstringStyle.GOOGLE:
return GoogleDocParser()
elif style == DocstringStyle.NUMPYDOC:
return NumpyDocParser()
Expand Down
1 change: 0 additions & 1 deletion src/safeds_stubgen/docstring_parsing/_docstring_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
class DocstringStyle(Enum):
# AUTO = "auto",
PLAINTEXT = "plaintext"
EPYDOC = "epydoc"
GOOGLE = "google"
NUMPYDOC = "numpydoc"
REST = "rest"
Expand Down
123 changes: 0 additions & 123 deletions src/safeds_stubgen/docstring_parsing/_epydoc_parser.py

This file was deleted.

5 changes: 1 addition & 4 deletions src/safeds_stubgen/stubs_generator/_generate_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def _create_type_string(self, type_data: dict | None) -> str:
case _:
self._add_to_imports(type_data["qname"])

# inner classes that are private should not be used as types, therefore we add a todo
# inner classes that are private should not be used as types, therefore we add a TODO
if name[0] == "_" and type_data["qname"] not in self.module_imports:
self._current_todo_msgs.add("internal class as type")

Expand Down Expand Up @@ -937,9 +937,6 @@ def _module_name_check(name: str, string: str) -> bool:
if shortest_id is None or len(fixed_module_id_parts) < len(shortest_id):
shortest_id = fixed_module_id_parts

if len(shortest_id) == 1:
break

if shortest_id is None:
return module_qname
return ".".join(shortest_id)
Expand Down
159 changes: 0 additions & 159 deletions tests/data/docstring_parser_package/epydoc.py

This file was deleted.

30 changes: 0 additions & 30 deletions tests/data/various_modules_package/docstring_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,6 @@
"""


class EpydocDocstringClass:
"""
A class with a variety of different methods for calculations. (Epydoc).
@ivar attr_1: Attribute of the calculator. (Epydoc)
@type attr_1: str
@param param_1: Parameter of the calculator. (Epydoc)
@type param_1: str
"""

attr_1: str

def __init__(self, param_1: str):
pass

def epydoc_docstring_func(self, x: int, y: int) -> bool:
"""
This function checks if the sum of x and y is less than the value 10 and returns True if it is. (Epydoc).
@param x: First integer value for the calculation. (Epydoc)
@type x: int
@param y: Second integer value for the calculation. (Epydoc)
@type y: int
@return: Checks if the sum of x and y is greater than 10. (Epydoc)
@rtype: bool
"""
z = x + y
return z < 10


class RestDocstringClass:
"""
A class with a variety of different methods for calculations. (ReST).
Expand Down
Loading

0 comments on commit 684a101

Please sign in to comment.