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

Add option to put pub imports (aka exports) before normal imports #4070

Open
Boscop opened this issue Mar 1, 2020 · 1 comment
Open

Add option to put pub imports (aka exports) before normal imports #4070

Boscop opened this issue Mar 1, 2020 · 1 comment
Labels

Comments

@Boscop
Copy link

Boscop commented Mar 1, 2020

Context: When reorder_imports = true, rustfmt mixes pub imports in with private imports.
Please add an option to put pub imports (aka exports) before normal imports.
IMO it's not idiomatic to mix them in with normal imports because they are also exports and deserve extra attention so I usually put them before normal imports and then leave an empty line between.

@Boscop
Copy link
Author

Boscop commented Mar 17, 2020

Also, I would REALLY appreciate a configuration option to order imports as follows:

pub imports (exports)
imports from std, core, alloc etc. (the built-in crates)
imports from third-party crates
imports from crates of the current workspace
imports from the current crate

With an optional empty line between each group. Can you please add this :)

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

No branches or pull requests

3 participants