MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / run_ruff

Function run_ruff

tools/ruff_report.py:44–54  ·  view source on GitHub ↗
(paths: Iterable[str])

Source from the content-addressed store, hash-verified

42
43
44def run_ruff(paths: Iterable[str]) -> list[dict]:
45 cmd = [sys.executable, "-m", "ruff", "check", *paths, "--output-format=json", "--exit-zero"]
46 proc = subprocess.run(cmd, capture_output=True, text=True)
47 if proc.returncode not in (0, 1):
48 print(proc.stdout)
49 print(proc.stderr, file=sys.stderr)
50 raise SystemExit(f"Failed to run Ruff: {' '.join(cmd)}")
51 data = json.loads(proc.stdout or "[]")
52 if not isinstance(data, list):
53 raise SystemExit("Unexpected Ruff JSON output")
54 return data
55
56
57def relpath(path: str) -> str:

Callers 1

mainFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected