Skip to content

Caution against warn(clippy::nursery). #14391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,21 @@ You can choose how much Clippy is supposed to ~~annoy~~ help you by changing the
| `clippy::complexity` | code that does something simple but in a complex way | **warn** |
| `clippy::perf` | code that can be written to run faster | **warn** |
| `clippy::pedantic` | lints which are rather strict or have occasional false positives | allow |
| `clippy::cargo` | lints for the Cargo manifest | allow |
| `clippy::restriction` | lints which prevent the use of language and library features[^restrict] | allow |
| `clippy::nursery` | new lints that are still under development | allow |
| `clippy::cargo` | lints for the cargo manifest | allow |
| `clippy::nursery` | new lints that are still under development and often have false positives | allow |

More to come, please [file an issue](https://github.com/rust-lang/rust-clippy/issues) if you have ideas!
Note these reasons why some categories are allow-by-default, and you may not wish to enable them:

The `restriction` category should, *emphatically*, not be enabled as a whole. The contained
lints may lint against perfectly reasonable code, may not have an alternative suggestion,
and may contradict any other lints (including other categories). Lints should be considered
on a case-by-case basis before enabling.
* **The `restriction` category should not be enabled as a whole.** The contained lints may lint
against perfectly reasonable code, and may contradict other lints (including other categories).
These lints should be considered on a case-by-case basis before enabling; enabling a `restriction`
lint is choosing to program in a restricted subset of Rust for a special purpose.[^restrict]

* The `nursery` category contains lints which are not yet ready to be in another category.
If you enable this whole category, be prepared for false positives or incorrect suggestions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add something like "We welcome bug reports and comments concerning those lints, as this may help towards deciding whether they are ready to be moved into more appropriate categories.", just so people don't refrain themselves when hesitating to file a bug report.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, is that really accurate? Whenever I see discussions of whether to put a lint in nursery or remove it, it’s “we know the algorithm for this lint has a specific flaw”.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that if a bug has too many reports, or as you say a specific flaw, we may keep it longer (forever?) in nursery.


Please [file an issue](https://github.com/rust-lang/rust-clippy/issues) if you have ideas for more lints!

[^restrict]: Some use cases for `restriction` lints include:
- Strict coding styles (e.g. [`clippy::else_if_without_else`]).
Expand Down