(self)
| 289 | return findings |
| 290 | |
| 291 | def check_yaml_syntax(self) -> list[Finding]: |
| 292 | if yaml is None: |
| 293 | return [ |
| 294 | Finding( |
| 295 | "yaml-syntax", |
| 296 | Path("tools/requirements.txt"), |
| 297 | "PyYAML is required for YAML validation; run pip install -r tools/requirements.txt", |
| 298 | ), |
| 299 | ] |
| 300 | findings: list[Finding] = [] |
| 301 | for path in self.git_files("*.yaml", "*.yml"): |
| 302 | full_path = self.repo_root / path |
| 303 | if not full_path.is_file() or is_templated_yaml(path): |
| 304 | continue |
| 305 | try: |
| 306 | text = full_path.read_text(encoding="utf-8") |
| 307 | list(yaml.load_all(text, Loader=IgnoreUnknownTagsLoader)) |
| 308 | except Exception as exc: |
| 309 | findings.append(Finding("yaml-syntax", path, str(exc).splitlines()[0])) |
| 310 | return findings |
| 311 | |
| 312 | def check_shell_syntax(self) -> list[Finding]: |
| 313 | findings: list[Finding] = [] |
no test coverage detected