Skip to content
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

We've suppressed a bunch of useful warnings pending cleanup. #1895

Open
cbiffle opened this issue Oct 7, 2024 · 0 comments
Open

We've suppressed a bunch of useful warnings pending cleanup. #1895

cbiffle opened this issue Oct 7, 2024 · 0 comments

Comments

@cbiffle
Copy link
Collaborator

cbiffle commented Oct 7, 2024

During the last two toolchain updates, I had to contend with new Clippy warnings. Rather than clean up all existing code, I wound up suppressing some. It would be great to get these turned back on, either at the workspace level, or in individual crates (as an incremental step).

The warnings that are currently globally suppressed, but probably should not be, are:

  • clippy::missing_safety_doc -- our intention is to have safety docs on every unsafe operation and every unsafe block, to simplify auditing. We don't currently.
  • clippy::wildcard_imports -- see Removing wildcard imports kind of stalled out. #1894 for specific tracking on this
  • clippy::too_many_arguments -- if individual functions really believe they need that many arguments, they can suppress the warning on just the function.
  • clippy::identity_op -- may indicate a logic error, easy to suppress locally if it does not.
  • clippy::manual_inspect -- inspect became stable on more APIs a while back and should generally be preferred to map if you're just looking at the data passing by -- it makes it harder to accidentally alter it, and should be easier for the compiler to simplify.
  • clippy::single_match -- in almost every case if let is preferable, and this can be suppressed in the very rare cases where a match is right (example: generated code)

And just to get out of the habit of suppressing Clippy warnings, we will eventually also want to deal with these, but they're more work since they require rewrapping/flowing comments -- and Clippy and (neo)vim disagree on how to flow Markdown, so you have to do it manually.

  • clippy::too_long_first_doc_paragraph -- possibly my least favorite Clippy lint, this has developed opinions about how long the initial sentence in your docs can be
  • clippy::doc_lazy_continuation -- this is slightly more important, it catches improperly constructed bulleted list in doc comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant