(self, original_node, updated_node)
| 101 | return f"{self.base_namespace}.{name}" if self.base_namespace else name |
| 102 | |
| 103 | def leave_Module(self, original_node, updated_node): |
| 104 | new_body = [] |
| 105 | clone_matcher = m.SimpleStatementLine( |
| 106 | body=[m.Assign(value=m.Call(func=m.Name(value="_clone_signature"))), |
| 107 | m.ZeroOrMore()] |
| 108 | ) |
| 109 | for stmt in updated_node.body: |
| 110 | new_body.append(stmt) |
| 111 | if m.matches(stmt, clone_matcher): |
| 112 | name = stmt.body[0].targets[0].target.value |
| 113 | if self.base_namespace: |
| 114 | name = f"{self.base_namespace}.{name}" |
| 115 | docstring = _get_docstring(name, self.module, 0) |
| 116 | if docstring: |
| 117 | new_body.append(libcst.SimpleStatementLine( |
| 118 | body=[libcst.Expr(value=libcst.SimpleString(docstring))])) |
| 119 | return updated_node.with_changes(body=new_body) |
| 120 | |
| 121 | def visit_ClassDef(self, node): |
| 122 | self.stack.append(node.name.value) |
nothing calls this directly
no test coverage detected