Skip to content

Commit

Permalink
docs: adjust descriptions of parameters and results to styleguide (#132)
Browse files Browse the repository at this point in the history
Closes #58

### Summary of Changes

Remove types of parameters and results in docstrings. This easily lead
to inconsistencies.
  • Loading branch information
lars-reimann authored May 4, 2024
1 parent 4408c84 commit 5f57bae
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/safeds_stubgen/api_analyzer/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def ensure_file_exists(file: Path) -> None:
Parameters
----------
file: Path
file:
The file path.
"""
file.parent.mkdir(parents=True, exist_ok=True)
Expand Down
12 changes: 6 additions & 6 deletions src/safeds_stubgen/api_analyzer/_ast_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,16 +551,16 @@ def _create_inferred_results(
Paramters
---------
ret_type : sds_types.TupleType
ret_type:
An object representing a tuple with all inferred types.
result_docstring : ResultDocstring
result_docstring:
The docstring of the function to which the results belong to.
function_id : str
function_id:
The function ID.
Returns
-------
list[Result]
results:
A list of Results objects representing the possible results of a funtion.
"""
result_array: list[list[AbstractType]] = []
Expand Down Expand Up @@ -1124,12 +1124,12 @@ def _create_id_from_stack(self, name: str) -> str:
Paramters
---------
name : str
name:
The name of the new object which lies on the highest level.
Returns
-------
str
id:
ID of the object
"""
segments = [
Expand Down
6 changes: 3 additions & 3 deletions src/safeds_stubgen/api_analyzer/cli/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ def _run_stub_generator(
Parameters
----------
out_dir_path : Path
out_dir_path:
The path to the output directory.
docstring_style : DocstringStyle
docstring_style:
The style of docstrings that used in the library.
is_test_run : bool
is_test_run:
Set True if files in test directories should be parsed too.
"""
# Generate the API data
Expand Down
11 changes: 6 additions & 5 deletions src/safeds_stubgen/stubs_generator/_generate_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ def generate_stub_data(
Parameters
----------
stubs_generator
stubs_generator:
The class for generating the stubs.
out_path
out_path:
The path in which the stub files should be created. If no such path exists this function creates the directory
files.
Returns
-------
A list of tuples, which are 1. the path of the stub file, 2. the name of the stub file, 3. its content and 4. if
it's a package file (created through init reexports).
virtual_files:
A list of tuples, which are 1. the path of the stub file, 2. the name of the stub file, 3. its content and 4. if
it's a package file (created through init reexports).
"""
api = stubs_generator.api
stubs_data: list[tuple[Path, str, str, bool]] = []
Expand Down Expand Up @@ -1119,7 +1120,7 @@ def _add_to_imports(self, import_qname: str) -> None:
Paramters
---------
qname
qname:
The qualified name of a module/class/etc.
"""
if import_qname == "": # pragma: no cover
Expand Down

0 comments on commit 5f57bae

Please sign in to comment.