diff options
| author | flip1995 <hello@philkrones.com> | 2020-02-11 11:29:03 +0100 |
|---|---|---|
| committer | flip1995 <hello@philkrones.com> | 2020-02-14 14:37:56 +0100 |
| commit | 2635a602bc62928fc44b3c7d7c439eb4c788f552 (patch) | |
| tree | a887faf44b2760f7b323db0b9472ad52b87d0cc8 /doc/adding_lints.md | |
| parent | 4a9bfe41841ad7299174832cbad450625ef5fc58 (diff) | |
| download | rust-2635a602bc62928fc44b3c7d7c439eb4c788f552.tar.gz rust-2635a602bc62928fc44b3c7d7c439eb4c788f552.zip | |
Update some documentation
Diffstat (limited to 'doc/adding_lints.md')
| -rw-r--r-- | doc/adding_lints.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/adding_lints.md b/doc/adding_lints.md index cc4b5f7d162..7e1263ebf22 100644 --- a/doc/adding_lints.md +++ b/doc/adding_lints.md @@ -191,15 +191,15 @@ declare_lint_pass!(FooFunctions => [FOO_FUNCTIONS]); impl EarlyLintPass for FooFunctions {} ``` -Don't worry about the `name` method here. As long as it includes the name of the -lint pass it should be fine. - -The new lint automation runs `update_lints`, which automates some things, but it -doesn't automate everything. We will have to register our lint pass manually in -the `register_plugins` function in `clippy_lints/src/lib.rs`: +Normally after declaring the lint, we have to run `cargo dev update_lints`, +which updates some files, so Clippy knows about the new lint. Since we used +`cargo dev new_lint ...` to generate the lint declaration, this was done +automatically. While `update_lints` automates most of the things, it doesn't +automate everything. We will have to register our lint pass manually in the +`register_plugins` function in `clippy_lints/src/lib.rs`: ```rust -reg.register_early_lint_pass(box foo_functions::FooFunctions); +store.register_early_pass(box foo_functions::FooFunctions); ``` This should fix the `unknown clippy lint: clippy::foo_functions` error that we |
