MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / _check_rust_linting

Method _check_rust_linting

scripts/validation-runner.py:106–121  ·  view source on GitHub ↗

Check Rust code with clippy.

(self)

Source from the content-addressed store, hash-verified

104 return False, "", str(e)
105
106 def _check_rust_linting(self) -> Tuple[bool, str, Optional[str]]:
107 """Check Rust code with clippy."""
108 try:
109 cargo_path = shutil.which("cargo")
110 if not cargo_path:
111 raise FileNotFoundError("cargo executable not found in PATH")
112 result = subprocess.run(
113 [cargo_path, "clippy", "--workspace", "--all-targets", "--all-features", "--", "-D", "warnings"], capture_output=True, text=True, cwd=self.root_path, timeout=300, shell=False
114 ) # nosec
115
116 return result.returncode == 0, result.stdout, result.stderr if result.returncode != 0 else None
117
118 except subprocess.TimeoutExpired:
119 return False, "", "Rust clippy check timed out"
120 except Exception as e:
121 return False, "", str(e)
122
123 def _check_python_formatting(self) -> Tuple[bool, str, Optional[str]]:
124 """Check Python code formatting."""

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected