src.utils.docstring_validation

Module Contents

src.utils.docstring_validation.logger
src.utils.docstring_validation.analyse_docstring_in_blocks(code_blocks: list, file_name: str = 'unknown', file_path: str = 'unknown', language: str | None = None, suggested_file: str | None = None, model: str | None = None, existing_suggestions: dict | None = None) dict

Analyses code blocks to find docstring and identify missing ones. Supports multiple programming languages including Python, JavaScript/TypeScript and MATLAB.

Parameters:
  • code_blocks (list) – List of code blocks extracted from a file

  • file_name (str) – Name of the file being analysed

  • language (str) – Programming language of the code blocks

Returns:

Analysis results with docstring information

Return type:

dict

src.utils.docstring_validation.analyse_docstring_in_module(content: str, language: str | None = None) str | None

Extract module-level docstring from file content.

Parameters:
  • content (str) – The file content

  • language (str) – The programming language

Returns:

The module docstring if found, None otherwise

Return type:

str or None