Skip to content

Commit 71f4628

Browse files
committed
Document import grouping
1 parent 4112620 commit 71f4628

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,26 @@ submitted for inclusion in the work by you, as defined in the
3333
Apache-2.0 license, shall be dual licensed as in the README, without any
3434
additional terms or conditions.
3535

36+
## Non-machine-enforced coding standards
37+
38+
These are requirements we have that we have not yet lifted to the level of
39+
automatic enforcement.
40+
41+
### Import grouping
42+
43+
In each file the imports should be grouped into at most 4 groups in the
44+
following order:
45+
46+
1. stdlib
47+
2. non-repository local crates
48+
3. repository local other crates
49+
4. this crate
50+
51+
Separate each group with a blank line, and rustfmt will sort into a canonical
52+
order. Any file that is not grouped like this can be rearranged whenever the
53+
file is touched - we're not precious about having it done in a separate commit,
54+
though that is helpful.
55+
3656
## Version numbers
3757

3858
If you ever see a released version of rustup which has `::` in its version string

0 commit comments

Comments
 (0)