rust-lang / rust-lang/rust-clippy

Configure clippy lints further with the `[lints]` table.

Open
#13,712 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request S-triage
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Problem

Currently I still need a clippy.toml in the latest stable as I cannot pass arguments to clippy lints like disallowed_methods in the [lints] table in the Cargo.toml. There is prior art with the unexpected_cfgs lint as that sets check-cfg = [..args], but I don't see anything similar for clippy lints that also receive arguments.

Proposed Solution

Add an args or similar entry to the [lints.specific-lint] table that allows passing arguments to clippy (or have clippy read from the Cargo.toml for the configured arguments).

Notes

I believe that like rust-lang/cargo#14521 , there is no support for this currently.

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

Start by reviewing how clippy.toml currently configures argument-bearing lints and how Cargo.toml handles the [lints] table, especially the existing unexpected_cfgs check-cfg support. Compare the related rust-lang/cargo#14521 discussion. Done means a documented Cargo.toml configuration can pass arguments to clippy lints such as disallowed_methods without requiring clippy.toml.

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.