bugbug
bugbug copied to clipboard
Add docstrings to functions in `bugbug/bugzilla.py`
Adding Args
and Returns
should follow Google Style Python Docstrings. The docstrings should not include type annotations; these types should be added to the function itself.
@suhaibmujahid I would like to work on this issue!
def get_ids(params: dict) -> List[int]:
"""
Retrieves a list of bug IDs from Bugzilla based on the given parameters.
Args:
params (dict): A dictionary of parameters to pass to the Bugzilla API.
Returns:
list of int: A list of bug IDs.
Raises:
None
"""
assert "include_fields" not in params or params["include_fields"] == "id"
old_CHUNK_SIZE = Bugzilla.BUGZILLA_CHUNK_SIZE
try:
Bugzilla.BUGZILLA_CHUNK_SIZE = 7000
all_ids = []
def bughandler(bug):
all_ids.append(bug["id"])
params["include_fields"] = "id"
Bugzilla(params, bughandler=bughandler).get_data().wait()
finally:
Bugzilla.BUGZILLA_CHUNK_SIZE = old_CHUNK_SIZE
return all_ids
This is an example for get_ids function, @suhaibmujahid I'm I on track with this?
@suhaibmujahid I would like to work on this issue!
@Karnankita04 Anyone can work on any issue as long as it is not linked to an open pull request.
It's always good to have descriptive and informative docstrings ...
@fadebowaley Please do not post auto-generated content in this project
This is an example for get_ids function, @suhaibmujahid I'm I on track with this?
@skynette It will be more efficient to give feedback on code in a PR than here in the issue. Here some notes:
- See in the issue description: "docstrings should not include type annotations"
- You do not need to include
Raises
if the function is not raising specific exceptions - The comment should start right after
"""
okay noted, will make a PR soon
@suhaibmujahid @Karnankita04 I apologise if my content was misleading. Thank you for further explanation on Docstring and type annotations