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 an unnest_imports option to break apart nested import groups. #4598

Closed
wants to merge 4 commits into from

Conversation

goffrie
Copy link
Contributor

@goffrie goffrie commented Dec 16, 2020

This option breaks any nested imports containing a :: out of their import group to a new top-level use item, effectively desugaring the nested import feature added in Rust 1.25. This allows enforcing coding styles that don't allow the use of that feature, and also makes the merge_imports option useful in that case.

@calebcartwright
Copy link
Member

Thank you for the PR. However, similar to #4553 I am going to close this because the implementation is going in the opposite direction of where we want to go to support various import merging/flattening strategies.

If you'd be interested in working on that target approach (and can certainly include this as one of the supported strategies) that'd be great!

rust-lang/style-team#140
#3362 (comment)

@goffrie
Copy link
Contributor Author

goffrie commented Dec 17, 2020

Is this just a question of how the configuration options are exposed?

@calebcartwright
Copy link
Member

Is this just a question of how the configuration options are exposed?

Basically. We want to have a single option that's an enum instead of myriad boolean options and have to deal with conflicting true values. IIRC what you'd proposed here would align to what folks were calling "shallow" (I may be recalling incorrectly though).

@calebcartwright
Copy link
Member

Also if you're up for the different approach feel free to reopen and adjust text/commits accordingly, I went ahead and closed as I figured a new PR would be easier but entirely up to you 😄

@goffrie
Copy link
Contributor Author

goffrie commented Dec 17, 2020

I can open a new PR.

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

Successfully merging this pull request may close these issues.

2 participants