Skip to content

Commit

Permalink
Document opposing lints
Browse files Browse the repository at this point in the history
  • Loading branch information
c410-f3r committed Oct 13, 2023
1 parent c40359d commit 8138790
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ because that's clearly a non-descriptive name.
- [Documentation](#documentation)
- [Running rustfmt](#running-rustfmt)
- [Debugging](#debugging)
- [Opposing lints](#opposing-lints)
- [PR Checklist](#pr-checklist)
- [Adding configuration to a lint](#adding-configuration-to-a-lint)
- [Cheat Sheet](#cheat-sheet)
Expand Down Expand Up @@ -612,6 +613,13 @@ output in the `stdout` part.

[`dbg!`]: https://doc.rust-lang.org/std/macro.dbg.html

## Opposing lints

There are several lints that deal with the same pattern but suggest different approaches. When you are creating a lint that interact with this scenario, the following tips should be encouraged to guide classification:

* The only case where they should be in the same category is if that category is `restriction`. For example, `semicolon_inside_block` and `semicolon_inside_block`.
* For all the other cases, they should be in different categories with different levels of allowance. For example, `implicit_return` (restriction, allow) and `needless_return` (style, warn).

## PR Checklist

Before submitting your PR make sure you followed all the basic requirements:
Expand Down

0 comments on commit 8138790

Please sign in to comment.