rust-lang / rust-lang/rust-clippy
Detect code block marker in docs without "base indentation"
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 the Linux kernel we had some documentation examples added with triple backquotes at the end without indentation.
Such a lint would find a few hits, e.g. there is currently one in core.
Possibly related, at least implementation-wise: https://github.com/rust-lang/rust-clippy/issues/15024 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 reviewing the documentation examples in core and the related Clippy issues 15024 and 15025 for implementation context. The work is done when the lint detects code-block markers such as the unindented closing marker shown in the example and identifies the existing cases consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100