Skip to content

Commit

Permalink
Update comment location
Browse files Browse the repository at this point in the history
  • Loading branch information
phansch committed Mar 8, 2019
1 parent 3c67c62 commit 34685a5
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions doc/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,22 +339,26 @@ lint declaration.
Please document your lint with a doc comment akin to the following:

```rust
/// **What it does:** Checks for ... (describe what the lint matches).
///
/// **Why is this bad?** Supply the reason for linting the code.
///
/// **Known problems:** None. (Or describe where it could go wrong.)
///
/// **Example:**
///
/// ```rust,ignore
/// // Bad
/// Insert a short example of code that triggers the lint
///
/// // Good
/// Insert a short example of improved code that doesn't trigger the lint
/// ```
declare_clippy_lint! { /* ... */ }
declare_clippy_lint! {
/// **What it does:** Checks for ... (describe what the lint matches).
///
/// **Why is this bad?** Supply the reason for linting the code.
///
/// **Known problems:** None. (Or describe where it could go wrong.)
///
/// **Example:**
///
/// ```rust,ignore
/// // Bad
/// Insert a short example of code that triggers the lint
///
/// // Good
/// Insert a short example of improved code that doesn't trigger the lint
/// ```
pub FOO_FUNCTIONS,
pedantic,
"function named `foo`, which is not a descriptive name"
}
```

Once your lint is merged, this documentation will show up in the [lint
Expand Down

0 comments on commit 34685a5

Please sign in to comment.