Skip to content

fix(ruff): propagate fix execution failures - #102

Open
Kewe63 wants to merge 2 commits into
typesafe-ai:mainfrom
Kewe63:fix/ruff-fix-exit
Open

Kewe63 wants to merge 2 commits into
typesafe-ai:mainfrom
Kewe63:fix/ruff-fix-exit

Conversation

@Kewe63

@Kewe63 Kewe63 commented Sep 19, 2026 •

Copy link
Copy Markdown

Fixes #99

Functional change

RuffChecker.fix and RuffFormatter.fix previously accepted any Ruff process exit status. As a result, usage errors, invalid configuration, and runtime failures could be reported as successful Changeset results.

This change restores fail-closed execution for both fix operations.

Behavior preserved

  • RuffChecker.fix still returns a Changeset when fixes are applied but ordinary lint violations remain.
  • Remaining checker diagnostics are kept non-fatal through Ruff's --exit-zero option.
  • Successful formatter and checker executions continue to return Changesets.
  • Invalid arguments, configuration errors, and Ruff runtime failures now propagate as execution failures.

Implementation

  • Remove expect=dagger.ReturnType.ANY from checker and formatter execution.
  • Add --exit-zero only to ruff check --fix.
  • Keep the formatter's default exit-code behavior unchanged.

Verification

  • PYTHONPATH=ruff/src pytest -q ruff/tests — 37 passed after merging current main
  • ruff check ruff/src ruff/tests — passed
  • ruff format --check ruff/src ruff/tests — passed
  • Unfixable checker findings with --exit-zero return exit 0
  • Invalid checker and formatter arguments return exit 2

@danielgafni

Copy link
Copy Markdown
Contributor

Sorry I was mass-closing PRs!

Please rewrite the PR description to address the functional change.

@danielgafni danielgafni reopened this Sep 25, 2026
@Kewe63

Kewe63 commented Sep 25, 2026

Copy link
Copy Markdown
Author

Updated the PR description to explicitly document the functional change and preserved behavior. I also merged the latest main; all CI checks are passing now.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ruff fix functions return successful Changesets after Ruff exits with a usage error

2 participants