src.services.doc_services
Module Contents
- exception src.services.doc_services.RepoAnalysisError(message: str, status_code: int = 422)
Bases:
RuntimeErrorRaised when repository analysis cannot proceed or yields no usable files.
- status_code = 422
- src.services.doc_services.analyse_repo(provider, repo_url, token, branch, target_folders=None, model=None, reuse_doc=False)
Analyse a repository for source files missing docstring.
- Description:
This function fetches the repository tree, detects the tech stack, and checks each file for missing or present docstring. It returns lists of files and items missing docstring and those with docstring.
- Parameters:
provider (str) – The git provider name (e.g., ‘github’, ‘gitlab’).
repo_url (str) – The URL of the repository.
token (str) – The authentication token for accessing the repository.
branch (str) – The branch name to Analyse.
target_folders (list[str] | None) – Optional repository folders to limit analysis to.
model (str | None) – Optional AI model override for generated docstrings.
reuse_doc (bool) – When True, reuse cached docstring suggestions from the most recent prior run instead of regenerating them.
- Returns:
files_missing_docstring (list): List of dicts for files/items missing docstring.
file_present_docstring (list): List of dicts for files/items with docstring.
- Return type:
tuple