-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Roadmap] Improve Clippy documentation #6628
Comments
From #8579 and the experience of a first-time contributor:
|
While reviewing PRs, I've notices that we don't really have good documentation for our And we don't have any documentation for |
Yeah, we should extend the I think we should write a short guide on how good errors and suggestions can be build in Clippy. There's the Errors and Lints chapter in the rustc-dev-guide, but this is really long and I guess no one who contributes to Clippy (for the first time/only once) wants to read through all of that. |
True, we don't have a shortage of to-dos ^^. Having a
👍 for that, but we might want to wait on #7797 |
Nervously looks at triage.rust-lang.org and the 14+/- PRs that are awaiting my review.
Yes, maybe. Though, if this gets outdated, it doesn't really help anymore or might be confusing. And we can't implement such a lint every few months. Once I get to the Clippy book (I hope that I can finish the work on 2022-04-09, fingers crossed), we can start improving our documentation and better write guides. EDIT:
It's 2022-07-14 and the book was just released: https://doc.rust-lang.org/nightly/clippy/ |
What about picking 2-3 lints that are already implemented in Clippy and then try to document every implementation step for those lints in their respective files within the codebase?
If anything changes, we can accordingly update the code documentation within the same commit that makes a change for those lints. So then those "more-than-well" documented lints are always kept up-to-date. Of course, if that would be sustainable, because I'm not sure how often Clippy lints are changed or refactored. |
The "adding lints" documentation already goes through a step by step instruction of adding lints. Everything that has to be implemented in addition to this is already lint specific. And documenting something like this in code is not a good solution IMO. This will get outdated over time and we can't enforce updating it. Functions used, rustc types, ... might change over time and only get updated in the code, not the documentation. It's just bit-rotty by nature and wrong documentation is worse than no documentation IMO. Also we do want to document the bits and pieces that will help writing lints. But I don't see the need to do this inside a lint implementation. EDIT: Looking at the adding lints doc, I must admit that it exploded and now also has many unnecessary additional information, that should live somewhere else. Splitting this up is also on my todo list for the book. |
I would like to see some documentation for our Also, a thought that came to mind: Do we maybe want to remove the early lint pass documentation, or at least add a note that late lint passes should be preferred? Currently, I can't think of a lint that is better when implemented in an early lint pass (after macro expansion). Our tooling is also better for late lint passes. Encouraging the usage of just late lint passes could save us maintenance work in the future. We also had some contributors that got stuck because they selected an early lint pass but needed a late lint pass. |
Another request what to add to the Clippy book: How to deprecate/uplift a Clippy lint?
Posted here: rust-lang/rust#99696 (comment) I noticed that |
Similar to a Clippy Book, which describes how to use Clippy, a book about how to
contribute to Clippy might be helpful for new and existing contributors. There's
already the
doc
directory in the Clippy repo, this can be turned into amdbook
.#6011
Steps to completion:
The text was updated successfully, but these errors were encountered: