Skip to content

Commit 8138790

Browse files
committed
Document opposing lints
1 parent c40359d commit 8138790

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

book/src/development/adding_lints.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ because that's clearly a non-descriptive name.
3030
- [Documentation](#documentation)
3131
- [Running rustfmt](#running-rustfmt)
3232
- [Debugging](#debugging)
33+
- [Opposing lints](#opposing-lints)
3334
- [PR Checklist](#pr-checklist)
3435
- [Adding configuration to a lint](#adding-configuration-to-a-lint)
3536
- [Cheat Sheet](#cheat-sheet)
@@ -612,6 +613,13 @@ output in the `stdout` part.
612613

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

616+
## Opposing lints
617+
618+
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:
619+
620+
* 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`.
621+
* 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).
622+
615623
## PR Checklist
616624

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

0 commit comments

Comments
 (0)