rust-lang / rust-lang/rust-clippy

Warn methods in doc comments written as `fun()` instead of `fun`

Open
#1,750 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-documentation L-style S-needs-discussion T-AST
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

According to #41771 (comment), the current convention for rustdoc is to write methods without any trailing parentheses. For example, the comment "Resizes the Vec in-place so that len() is equal to new_len" should really be "Resizes the Vec in-place so that len is equal to new_len".

Would be nice if we had some way for clippy to warn about this convention.

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 names rustdoc comments and Clippy but no file or test. Start by locating Clippy lint implementations and tests for documentation comments, then compare the stated fun() and fun examples. Done means Clippy warns when method names in doc comments use trailing parentheses, without warning on valid cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.