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

Method _check_rust_formatting

scripts/validation-runner.py:91–104  ·  view source on GitHub ↗

Check Rust code formatting.

(self)

Source from the content-addressed store, hash-verified

89 return all_passed
90
91 def _check_rust_formatting(self) -> Tuple[bool, str, Optional[str]]:
92 """Check Rust code formatting."""
93 try:
94 cargo_path = shutil.which("cargo")
95 if not cargo_path:
96 raise FileNotFoundError("cargo executable not found in PATH")
97 result = subprocess.run([cargo_path, "fmt", "--all", "--", "--check"], capture_output=True, text=True, cwd=self.root_path, timeout=120, shell=False) # nosec
98
99 return result.returncode == 0, result.stdout, result.stderr if result.returncode != 0 else None
100
101 except subprocess.TimeoutExpired:
102 return False, "", "Rust formatting check timed out"
103 except Exception as e:
104 return False, "", str(e)
105
106 def _check_rust_linting(self) -> Tuple[bool, str, Optional[str]]:
107 """Check Rust code with clippy."""

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected