rust-lang / rust-lang/rust-clippy
Lint code that has been commented out
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Lint commented out code.
The goal is to prevent people from committing/pushing code that has been commented out, which is basically equivalent to dead code. Instead, they should remove the code and use their version control system if they want to recover it in the future.
This should for obvious reasons not trigger for doc comments, and only for comments that contain only code.
I have no good idea how to determine whether a comment is a "code that has been commented out" comment except for trying to parse it.
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
The issue does not name implementation files or tests. Start by researching how Rust comments and doc comments are represented and how existing Clippy lints are structured, then define reliable cases that distinguish code-only comments from documentation before adding focused tests for both detection and exclusions.
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
- Mostly clear
- Newbie friendliness
- 35/100