(code)
| 94 | |
| 95 | |
| 96 | def run_ruff(code): |
| 97 | command = ["ruff", "format", "-", "--config", "pyproject.toml", "--silent"] |
| 98 | process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) |
| 99 | stdout, _ = process.communicate(input=code.encode()) |
| 100 | return stdout.decode() |
| 101 | |
| 102 | |
| 103 | def stylify(code: str) -> str: |