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

Coalesce some of the import options #2605

Merged
merged 4 commits into from
Apr 10, 2018
Merged

Conversation

nrc
Copy link
Member

@nrc nrc commented Apr 7, 2018

Copy link
Contributor

@topecongiro topecongiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! And my apologies for the late review. The code looks good other than the minor refactoring. Also, I think that we should move the visual guides and unit tests of removed config options to reorder_imports section, rather than removing them entirely.

src/reorder.rs Outdated
ReorderableItemKind::ExternCrate => config.reorder_extern_crates_in_group(),
ReorderableItemKind::Mod => config.reorder_modules(),
ReorderableItemKind::Use => config.reorder_imports_in_group(),
ReorderableItemKind::ExternCrate => true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These patterns can be combined into a single pattern.


## `reorder_imports`

Reorder import statements alphabetically
Reorder import and extern crate statements alphabetically
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention that statements are reordered "in group"? Also, if possible, we should move the examples of removed options under reorder_imports section, rather than removing them entirely.

@nrc nrc merged commit 1cab171 into rust-lang:master Apr 10, 2018
mati865 added a commit to mati865/rustfmt that referenced this pull request Apr 17, 2018
topecongiro pushed a commit that referenced this pull request Apr 17, 2018
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