Skip to content

Commit 41b367f

Browse files
committed
Gramar, and spelin kleanup
A few minor cleanups in various markdown files, mostly focusing on spelling and ignoring non-compilable codeblocks.
1 parent d43714a commit 41b367f

21 files changed

+75
-75
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Lints are divided into categories, each with a default [lint level](https://doc.
1111
You can choose how much Clippy is supposed to ~~annoy~~ help you by changing the lint level by category.
1212

1313
| Category | Description | Default level |
14-
| --------------------- | ----------------------------------------------------------------------------------- | ------------- |
14+
|-----------------------|-------------------------------------------------------------------------------------|---------------|
1515
| `clippy::all` | all lints that are on by default (correctness, suspicious, style, complexity, perf) | **warn/deny** |
1616
| `clippy::correctness` | code that is outright wrong or useless | **deny** |
1717
| `clippy::suspicious` | code that is most likely wrong or useless | **warn** |
@@ -130,7 +130,7 @@ for example.
130130

131131
You can add Clippy to Travis CI in the same way you use it locally:
132132

133-
```yml
133+
```yaml
134134
language: rust
135135
rust:
136136
- stable
@@ -253,7 +253,7 @@ rust-version = "1.30"
253253

254254
The MSRV can also be specified as an attribute, like below.
255255

256-
```rust
256+
```rust,ignore
257257
#![feature(custom_inner_attributes)]
258258
#![clippy::msrv = "1.30.0"]
259259

book/src/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ much Clippy is supposed to ~~annoy~~ help you by changing the lint level by
1414
category.
1515

1616
| Category | Description | Default level |
17-
| --------------------- | ----------------------------------------------------------------------------------- | ------------- |
17+
|-----------------------|-------------------------------------------------------------------------------------|---------------|
1818
| `clippy::all` | all lints that are on by default (correctness, suspicious, style, complexity, perf) | **warn/deny** |
1919
| `clippy::correctness` | code that is outright wrong or useless | **deny** |
2020
| `clippy::suspicious` | code that is most likely wrong or useless | **warn** |

book/src/configuration.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> **Note:** The configuration file is unstable and may be deprecated in the future.
44
55
Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`. It contains a
6-
basic `variable = value` mapping eg.
6+
basic `variable = value` mapping e.g.
77

88
```toml
99
avoid-breaking-exported-api = false
@@ -60,7 +60,7 @@ And to warn on `lint_name`, run
6060
cargo clippy -- -W clippy::lint_name
6161
```
6262

63-
This also works with lint groups. For example you can run Clippy with warnings for all lints enabled:
63+
This also works with lint groups. For example, you can run Clippy with warnings for all lints enabled:
6464

6565
```terminal
6666
cargo clippy -- -W clippy::pedantic
@@ -84,7 +84,7 @@ msrv = "1.30.0"
8484

8585
The MSRV can also be specified as an attribute, like below.
8686

87-
```rust
87+
```rust,ignore
8888
#![feature(custom_inner_attributes)]
8989
#![clippy::msrv = "1.30.0"]
9090
@@ -96,7 +96,7 @@ fn main() {
9696
You can also omit the patch version when specifying the MSRV, so `msrv = 1.30`
9797
is equivalent to `msrv = 1.30.0`.
9898

99-
Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly.
99+
Note: `custom_inner_attributes` is an unstable feature, so it has to be enabled explicitly.
100100

101101
Lints that recognize this configuration option can be
102102
found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv)

book/src/development/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ making Clippy better by contributing to it. In that case, welcome to the
55
project!
66

77
> _Note:_ If you're just interested in using Clippy, there's nothing to see from
8-
> this point onward and you should return to one of the earlier chapters.
8+
> this point onward, and you should return to one of the earlier chapters.
99
1010
## Getting started
1111

book/src/development/adding_lints.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ because that's clearly a non-descriptive name.
2424
- [Lint passes](#lint-passes)
2525
- [Emitting a lint](#emitting-a-lint)
2626
- [Adding the lint logic](#adding-the-lint-logic)
27-
- [Specifying the lint's minimum supported Rust version (MSRV)](#specifying-the-lints-minimum-supported-rust-version-msrv)
27+
- [Specifying the lint's minimum supported Rust version (MSRV)](#specifying-the-lints-minimum-supported-rust-version--msrv-)
2828
- [Author lint](#author-lint)
2929
- [Print HIR lint](#print-hir-lint)
3030
- [Documentation](#documentation)
@@ -275,7 +275,7 @@ When declaring a new lint by hand and `cargo dev update_lints` is used, the lint
275275
pass may have to be registered manually in the `register_plugins` function in
276276
`clippy_lints/src/lib.rs`:
277277

278-
```rust
278+
```rust,ignore
279279
store.register_early_pass(|| Box::new(foo_functions::FooFunctions));
280280
```
281281

@@ -301,7 +301,7 @@ either [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass].
301301

302302
In short, the `LateLintPass` has access to type information while the
303303
`EarlyLintPass` doesn't. If you don't need access to type information, use the
304-
`EarlyLintPass`. The `EarlyLintPass` is also faster. However linting speed
304+
`EarlyLintPass`. The `EarlyLintPass` is also faster. However, linting speed
305305
hasn't really been a concern with Clippy so far.
306306

307307
Since we don't need type information for checking the function name, we used
@@ -318,7 +318,7 @@ implementation of the lint logic.
318318

319319
Let's start by implementing the `EarlyLintPass` for our `FooFunctions`:
320320

321-
```rust
321+
```rust,ignore
322322
impl EarlyLintPass for FooFunctions {
323323
fn check_fn(&mut self, cx: &EarlyContext<'_>, fn_kind: FnKind<'_>, span: Span, _: NodeId) {
324324
// TODO: Emit lint here
@@ -337,10 +337,10 @@ variety of lint emission functions. They can all be found in
337337
[`clippy_utils/src/diagnostics.rs`][diagnostics].
338338

339339
`span_lint_and_help` seems most appropriate in this case. It allows us to
340-
provide an extra help message and we can't really suggest a better name
340+
provide an extra help message, and we can't really suggest a better name
341341
automatically. This is how it looks:
342342

343-
```rust
343+
```rust,ignore
344344
impl EarlyLintPass for FooFunctions {
345345
fn check_fn(&mut self, cx: &EarlyContext<'_>, fn_kind: FnKind<'_>, span: Span, _: NodeId) {
346346
span_lint_and_help(
@@ -479,7 +479,7 @@ the value from `clippy.toml`. This can be accounted for using the
479479
`extract_msrv_attr!(LintContext)` macro and passing
480480
`LateContext`/`EarlyContext`.
481481

482-
```rust
482+
```rust,ignore
483483
impl<'tcx> LateLintPass<'tcx> for ManualStrip {
484484
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
485485
...
@@ -493,7 +493,7 @@ the lint's test file, `tests/ui/manual_strip.rs` in this example. It should
493493
have a case for the version below the MSRV and one with the same contents but
494494
for the MSRV version itself.
495495

496-
```rust
496+
```rust,ignore
497497
...
498498
499499
#[clippy::msrv = "1.44"]
@@ -524,7 +524,7 @@ define_Conf! {
524524

525525
If you have trouble implementing your lint, there is also the internal `author`
526526
lint to generate Clippy code that detects the offending pattern. It does not
527-
work for all of the Rust syntax, but can give a good starting point.
527+
work for all the Rust syntax, but can give a good starting point.
528528

529529
The quickest way to use it, is the [Rust playground:
530530
play.rust-lang.org][author_example]. Put the code you want to lint into the
@@ -617,7 +617,7 @@ output in the `stdout` part.
617617

618618
## PR Checklist
619619

620-
Before submitting your PR make sure you followed all of the basic requirements:
620+
Before submitting your PR make sure you followed all the basic requirements:
621621

622622
<!-- Sync this with `.github/PULL_REQUEST_TEMPLATE` -->
623623

@@ -637,7 +637,7 @@ for some users. Adding a configuration is done in the following steps:
637637

638638
1. Adding a new configuration entry to [`clippy_lints::utils::conf`] like this:
639639

640-
```rust
640+
```rust,ignore
641641
/// Lint: LINT_NAME.
642642
///
643643
/// <The configuration field doc comment>
@@ -690,7 +690,7 @@ for some users. Adding a configuration is done in the following steps:
690690
configuration value is now cloned or copied into a local value that is then
691691
passed to the impl struct like this:
692692

693-
```rust
693+
```rust,ignore
694694
// Default generated registration:
695695
store.register_*_pass(|| box module::StructName);
696696

book/src/development/basics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ We follow a rustc no merge-commit policy. See
125125
## Common Abbreviations
126126

127127
| Abbreviation | Meaning |
128-
| ------------ | -------------------------------------- |
128+
|--------------|----------------------------------------|
129129
| UB | Undefined Behavior |
130130
| FP | False Positive |
131131
| FN | False Negative |

book/src/development/common_tools_writing_lints.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You may need following tooltips to catch up with common operations.
44

55
- [Common tools for writing lints](#common-tools-for-writing-lints)
6-
- [Retrieving the type of an expression](#retrieving-the-type-of-an-expression)
6+
- [Retrieving the type of expression](#retrieving-the-type-of-expression)
77
- [Checking if an expr is calling a specific method](#checking-if-an-expr-is-calling-a-specific-method)
88
- [Checking for a specific type](#checking-for-a-specific-type)
99
- [Checking if a type implements a specific trait](#checking-if-a-type-implements-a-specific-trait)
@@ -16,7 +16,7 @@ Useful Rustc dev guide links:
1616
- [Type checking](https://rustc-dev-guide.rust-lang.org/type-checking.html)
1717
- [Ty module](https://rustc-dev-guide.rust-lang.org/ty.html)
1818

19-
## Retrieving the type of an expression
19+
## Retrieving the type of expression
2020

2121
Sometimes you may want to retrieve the type `Ty` of an expression `Expr`, for
2222
example to answer following questions:
@@ -45,7 +45,7 @@ impl LateLintPass<'_> for MyStructLint {
4545
}
4646
```
4747

48-
Similarly in [`TypeckResults`][TypeckResults] methods, you have the
48+
Similarly, in [`TypeckResults`][TypeckResults] methods, you have the
4949
[`pat_ty()`][pat_ty] method to retrieve a type from a pattern.
5050

5151
Two noticeable items here:
@@ -192,7 +192,7 @@ functions to deal with macros:
192192
- `span.from_expansion()`: detects if a span is from macro expansion or
193193
desugaring. Checking this is a common first step in a lint.
194194

195-
```rust
195+
```rust,ignore
196196
if expr.span.from_expansion() {
197197
// just forget it
198198
return;
@@ -203,11 +203,11 @@ functions to deal with macros:
203203
if so, which macro call expanded it. It is sometimes useful to check if the
204204
context of two spans are equal.
205205

206-
```rust
206+
```rust,ignore
207207
// expands to `1 + 0`, but don't lint
208208
1 + mac!()
209209
```
210-
```rust
210+
```rust,ignore
211211
if left.span.ctxt() != right.span.ctxt() {
212212
// the coder most likely cannot modify this expression
213213
return;
@@ -246,7 +246,7 @@ functions to deal with macros:
246246
`macro_rules!` with `a == $b`, `$b` is expanded to some expression with a
247247
different context from `a`.
248248

249-
```rust
249+
```rust,ignore
250250
macro_rules! m {
251251
($a:expr, $b:expr) => {
252252
if $a.is_some() {

book/src/development/infrastructure/book.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ guide to Clippy that you're reading right now. The Clippy book is formatted with
1313
While not strictly necessary since the book source is simply Markdown text
1414
files, having mdBook locally will allow you to build, test and serve the book
1515
locally to view changes before you commit them to the repository. You likely
16-
already have `cargo` installed, so the easiest option is to simply:
16+
already have `cargo` installed, so the easiest option is to:
1717

1818
```shell
1919
cargo install mdbook
@@ -26,7 +26,7 @@ instructions for other options.
2626

2727
The book's
2828
[src](https://github.com/rust-lang/rust-clippy/tree/master/book/src)
29-
directory contains all of the markdown files used to generate the book. If you
29+
directory contains all the markdown files used to generate the book. If you
3030
want to see your changes in real time, you can use the mdBook `serve` command to
3131
run a web server locally that will automatically update changes as they are
3232
made. From the top level of your `rust-clippy` directory:

book/src/development/infrastructure/changelog_update.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Look for the [`beta-accepted`] label and make sure to also include the PRs with
101101
that label in the changelog. If you can, remove the `beta-accepted` labels
102102
**after** the changelog PR was merged.
103103

104-
> _Note:_ Some of those PRs might even got backported to the previous `beta`.
104+
> _Note:_ Some of those PRs might even get backported to the previous `beta`.
105105
> Those have to be included in the changelog of the _previous_ release.
106106
107107
### 4. Update `clippy::version` attributes

book/src/development/infrastructure/release.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $ git push origin backport_remerge # This can be pushed to your fork
4444
```
4545

4646
After this, open a PR to the master branch. In this PR, the commit hash of the
47-
`HEAD` of the `beta` branch must exists. In addition to that, no files should be
47+
`HEAD` of the `beta` branch must exist. In addition to that, no files should be
4848
changed by this PR.
4949

5050
## Update the `beta` branch

book/src/development/infrastructure/sync.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ sudo chown --reference=/usr/lib/git-core/git-subtree~ /usr/lib/git-core/git-subt
4747
4848
> _Note:_ If you are a Debian user, `dash` is the shell used by default for
4949
> scripts instead of `sh`. This shell has a hardcoded recursion limit set to
50-
> 1000. In order to make this process work, you need to force the script to run
50+
> 1,000. In order to make this process work, you need to force the script to run
5151
> `bash` instead. You can do this by editing the first line of the `git-subtree`
5252
> script and changing `sh` to `bash`.
5353
@@ -71,10 +71,10 @@ $ git remote add clippy-local /path/to/rust-clippy
7171
7272
## Performing the sync from [`rust-lang/rust`] to Clippy
7373

74-
Here is a TL;DR version of the sync process (all of the following commands have
74+
Here is a TL;DR version of the sync process (all the following commands have
7575
to be run inside the `rust` directory):
7676

77-
1. Clone the [`rust-lang/rust`] repository or make sure it is up to date.
77+
1. Clone the [`rust-lang/rust`] repository or make sure it is up-to-date.
7878
2. Checkout the commit from the latest available nightly. You can get it using
7979
`rustup check`.
8080
3. Sync the changes to the rust-copy of Clippy to your Clippy fork:
@@ -107,7 +107,7 @@ to be run inside the `rust` directory):
107107

108108
## Performing the sync from Clippy to [`rust-lang/rust`]
109109

110-
All of the following commands have to be run inside the `rust` directory.
110+
All the following commands have to be run inside the `rust` directory.
111111

112112
1. Make sure you have checked out the latest `master` of `rust-lang/rust`.
113113
2. Sync the `rust-lang/rust-clippy` master to the rust-copy of Clippy:

book/src/development/proposals/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ or around Clippy in the long run.
66
Besides adding more and more lints and improve the lints that Clippy already
77
has, Clippy is also interested in making the experience of its users, developers
88
and maintainers better over time. Projects that address bigger picture things
9-
like this usually take more time and it is useful to have a proposal for those
9+
like this usually take more time, and it is useful to have a proposal for those
1010
first. This is the place where such proposals are collected, so that we can
1111
refer to them when working on them.

book/src/development/proposals/roadmap-2021.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ In the following, plans to improve the usability are covered.
5252

5353
#### No Output After `cargo check`
5454

55-
Currently when `cargo clippy` is run after `cargo check`, it does not produce
56-
any output. This is especially problematic since `rust-analyzer` is on the rise
55+
Currently, when `cargo clippy` is run after `cargo check`, it does not produce
56+
any output. This is especially problematic since `rust-analyzer` is on the rise,
5757
and it uses `cargo check` for checking code. A fix is already implemented, but
5858
it still has to be pushed over the finish line. This also includes the
5959
stabilization of the `cargo clippy --fix` command or the support of multi-span
@@ -221,7 +221,7 @@ regarding the user facing issues.
221221

222222
Rust's roadmap process was established by [RFC 1728] in 2016. Since then every
223223
year a roadmap was published, that defined the bigger plans for the coming
224-
years. This years roadmap can be found [here][Rust Roadmap 2021].
224+
years. This year roadmap can be found [here][Rust Roadmap 2021].
225225

226226
[RFC 1728]: https://rust-lang.github.io/rfcs/1728-north-star.html
227227

0 commit comments

Comments
 (0)