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

Reorder imports (treat all 'extern create' as thirdparty) #397

Merged
merged 2 commits into from Dec 13, 2017

Conversation

stanislav-tkach
Copy link
Contributor

Motivation: we had a (not described formally) convention to separate usings into three groups: first thirdparty, then std and finally the internal ones. I propose to treat all external crate usings as thirdparty just because it is a formal criteria.

The order is discussable too.

@stanislav-tkach stanislav-tkach added the discussion 💬 The design isn't finalized yet, feel free to participate in the discussion. label Dec 12, 2017
@stanislav-tkach stanislav-tkach self-assigned this Dec 12, 2017
aleksuss
aleksuss previously approved these changes Dec 12, 2017
@alekseysidorov
Copy link
Contributor

What do you think about order such this?

use std;
use foreign_crates;
use exonum_crates;
use current_crate;

@aleksuss
Copy link
Contributor

Let's be closer to community convention ?

use third_party_crates;

use std;

use current_crate;

pub use current_crate;

P.S. third_party_crates include exonum's crates as external dependencies

@stanislav-tkach
Copy link
Contributor Author

stanislav-tkach commented Dec 13, 2017

I like this idea, especially because it seems that rust-fmt will probably enforce a similar order.

@stanislav-tkach stanislav-tkach changed the title [DISCUSSION] Reorder imports (treat all 'extern create' as thirdparty) Reorder imports (treat all 'extern create' as thirdparty) Dec 13, 2017
@stanislav-tkach
Copy link
Contributor Author

Discussed, the following order should be used:

use std;
...

use extern_crate;
...

use inner;
...

pub use something;

Motivation: it is a popular ordering in other crates and in the rust-fmt RFC.
It can be convenient to separate our (exonum) extern crates from third-party crates, but such rule cannot be (easily) automated.

@aleksuss
Copy link
Contributor

It'd be grate if you save this somewhere in a public place

@stanislav-tkach
Copy link
Contributor Author

@aleksuss We have an issue (#109 and in JIRA too) for CONTRIBUTING.md/developer-notes.md. :trollface:

@therustmonk therustmonk merged commit 7550155 into exonum:master Dec 13, 2017
pavel-mukhanov pushed a commit to pavel-mukhanov/exonum that referenced this pull request Apr 5, 2019
Reorder imports (treat all 'extern create' as thirdparty)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion 💬 The design isn't finalized yet, feel free to participate in the discussion.
Development

Successfully merging this pull request may close these issues.

None yet

4 participants