src.services.docstring_pr_services

Module Contents

src.services.docstring_pr_services.logger
src.services.docstring_pr_services.DocstringNode
class src.services.docstring_pr_services.DocstringInsertion

A class representing a code insertion point with metadata.

Parameters:
  • name (str) – The name of the insertion.

  • kind (str) – The type of insertion.

  • line_number (int) – The line number for insertion.

  • insert_index (int) – The index for insertion within the line.

  • indent (str) – The indentation level for the insertion.

  • code (str) – The code to be inserted.

Returns:

None

name: str
kind: str
line_number: int
insert_index: int
indent: str
code: str
class src.services.docstring_pr_services.PatchedPythonFile

Represents a Python file with content and docstring insertions.

Args:

content (str): The source code of the Python file. inserted (List[DocstringInsertion]): A list of docstring insertions.

Returns:

None

content: str
inserted: List[DocstringInsertion]
exception src.services.docstring_pr_services.DocstringPullRequestError

Bases: RuntimeError

Raised when creating a docstring suggestion pull request fails.

src.services.docstring_pr_services.patch_python_docstrings(content: str, generator: Callable[[DocstringInsertion], str | None], max_docstrings: int = 50) PatchedPythonFile

Inserts generated docstrings into Python code using AST-derived insertion points.

src.services.docstring_pr_services.create_python_docstring_pull_request(provider: str, repo_url: str, token: str, base_branch: str, suggestion_branch: str, title: str, max_docstrings: int = 50) dict

Creates a GitHub pull request with generated Python docstring suggestions.