Skip to content

Read clippy configuration normally found in clippy.toml from Cargo.toml #10890

Open
@lopopolo

Description

@lopopolo

Description

Cross-posting from:

I love seeing config converging into Cargo.toml. This will help to address some papercuts when working in workspaces with many crates.

I know it is out of scope for this tracking issue, but mentioning it here since it seems relevant to the general idea. Other first party Rust tools have lots of configuration files of their own. I'd love rustup, rustfmt, and clippy to look in Cargo.toml for the configuration that today is found in rust-toolchain.toml, rustfmt.toml, and clippy.toml.

Originally posted by @lopopolo in rust-lang/cargo#12115 (comment)

I would like to reduce the proliferation of configuration files in the root of my repositories as much as possible. Would it be possible and/or an accepted feature to read the config normally found in clippy.toml (like doc-valid-idents) from Cargo.toml?

I don't believe this requires dedicated support from the Cargo team and could be done today with tool-specific metadata, like this example for configuring docs.rs:

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

Version

rustc 1.70.0 (90c541806 2023-05-31)
binary: rustc
commit-hash: 90c541806f23a127002de5b4038be731ba1458ca
commit-date: 2023-05-31
host: x86_64-apple-darwin
release: 1.70.0
LLVM version: 16.0.2

Additional Labels

@rustbot label +C-question

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions