MCPcopy Create free account
hub / github.com/catid/supercharger / comment_multiline_string

Function comment_multiline_string

codegen/codegen.py:15–26  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

13logging.basicConfig(level=logging.INFO)
14
15def comment_multiline_string(s: str) -> str:
16 lines = s.split("\n")
17 commented_lines = []
18 for line in lines:
19 stripped_line = line.lstrip()
20 whitespace = line[:len(line) - len(stripped_line)]
21 if stripped_line and not stripped_line.startswith("#"):
22 commented_line = whitespace + "# " + stripped_line
23 else:
24 commented_line = line
25 commented_lines.append(commented_line)
26 return "\n".join(commented_lines)
27
28def ensure_colon_at_end(prototype: str) -> str:
29 if not prototype.endswith(':'):

Callers 1

codegen.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected