(self)
| 310 | return findings |
| 311 | |
| 312 | def check_shell_syntax(self) -> list[Finding]: |
| 313 | findings: list[Finding] = [] |
| 314 | for path in self.git_files("*.sh"): |
| 315 | full_path = self.repo_root / path |
| 316 | if not full_path.is_file() or path in KNOWN_NON_SHELL_SCRIPTS: |
| 317 | continue |
| 318 | result = subprocess.run( |
| 319 | ["bash", "-n", str(full_path)], |
| 320 | cwd=self.repo_root, |
| 321 | capture_output=True, |
| 322 | text=True, |
| 323 | ) |
| 324 | if result.returncode: |
| 325 | message = (result.stderr or result.stdout).strip().splitlines()[0] |
| 326 | findings.append(Finding("shell-syntax", path, message)) |
| 327 | return findings |
| 328 | |
| 329 | def check_python_syntax(self) -> list[Finding]: |
| 330 | findings: list[Finding] = [] |
no test coverage detected