Expand template variables
(self, text: str)
| 250 | return parsed_steps |
| 251 | |
| 252 | def _expand_template(self, text: str) -> str: |
| 253 | """Expand template variables""" |
| 254 | if not isinstance(text, str): |
| 255 | return str(text) |
| 256 | |
| 257 | # Replace {{variable}} format variables |
| 258 | def replace_template_var(match): |
| 259 | var_name = match.group(1) |
| 260 | value = self.context.get(var_name, f"{{{{{var_name}}}}}") |
| 261 | return str(value) # Ensure a string is returned |
| 262 | |
| 263 | # Replace template variables |
| 264 | text = re.sub(r"\{\{([^}]+)\}\}", replace_template_var, text) |
| 265 | |
| 266 | return text |
| 267 | |
| 268 | def validate_yaml_syntax(self, file_path: str) -> tuple[bool, str]: |
| 269 | """Validate YAML syntax""" |
no outgoing calls
no test coverage detected