Skip to content

Combine CLI format and isort #8087

Closed as not planned
Closed as not planned

Description

@Joe-Zer0

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!

Activity

  1. charliermarsh commented on Oct 20, 2023

    @charliermarsh
    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?

  2. skewty commented on Oct 26, 2023

    @skewty

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

  3. zanieb commented on Oct 26, 2023

    @zanieb
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions