Skip to content

Conversation

@odysa
Copy link
Contributor

@odysa odysa commented Jun 27, 2025

changelog: Add support for lint level configuration in clippy.toml

Fixes #15128

Add support for configuring lint levels in clippy.toml using the same format as Cargo.toml. This allows users to move lint configurations from Cargo.toml to clippy.toml to keep dependency management and linting separate.

Example

clippy.toml:

[lints.clippy] needless_return = "allow" single_match = { level = "warn", priority = 5 } [lints.rust] dead_code = "allow"
@odysa odysa changed the title Support lint level configuration in clippy.toml [WIP] Support lint level configuration in clippy.toml Jun 27, 2025
@odysa odysa force-pushed the feat/more-config-path branch from df97a9a to aa7b2a2 Compare August 9, 2025 04:54
@git-staus
Copy link

I wanted to mention that the following note in the README probably should be updated/removed as part of this PR as well:

rust-clippy/README.md

Lines 229 to 233 in 49e2f37

> **Note**
>
> `clippy.toml` or `.clippy.toml` cannot be used to allow/deny lints.

Additionally, the "Clippy book" confusingly seems to contain very similar information to the README. Perhaps a paragraph on this (I guess also mentioning both a ~/.cargo/clippy.toml or a project-local .clippy.toml) should also be added to the "Allowing/Denying Lints" section there as well.

I am not sure to what standards changes to the documentation should conform; I just thought I'd point it out.

@rustbot
Copy link
Collaborator

rustbot commented Oct 7, 2025

☔ The latest upstream changes (possibly f3c020c) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants