Docstring Updater¶
remove_docstrings(code)
¶
update_doc(node, new_docstring)
¶
Replaces the docstring of a given AST node with new content, handling indentation to maintain code structure. If no docstring exists, it adds one; otherwise, it updates the existing one.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node
|
The AST node to update. |
required | |
new_docstring
|
The new docstring content. |
required |
Returns:
Type | Description |
---|---|
The updated AST node. |