@@ -30,6 +30,7 @@ because that's clearly a non-descriptive name.
30
30
- [ Documentation] ( #documentation )
31
31
- [ Running rustfmt] ( #running-rustfmt )
32
32
- [ Debugging] ( #debugging )
33
+ - [ Conflicting lints] ( #conflicting-lints )
33
34
- [ PR Checklist] ( #pr-checklist )
34
35
- [ Adding configuration to a lint] ( #adding-configuration-to-a-lint )
35
36
- [ Cheat Sheet] ( #cheat-sheet )
@@ -612,6 +613,20 @@ output in the `stdout` part.
612
613
613
614
[ `dbg!` ] : https://doc.rust-lang.org/std/macro.dbg.html
614
615
616
+ ## Conflicting lints
617
+
618
+ There are several lints that deal with the same pattern but suggest different approaches. In other words, some lints
619
+ may suggest modifications that go in the opposite direction to what some other lints already propose for the same
620
+ code, creating conflicting diagnostics.
621
+
622
+ When you are creating a lint that ends up in this scenario, the following tips should be encouraged to guide
623
+ classification:
624
+
625
+ * The only case where they should be in the same category is if that category is ` restriction ` . For example,
626
+ ` semicolon_inside_block ` and ` semicolon_outside_block ` .
627
+ * For all the other cases, they should be in different categories with different levels of allowance. For example,
628
+ ` implicit_return ` (restriction, allow) and ` needless_return ` (style, warn).
629
+
615
630
## PR Checklist
616
631
617
632
Before submitting your PR make sure you followed all the basic requirements:
0 commit comments