(paths: list[str])
| 37 | |
| 38 | |
| 39 | def ruff_json(paths: list[str]) -> list[dict]: |
| 40 | proc = run(["ruff", "check", *paths, "--output-format=json", "--exit-zero"], check=False) |
| 41 | try: |
| 42 | data = json.loads(proc.stdout or "[]") |
| 43 | except json.JSONDecodeError as e: |
| 44 | raise SystemExit(f"Could not parse Ruff JSON: {e}") from e |
| 45 | if not isinstance(data, list): |
| 46 | raise SystemExit("Unexpected Ruff JSON output") |
| 47 | return data |
| 48 | |
| 49 | |
| 50 | def unique_e501_files(paths: list[str]) -> list[str]: |
no test coverage detected