11# Emitting a lint
22
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,
55we can begin the implementation of the lint logic so that we can emit it and
66gradually work towards a lint that behaves as expected.
77
@@ -119,7 +119,7 @@ impl<'tcx> LateLintPass<'tcx> for LintName {
119119}
120120```
121121
122- Suggestions generally use the [ ` format! ` ] ( format_macro ) macro to interpolate the
122+ Suggestions generally use the [ ` format! ` ] [ format_macro ] macro to interpolate the
123123old values with the new ones. To get code snippets, use one of the ` snippet* `
124124functions from ` clippy_utils::source ` .
125125
@@ -193,7 +193,7 @@ span), you could use `snippet(cx, span, "..")`.
193193
194194## Final: Run UI Tests to Emit the Lint
195195
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
197197produces output that contains the lint message we designed.
198198
199199The next step is to implement the logic properly, which is a detail that we will
@@ -214,3 +214,4 @@ cover in the next chapters.
214214[ inclusive_range ] : https://doc.rust-lang.org/std/ops/struct.RangeInclusive.html
215215[ applicability ] : https://doc.rust-lang.org/beta/nightly-rustc/rustc_errors/enum.Applicability.html
216216[ 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