MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / _strip_yaml_comment

Function _strip_yaml_comment

scripts/common.py:1196–1206  ·  view source on GitHub ↗
(line: str)

Source from the content-addressed store, hash-verified

1194
1195
1196def _strip_yaml_comment(line: str) -> str:
1197 in_single = False
1198 in_double = False
1199 for index, char in enumerate(line):
1200 if char == "'" and not in_double:
1201 in_single = not in_single
1202 elif char == '"' and not in_single:
1203 in_double = not in_double
1204 elif char == "#" and not in_single and not in_double:
1205 return line[:index]
1206 return line
1207
1208
1209def _parse_yaml_scalar(value: str) -> str:

Callers 1

_parse_domain_rules_yamlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected