rust-lang / rust-lang/rust-clippy

More granular `missing_docs`-like lints

Open
#11,914 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lint
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

What it does

In my experience the single most valuable docstring are ones on the structs, as there are least amount of them, yet they are the very core of every project. Then the docs on the methods, and the rest is great to have but not as important, especially for an application code.

Unfortunately there's no good way to take it into account when trying to enforce better docstring coverage, ATM. If I add #[warn(missing_docs)] trying to up our documentation game in a large project it generates tons of warning, lots of them not that important to immediately fix.

For these two reasons:

  • not all docstring types as equally valuable
  • being able to more gradually enforce better docs coverage

I'd love to have some #[warn(missing_struct_docs)], #[warn(missing_method_docs)], etc.

I originally posted this idea on https://internals.rust-lang.org/t/more-granular-missing-docs/19953 , but was suggested that making this a clippy lint (first), might be a good approach.

Advantage

No response

Drawbacks

No response

Example

na

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked internals discussion and reviewing Clippy's existing missing_docs-like lint approach. Define which item categories the proposed missing_struct_docs and missing_method_docs lints should cover, then verify that the design supports gradual documentation enforcement.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.