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

Conversation

kpreid
Copy link
Contributor

@kpreid kpreid commented Mar 11, 2025

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 now also warns against nursery (in less strong language), and mentions false positives in the one-line summary.

I also moved clippy::restriction and clippy::nursery to the bottom of the table, because these are more special meta-categories than clippy::cargo is.

changelog: none

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`.
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2025

r? @Jarcho

rustbot has assigned @Jarcho.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 11, 2025
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.

@samueltardieu
Copy link
Member

r? @flip1995

@rustbot rustbot assigned flip1995 and unassigned Jarcho Apr 6, 2025
Copy link
Member

@flip1995 flip1995 left a 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.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants