Skip to content

Commit 220ca54

Browse files
authored
Merge pull request #980 from ben0x539/style
apply #950 to STYLE.md
2 parents c164fb7 + a1100f1 commit 220ca54

File tree

1 file changed

+21
-34
lines changed

1 file changed

+21
-34
lines changed

STYLE.md

+21-34
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@
33
Some conventions and content guidelines are specified in the [introduction].
44
This document serves as a guide for editors and reviewers.
55

6-
There is a [`style-check`](style-check/) tool which is run in CI to check some
7-
of these. To use it locally, run
8-
`cargo run --manifest-path=style-check/Cargo.toml src`.
6+
There is a [`style-check`](style-check/) tool which is run in CI to check some of these. To use it locally, run `cargo run --manifest-path=style-check/Cargo.toml src`.
97

108
## Markdown formatting
119

1210
* Use ATX-style heading with sentence case.
13-
* Wrap long lines, preferably at 80-columns.
14-
* Use reference links, with shortcuts if appropriate. Place the sorted link
15-
reference definitions at the bottom of the file, or at the bottom of a
16-
section if there is an unusually large number of links that are specific to
17-
the section.
11+
* Use one line per sentence to make diffs nicer.
12+
Do not wrap long lines.
13+
* Use reference links, with shortcuts if appropriate.
14+
Place the sorted link reference definitions at the bottom of the file, or at the bottom of a section if there is an unusually large number of links that are specific to the section.
1815

1916
```
2017
Example of shortcut link: [enumerations]
@@ -24,40 +21,34 @@ of these. To use it locally, run
2421
[enumerations]: types/enum.md
2522
```
2623
27-
* Links should be relative with the `.md` extension. Links to other rust-lang
28-
books that are published with the reference or the standard library API
29-
should also be relative so that the linkchecker can validate them.
30-
* See the [Conventions] section for formatting callouts such as notes, edition
31-
differences, and warnings.
24+
* Links should be relative with the `.md` extension.
25+
Links to other rust-lang books that are published with the reference or the standard library API should also be relative so that the linkchecker can validate them.
26+
* See the [Conventions] section for formatting callouts such as notes, edition differences, and warnings.
3227
* Formatting to avoid:
3328
* Avoid trailing spaces.
3429
* Avoid double blank lines.
3530
3631
### Code examples
3732
38-
Code examples should use code blocks with triple backticks. The language
39-
should always be specified (such as `rust`).
33+
Code examples should use code blocks with triple backticks.
34+
The language should always be specified (such as `rust`).
4035
4136
```rust
4237
println!("Hello!");
4338
```
4439

4540
See https://highlightjs.org/ for a list of supported languages.
4641

47-
Rust examples are tested via rustdoc, and should include the appropriate
48-
annotations when tests are expected to fail:
42+
Rust examples are tested via rustdoc, and should include the appropriate annotations when tests are expected to fail:
4943

5044
* `edition2018` — If it is edition-specific.
51-
* `no_run` — The example should compile successfully, but should not be
52-
executed.
45+
* `no_run` — The example should compile successfully, but should not be executed.
5346
* `should_panic` — The example should compile and run, but produce a panic.
5447
* `compile_fail` — The example is expected to fail to compile.
55-
* `ignore` — The example shouldn't be built or tested. This should be avoided
56-
if possible. Usually this is only necessary when the testing framework does
57-
not support it (such as external crates or modules, or a proc-macro), or it
58-
contains psuedo-code which is not valid Rust. An HTML comment such as
59-
`<!-- ignore: requires extern crate -->` should be placed before the example
60-
to explain why it is ignored.
48+
* `ignore` — The example shouldn't be built or tested.
49+
This should be avoided if possible.
50+
Usually this is only necessary when the testing framework does not support it (such as external crates or modules, or a proc-macro), or it contains pseudo-code which is not valid Rust.
51+
An HTML comment such as `<!-- ignore: requires extern crate -->` should be placed before the example to explain why it is ignored.
6152

6253
See the [rustdoc documentation] for more detail.
6354

@@ -66,18 +57,14 @@ See the [rustdoc documentation] for more detail.
6657
* Use American English spelling.
6758
* Use Oxford commas.
6859
* Idioms and styling to avoid:
69-
* Avoid slashes for alternatives ("program/binary"), use conjunctions or
70-
rewrite it ("program or binary").
71-
* Avoid qualifying something as "in Rust", the entire reference is about
72-
Rust.
60+
* Avoid slashes for alternatives ("program/binary"), use conjunctions or rewrite it ("program or binary").
61+
* Avoid qualifying something as "in Rust", the entire reference is about Rust.
7362

7463
## Content
7564

76-
* Whenever there is a difference between editions, the differences should be
77-
called out with an "Edition Differences" block. The main text should stick
78-
to what is common between the editions. However, for large differences (such
79-
as "async"), the main text may contain edition-specific content as long as
80-
it is made clear which editions it applies to.
65+
* Whenever there is a difference between editions, the differences should be called out with an "Edition Differences" block.
66+
The main text should stick to what is common between the editions.
67+
However, for large differences (such as "async"), the main text may contain edition-specific content as long as it is made clear which editions it applies to.
8168

8269
[conventions]: src/introduction.md#conventions
8370
[introduction]: src/introduction.md

0 commit comments

Comments
 (0)