MCPcopy
hub / github.com/wshobson/agents / _needs_yaml_quoting

Function _needs_yaml_quoting

tools/adapters/copilot.py:20–31  ·  view source on GitHub ↗

Check if a string value needs YAML quoting to prevent type coercion.

(value: str)

Source from the content-addressed store, hash-verified

18
19
20def _needs_yaml_quoting(value: str) -> bool:
21 """Check if a string value needs YAML quoting to prevent type coercion."""
22 return bool(re.match(r"^\d+(\.\d+)?$", value)) or value.lower() in (
23 "true",
24 "false",
25 "yes",
26 "no",
27 "on",
28 "off",
29 "null",
30 "~",
31 )
32
33
34def _copilot_frontmatter(fm: dict) -> str:

Callers 2

test_yaml_quotingMethod · 0.90
_copilot_frontmatterFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_yaml_quotingMethod · 0.72