Check if a string value needs YAML quoting to prevent type coercion.
(value: str)
| 18 | |
| 19 | |
| 20 | def _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 | |
| 34 | def _copilot_frontmatter(fm: dict) -> str: |
no outgoing calls