rust-lang / rust-lang/rust-clippy
Detect code block contents without "base indentation" in docs
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
In many projects, it is likely that no indentation is not indented.
Such a lint would find a few hits, e.g. there are currently a few in stdarch.
Having said that, when/if rustfmt stabilizes formatting code blocks in documentation, this lint may not be needed anymore.
Possibly related, at least implementation-wise: https://github.com/rust-lang/rust-clippy/issues/15023 and https://github.com/rust-lang/rust-clippy/issues/15025.
Advantage
- More consistency in docs.
- Less time spent by reviewers.
Drawbacks
No response
Example
/// ```
///fn f() {}
/// ```
Should be written as:
/// ```
/// fn f() {}
/// ```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the related issues #15023 and #15025 and inspect the reported cases in stdarch. Define the lint around documentation code blocks lacking base indentation, using the issue's example as the expected behavior; done means those cases are detected consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100