Skip to content

Add --no-apply option to formatter commands with side effects#1764

Merged
nathanjmcdougall merged 2 commits into
mainfrom
copilot/add-no-apply-option-formatter-commands
Apr 2, 2026
Merged

Add --no-apply option to formatter commands with side effects#1764
nathanjmcdougall merged 2 commits into
mainfrom
copilot/add-no-apply-option-formatter-commands

Conversation

Copilot AI commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

usethis format, usethis tool ruff, and usethis tool pyproject-fmt run formatters as a side effect when adding them. This adds a --no-apply flag to skip that step.

usethis tool ruff --no-apply      # configures ruff without running `ruff format`
usethis tool pyproject-fmt --no-apply  # configures pyproject-fmt without running it
usethis format --no-apply         # adds both formatters without running either

Changes

  • _ui/options.py — New no_apply_opt Typer option
  • _core/tool.pyno_apply param on use_ruff() and use_pyproject_fmt(), guarding tool.apply() calls
  • _toolset/format_.pyno_apply param on use_formatters(), forwarded to both tool functions
  • _ui/interface/format_.py, _ui/interface/tool.py — Wire --no-apply into the three CLI commands
  • Tests — Core-level and CLI-level tests for all three commands verifying the formatter is skipped

Copilot AI changed the title [WIP] Add --no-apply option to formatter commands with side effects Add --no-apply option to formatter commands with side effects Apr 2, 2026
Copilot AI requested a review from nathanjmcdougall April 2, 2026 02:21
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review April 2, 2026 21:19
@codspeed-hq

codspeed-hq Bot commented Apr 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/add-no-apply-option-formatter-commands (b42a72d) with main (6db241a)

Open in CodSpeed

@codecov

codecov Bot commented Apr 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@nathanjmcdougall nathanjmcdougall merged commit f84d89d into main Apr 2, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/add-no-apply-option-formatter-commands branch April 2, 2026 21:41
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.

Add a --no-apply option to formatter commands with side effects

2 participants