Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split ruff into multiple subcommands #455

Closed
charliermarsh opened this issue Oct 18, 2022 · 2 comments · Fixed by #2190
Closed

Split ruff into multiple subcommands #455

charliermarsh opened this issue Oct 18, 2022 · 2 comments · Fixed by #2190
Labels
breaking Breaking API change cli Related to the command-line interface

Comments

@charliermarsh
Copy link
Member

We could already support ruff format or ruff fmt or ruff rtrip (in Astor parlance). Soon there will be more tools and sub-commands, e.g., #423.

A few open questions:

  • Do we want to move the core linting functionality to ruff check? Or leave it as a "default" sub-command? (I think the latter can cause a variety of ambiguities but it'd be nice to do something backwards compatible here.)
  • Do we want to expose a dedicated ruff fix command in lieu of or in addition to --fix? Perhaps ruff fix applies fixes recursively.
@charliermarsh charliermarsh added this to the Release 0.1.0 milestone Nov 2, 2022
@charliermarsh charliermarsh added the breaking Breaking API change label Nov 3, 2022
@thejcannon
Copy link
Contributor

Taking this a smidge further: one distinction I introduced to Pants is the distinction between fmt and fix. The former is safe to do on save, the latter isn't. The razor is something like removing imports. Not safe to do on save (as I'm still typing code and I save very often) but is safe to do in fix, which I'll issue manually.

We also have fix imply fmt, so users could decide which behavior they care about.

@not-my-profile
Copy link
Contributor

@thejcannon Thanks, that's a very interesting idea! I think the relevant issue is rule applicability (#1997).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking API change cli Related to the command-line interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants