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
Lint markdown docs #6480
Lint markdown docs #6480
Conversation
Includes a few small wording changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some quick explanations
``` | ||
```shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I've gone with shell
over bash
as the commands are relevant generally to any shell.
```bash | ||
$ cd tokio | ||
$ cargo fuzz list | ||
```shell | ||
cd tokio | ||
cargo fuzz list | ||
``` | ||
|
||
```text | ||
fuzz_linked_list | ||
```` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good idea to generally split commands and the output into separate blocks instead of using shell prefixes, to make it clearer that the user shouldn't be pasting the output of the command.
|
||
#### Commit message guidelines | ||
|
||
A good commit message should describe what changed and why. | ||
|
||
1. The first line should: | ||
- contain a short description of the change (preferably 50 characters or less, and no more than |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using -
for lists helps avoid the confusion between lists and italic / bold text
More examples can be found [here][examples]. For a larger "real world" example, see the | ||
The Tokio github repository contains more [examples]. For a larger "real world" example, see the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small content change here.
https://github.com/tokio-rs/tokio/actions/runs/8668104605/job/23772478137?pr=6481:
|
```text | ||
```toml | ||
tokio = { version = "~1.32", features = [...] } | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rendered quite badly by github.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. What about one of the following instead?
tokio = { version = "~1.32", features = ["..."] }
tokio = { version = "~1.32", features = ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong preference, but the former seems more natural to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some notes regarding the small content changes I found, but all of these seem fine to me.
|
||
* **Fast**: Tokio's zero-cost abstractions give you bare-metal | ||
performance. | ||
Tokio is: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content change: It is
-> Tokio is
@@ -58,7 +53,8 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: | |||
[dependencies] | |||
tokio = { version = "1.37.0", features = ["full"] } | |||
``` | |||
Then, on your main.rs: | |||
|
|||
Then, in your main.rs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content change: on your main.rs
-> in your main.rs
* `tokio-stream` - [view changelog](https://github.com/tokio-rs/tokio/blob/master/tokio-stream/CHANGELOG.md) | ||
* `tokio-macros` - [view changelog](https://github.com/tokio-rs/tokio/blob/master/tokio-macros/CHANGELOG.md) | ||
* `tokio-test` - [view changelog](https://github.com/tokio-rs/tokio/blob/master/tokio-test/CHANGELOG.md) | ||
- [`tokio` changelog](https://github.com/tokio-rs/tokio/blob/master/tokio/CHANGELOG.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content change: view changelog
-> changelog
|
||
`cargo install cargo-fuzz` | ||
```shell | ||
cargo install --locked cargo-fuzz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content change: cargo install cargo-fuzz
-> cargo install --locked cargo-fuzz
|
||
* **Fast**: Tokio's zero-cost abstractions give you bare-metal | ||
performance. | ||
Tokio is: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content change: It is
-> Tokio is
@@ -58,7 +53,8 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: | |||
[dependencies] | |||
tokio = { version = "1.37.0", features = ["full"] } | |||
``` | |||
Then, on your main.rs: | |||
|
|||
Then, in your main.rs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content change: on your main.rs
-> in your main.rs
I don't actually want to do this. We require code to pass rustfmt because otherwise we get too many PRs with badly formatted code. We don't have this problem with markdown, and I prefer the freedom that we currently have. Either way, thank you for taking the time to submit a PR. |
Motivation
When saving changes to markdown files in VSCode with a fairly standard setup (markdown lint extension installed),
often the extension will reformat areas of the docs unrelated to the the specific change. This PR makes everything
neat (100 character lines, consistent list characters, code languages on fenced code blocks etc.)
Solution
Reformatted the root level markdown docs
Added a markdown lint config file to set the line length (picked 100 chars as a reasonable compromise. 120 is generally too long for docs, while 80 seems overly constraining).
Added a markdown lint action to the ci.yml - currently this only points at the markdown docs in the root of the project, not those deeper in the project tree, but this could be ratcheted down to cover those once they're also similarly reformatted.