1
1
# Emitting a lint
2
2
3
- Once we have [ defined a lint] ( define_lints .md) , written [ UI
4
- tests] ( write_tests .md) and chosen [ the lint pass] ( lint_passes.md ) for the lint,
3
+ Once we have [ defined a lint] ( defining_lints .md) , written [ UI
4
+ tests] ( writing_tests .md) and chosen [ the lint pass] ( lint_passes.md ) for the lint,
5
5
we can begin the implementation of the lint logic so that we can emit it and
6
6
gradually work towards a lint that behaves as expected.
7
7
@@ -119,7 +119,7 @@ impl<'tcx> LateLintPass<'tcx> for LintName {
119
119
}
120
120
```
121
121
122
- Suggestions generally use the [ ` format! ` ] ( format_macro ) macro to interpolate the
122
+ Suggestions generally use the [ ` format! ` ] [ format_macro ] macro to interpolate the
123
123
old values with the new ones. To get code snippets, use one of the ` snippet* `
124
124
functions from ` clippy_utils::source ` .
125
125
@@ -193,7 +193,7 @@ span), you could use `snippet(cx, span, "..")`.
193
193
194
194
## Final: Run UI Tests to Emit the Lint
195
195
196
- Now, if we run our [ UI test] ( write_tests .md) , we should see that Clippy now
196
+ Now, if we run our [ UI test] ( writing_tests .md) , we should see that Clippy now
197
197
produces output that contains the lint message we designed.
198
198
199
199
The next step is to implement the logic properly, which is a detail that we will
@@ -214,3 +214,4 @@ cover in the next chapters.
214
214
[ inclusive_range ] : https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html
215
215
[ applicability ] : https://doc.rust-lang.org/beta/nightly-rustc/rustc_errors/enum.Applicability.html
216
216
[ snippet_fn ] : https://doc.rust-lang.org/beta/nightly-rustc/clippy_utils/source/fn.snippet.html
217
+ [ format_macro ] : https://doc.rust-lang.org/std/macro.format.html
0 commit comments