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

Combine CLI format and isort #8087

Closed
Joe-Zer0 opened this issue Oct 20, 2023 · 3 comments
Closed

Combine CLI format and isort #8087

Joe-Zer0 opened this issue Oct 20, 2023 · 3 comments

Comments

@Joe-Zer0
Copy link

Apologies if I just missed this in the documentation. I would like to propose combining the formatting and import formatting capabilities into a single CLI command. The motivation for this request is so that I may use the ruff formatter with the helix editor.

From what I understand I currently must run ruff --select I --fix <file> then ruff format --line-length 120 --quiet to format both the file and the imports. If these were combined into a single command, I could easily hook this into the helix editor. In an ideal world there would also be a way to specify quote-style = "single" via the command to match personal preference. Thanks!

@charliermarsh
Copy link
Member

We plan to enable a unified workflow to run the linter and formatter in a single command, but we're still working out the design. @MichaReiser, do you know if there's an existing issue we could merge this into?

@skewty
Copy link

skewty commented Oct 26, 2023

I was about to report this as a bug. To me the "isort" action should be done when I use the format command.

@zanieb
Copy link
Member

zanieb commented Oct 26, 2023

We've explicitly chosen not to include import sorting in formatting because it can change the semantics of your code at runtime which the formatter should never do.

Regardless, per #8232 we intend to introduce a unified command that should suffice for this use-case. We'll track this there for book-keeping.

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

No branches or pull requests

4 participants