Skip to content

allow user custom group_imports order #4788

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

Open
Sherlock-Holo opened this issue Apr 7, 2021 · 1 comment · May be fixed by #5632
Open

allow user custom group_imports order #4788

Sherlock-Holo opened this issue Apr 7, 2021 · 1 comment · May be fixed by #5632

Comments

@Sherlock-Holo
Copy link

currently, the group_imports option only accepts Preserve and StdExternalCrate. If I want a new order like StdCrateExternal, it need to PR the rustfmt, make it supports this order

consider the group_imports can accept a new value type: string array, like: ["Std", "External", "Crate"], it will allow users custom their project import order, like ["Std", "Crate", "External"]

@calebcartwright
Copy link
Member

Thanks for reaching out with your suggestion. This has been brought up before, but I'm still not convinced it's a particularly viable path to begin with.

If anyone feels strongly enough about this and is willing to come up with a PR that deals with both the complexity of open ended free form user entry and mapping/transforming that's generalized to support sorting that free form (or adding the logic to handle all the variant combinations) then I'll certainly review and consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants