Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ruff/src/ruff/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ async def fix(
output = await result.combined_output()
if output.strip():
sys.stderr.write(output)
exit_code = await result.exit_code()
if exit_code not in (0, 1):
raise RuntimeError(
f"`ruff check --fix` failed with exit code {exit_code}: "
"ruff reported an error (configuration, usage, or runtime). "
"See stderr above for ruff's output."
)
before = dag.directory().with_directory(".", source)
fixed = result.directory("/work").without_directory(".ruff_cache")
after = dag.directory().with_directory(".", fixed)
Expand Down
7 changes: 7 additions & 0 deletions ruff/src/ruff/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ async def fix(
output = await result.combined_output()
if output.strip():
sys.stderr.write(output)
exit_code = await result.exit_code()
if exit_code not in (0, 1):
raise RuntimeError(
f"`ruff format` failed with exit code {exit_code}: "
"ruff reported an error (configuration, usage, or runtime). "
"See stderr above for ruff's output."
)
before = dag.directory().with_directory(".", source)
fixed = result.directory("/work").without_directory(".ruff_cache")
after = dag.directory().with_directory(".", fixed)
Expand Down
Loading