scripts/refactor/parsers¶
scripts.refactor.parsers.__init__¶
🧠 Docstring Summary
| Section | Content |
|---|---|
| Description | No module description available. |
| Args | — |
| Returns | — |
scripts.refactor.parsers.docstring_parser¶
🧠 Docstring Summary
| Section | Content |
|---|---|
| Description | Docstring Parser |
| =============================== | |
| This module scans a Python project directory for missing or partial docstrings. | |
| It outputs structured JSON and markdown-style reports with description, args, and return sections. | |
| Also supports generating MkDocs-compatible markdown files. | |
| Args | — |
| Returns | — |
📦 Classes¶
DocstringAnalyzer¶
No description available. Parameters: ['self: Any', 'exclude_dirs: List[str]'] Returns: None
DocstringAuditCLI¶
No description available. Parameters: ['self: Any'] Returns: None
🛠️ Functions¶
split_docstring_sections¶
Split a docstring into its sections: description, args, and returns. Parameters: ['docstring: Optional[str]'] Returns: Dict[str, Optional[str]]
__init__¶
No description available. Parameters: ['self: Any', 'exclude_dirs: List[str]'] Returns: None
should_exclude¶
No description available. Parameters: ['self: Any', 'path: Path'] Returns: bool
_format_args¶
No description available. Parameters: ['self: Any', 'args_node: ast.arguments'] Returns: List[str]
arg_str¶
No description available. Parameters: ['arg: Any'] Returns: Any
_get_return_type¶
No description available. Parameters: ['self: Any', 'func_node: ast.FunctionDef'] Returns: str
_process_function¶
No description available. Parameters: ['self: Any', 'node: ast.FunctionDef'] Returns: Dict[str, Any]
_process_class¶
No description available. Parameters: ['self: Any', 'node: ast.ClassDef'] Returns: Dict[str, Any]
extract_docstrings¶
Extract docstrings, args, and return types from a Python file using AST. Always returns a consistent structure even on parse failure. Parameters: ['self: Any', 'file_path: Path'] Returns: Dict[str, Any]
visit¶
No description available. Parameters: ['node: Any'] Returns: Any
analyze_directory¶
No description available. Parameters: ['self: Any', 'root: Path'] Returns: Dict[str, Dict[str, Any]]
__init__¶
Initialize the command-line interface for the docstring audit. Parameters: ['self: Any'] Returns: None
parse_args¶
Parse command-line arguments. Parameters: ['self: Any'] Returns: argparse.Namespace
run¶
Run the docstring audit. Parameters: ['self: Any'] Returns: None
scripts.refactor.parsers.json_coverage_parser¶
🧠 Docstring Summary
| Section | Content |
|---|---|
| Description | No module description available. |
| Args | — |
| Returns | — |
🛠️ Functions¶
_load_files¶
Return the files section with all keys normalised to POSIX paths.
Parameters:
['json_path: str']
Returns:
Dict[str, Any]
_best_suffix_match¶
Find the file-entry whose tail components best match requested. Returns the matching coverage dict or None if nothing plausible found. Parameters: ['files: Dict[str, Any]', 'requested: str'] Returns: Optional[Dict[str, Any]]
_fully_uncovered¶
Return a coverage dict that marks every method as 0 % covered. Parameters: ['method_ranges: Dict[str, Tuple[int, int]]'] Returns: Dict[str, Any]
_coverage_from_summary¶
Extract coverage %, hits and missing lines list from a summary block. Parameters: ['summary: Dict[str, Any]', 'total: int'] Returns: Tuple[float, int, List[int]]
_coverage_from_executed¶
No description available. Parameters: ['executed: List[int]', 'rng: Tuple[int, int]'] Returns: Tuple[float, int, List[int]]
parse_json_coverage¶
Return per-method coverage data for filepath based on a coverage.py
JSON (v5) report previously converted with coverage json.
Parameters:
['json_path: str', 'method_ranges: Dict[str, Tuple[int, int]]', 'filepath: str']
Returns:
Dict[str, Any]