rust-lang / rust-lang/rust-clippy
"should lint" comments should always be on the same line as test
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Description
There are a lot of "should lint" / "should not lint" comments inside the tests but their placement is not uniform.
Some are like this:
// should lint
num.unwrap_or(...)
and others:
num.unwrap_or(...) // should lint
Since adding new rules/lints will potentially change behavior in future, I suggest we stick to second format, thus when a change is introduced, we can see it in the same line, e.g. using git diff, without having to read each test case file and look for its "header".
Version
No response
Additional Labels
No response
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
Search the repository's tests for "should lint" and "should not lint" comments, then inspect the surrounding test cases to identify the inconsistent placements. Standardize them so each comment is on the same line as the test expression, and run the affected tests to confirm behavior is unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100