rust-lang / rust-lang/rust-clippy

Lint code that has been commented out

Open
#1,348 3 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lint C-an-interesting-project E-hard T-AST
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.