Skip to content

fix(format): default ruff to check mode - #3496

Open
nightcityblade wants to merge 1 commit into
rtk-ai:developfrom
nightcityblade:fix/issue-3417
Open

fix(format): default ruff to check mode#3496
nightcityblade wants to merge 1 commit into
rtk-ai:developfrom
nightcityblade:fix/issue-3417

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #3417

Summary

  • Make implicit Ruff formatting default to ruff format --check, matching Black’s read-only behavior.
  • Preserve explicit rtk format ruff format write mode and --diff behavior.

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk <command> output inspected
    • N/A: command construction is covered by test_ruff_defaults_to_check_mode; Ruff execution is not needed for this argument-only change.

Important: All PRs must target the develop branch (not master).
See CONTRIBUTING.md for details.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


nightcityblade seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@HetCreep

HetCreep commented Aug 9, 2026

Copy link
Copy Markdown

Confirmed — built this branch and drove format_cmd::run() directly with fake ruff.bat/black.bat stand-ins that echo their argv:

ruff project, bare `rtk format`         -> format --check .   (was write mode — fixed)
ruff project, `rtk format --diff`       -> format --diff .    (still read-only)
ruff project, `rtk format format`       -> format             (escape hatch preserved)
black project, bare `rtk format`        -> --check .          (unchanged, no regression)

All four match the intended behavior. Thanks for picking this up.

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.

rtk format with no arguments runs ruff format . (in-place rewrite) in a ruff project but black --check . (dry run) in a black project

3 participants