(cmd: list[str], check: bool = True)
| 25 | |
| 26 | |
| 27 | def run(cmd: list[str], check: bool = True) -> subprocess.CompletedProcess: |
| 28 | print("+", " ".join(cmd)) |
| 29 | proc = subprocess.run(cmd, text=True, capture_output=True) |
| 30 | if proc.stdout: |
| 31 | print(proc.stdout) |
| 32 | if proc.stderr: |
| 33 | print(proc.stderr, file=sys.stderr) |
| 34 | if check and proc.returncode != 0: |
| 35 | raise SystemExit(proc.returncode) |
| 36 | return proc |
| 37 | |
| 38 | |
| 39 | def ruff_json(paths: list[str]) -> list[dict]: |