MCPcopy Create free account
hub / github.com/DevCloudNinjas/DevOps-Projects / check_shell_syntax

Method check_shell_syntax

tools/quality_gate.py:312–327  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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] = []

Callers 1

check_syntaxMethod · 0.95

Calls 3

git_filesMethod · 0.95
FindingClass · 0.70
runMethod · 0.45

Tested by

no test coverage detected