r"""Produce a PEP 257-compliant docstring block with a trailing newline. Single-line output: \"\"\"text.\"\"\"\n Multi-line output: \"\"\" First line. Continuation. \"\"\" The opening and closing t
(text: str, indent_width: int)
| 87 | |
| 88 | |
| 89 | def _emit_docstring(text: str, indent_width: int) -> str: |
| 90 | r"""Produce a PEP 257-compliant docstring block with a trailing newline. |
| 91 | |
| 92 | Single-line output: <indent>\"\"\"text.\"\"\"\n |
| 93 | Multi-line output: |
| 94 | <indent>\"\"\" |
| 95 | <indent>First line. |
| 96 | <indent> |
| 97 | <indent>Continuation. |
| 98 | <indent>\"\"\" |
| 99 | The opening and closing triple-quotes each occupy their own line for |
| 100 | multi-line strings so that inspect.getdoc() / Sphinx dedent cleanly. |
| 101 | """ |
| 102 | prefix = " " * indent_width |
| 103 | stripped = text.strip() |
| 104 | lines = stripped.splitlines() |
| 105 | if len(lines) <= 1: |
| 106 | return f'{prefix}"""{stripped}"""\n' |
| 107 | content = "\n".join(f"{prefix}{line}" if line.strip() else "" for line in lines) |
| 108 | return f'{prefix}"""\n{content}\n{prefix}"""\n' |
| 109 | |
| 110 | |
| 111 | def load_enhancements_manifest(manifest_path: str | None) -> dict[str, Any]: |
no outgoing calls
no test coverage detected