-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
base: master
Are you sure you want to change the base?
Conversation
I have seen beginners try to improve their code by writing `#[warn(clippy::pedantic, clippy::nursery)`, and then be confused. The README already warns against enabling all of `restriction`, but it should also warn against `nursery` (in less strong language). I also moved `clippy::restriction` and `clippy::nursery` to the bottom of the table, because these are more special categories than `clippy::cargo`.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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”.
There was a problem hiding this comment.
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.
r? @flip1995 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have documentation about this in the book. I would prefer if the readme would just link to that documentation:
To learn more about Clippy's lint groups, refer to the Clippy book.
I have seen beginners try to improve their code by writing
#[warn(clippy::pedantic, clippy::nursery)]
, and then be confused. The README already warns against enabling all ofrestriction
, but it now also warns againstnursery
(in less strong language), and mentions false positives in the one-line summary.I also moved
clippy::restriction
andclippy::nursery
to the bottom of the table, because these are more special meta-categories thanclippy::cargo
is.changelog: none