Skip to content

Commit

Permalink
Update some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Feb 11, 2020
1 parent b118f89 commit a0fd5cd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
After declaring the lint, you have to run `cargo dev update_lints`, which
updates some files, so Clippy knows about the new lint. If you used `cargo dev
new_lint ...` to declare the lint, 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
Expand Down

0 comments on commit a0fd5cd

Please sign in to comment.