From b6486fae5c9ce3610aa325a3c86d23871e05c1e8 Mon Sep 17 00:00:00 2001 From: Francisco Salgueiro Date: Wed, 3 Apr 2024 17:07:12 +0100 Subject: [PATCH] add missing links in development guide --- book/src/development/defining_lints.md | 9 ++++----- book/src/development/lint_passes.md | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/book/src/development/defining_lints.md b/book/src/development/defining_lints.md index 54f77b00190..806ed0845f0 100644 --- a/book/src/development/defining_lints.md +++ b/book/src/development/defining_lints.md @@ -62,9 +62,8 @@ $ cargo dev new_lint --name=lint_name --pass=late --category=pedantic There are two things to note here: 1. `--pass`: We set `--pass=late` in this command to do a late lint pass. The - alternative is an `early` lint pass. We will discuss this difference in a - later chapter. - + alternative is an `early` lint pass. We will discuss this difference in the + [Lint Passes] chapter. 2. `--category`: If not provided, the `category` of this new lint will default to `nursery`. @@ -194,8 +193,7 @@ store.register_late_pass(|_| Box::new(foo_functions::FooFunctions)); As you might have guessed, where there's something late, there is something early: in Clippy there is a `register_early_pass` method as well. More on early -vs. late passes in a later chapter. - +vs. late passes in the [Lint Passes] chapter. Without a call to one of `register_early_pass` or `register_late_pass`, the lint pass in question will not be run. @@ -203,3 +201,4 @@ pass in question will not be run. [all_lints]: https://rust-lang.github.io/rust-clippy/master/ [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints +[Lint Passes]: lint_passes.md diff --git a/book/src/development/lint_passes.md b/book/src/development/lint_passes.md index 621fc20972e..dde9e1a273b 100644 --- a/book/src/development/lint_passes.md +++ b/book/src/development/lint_passes.md @@ -50,7 +50,7 @@ questions already, but the parser is okay with it. This is what we mean when we say `EarlyLintPass` deals with only syntax on the AST level. Alternatively, think of the `foo_functions` lint we mentioned in -define new lints chapter. +the [Define New Lints](defining_lints.md) chapter. We want the `foo_functions` lint to detect functions with `foo` as their name. Writing a lint that only checks for the name of a function means that we only