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

Define a formater to sort imports (isort-like) #1

Open
jimenezrick opened this issue Jun 12, 2024 · 0 comments
Open

Define a formater to sort imports (isort-like) #1

jimenezrick opened this issue Jun 12, 2024 · 0 comments

Comments

@jimenezrick
Copy link

It's a bit counterintuitive but ruff by default doesn't sort imports (as explained in astral-sh/ruff#8367). Could we add a second formatter doing it as documented? The user would simply need to add a second hook to trigger it:

(reformatter-define ruff-isort
    :program ruff-format-command
    :args (list "check" "--select" "I" "--fix" "--stdin-filename" (or (buffer-file-name) input-file))
    :lighter " RuffIsort"
    :group 'ruff-format)

Thanks!

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

1 participant