Update some documentation
This commit is contained in:
parent
4a9bfe4184
commit
2635a602bc
@ -191,15 +191,15 @@ declare_lint_pass!(FooFunctions => [FOO_FUNCTIONS]);
|
|||||||
impl EarlyLintPass for FooFunctions {}
|
impl EarlyLintPass for FooFunctions {}
|
||||||
```
|
```
|
||||||
|
|
||||||
Don't worry about the `name` method here. As long as it includes the name of the
|
Normally after declaring the lint, we have to run `cargo dev update_lints`,
|
||||||
lint pass it should be fine.
|
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
|
||||||
The new lint automation runs `update_lints`, which automates some things, but it
|
automatically. While `update_lints` automates most of the things, it doesn't
|
||||||
doesn't automate everything. We will have to register our lint pass manually in
|
automate everything. We will have to register our lint pass manually in the
|
||||||
the `register_plugins` function in `clippy_lints/src/lib.rs`:
|
`register_plugins` function in `clippy_lints/src/lib.rs`:
|
||||||
|
|
||||||
```rust
|
```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
|
This should fix the `unknown clippy lint: clippy::foo_functions` error that we
|
||||||
|
Loading…
Reference in New Issue
Block a user