rust-lang / rust-lang/rust-clippy

Allow specifying both project-wide and package-specific `clippy.toml` settings

Open
#7,353 9 comments 15 reactions 1 assignee View on GitHub

@Centri3 is already working on this.

Since Jun 11, 2023.

C-an-interesting-project E-medium
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

For Ruma, I would like to have both project-wide and package-specific .clippy.toml settings:

  • msrv (and import_rename once it's available) as a project-wide setting
  • Possibly a project-specific msrv override
  • disallowed_type project-specific setting to disallow HashMap / HashSet use within proc-macros

It seems like this is not currently possible, with the first .clippy.toml found in one of the parent directories of the package being checked being used for all settings. Maybe an alternative to the current filesystem hierarchy based config lookup¹ would be to only search the package dir² and the workspace root³ for clippy configuration and make any settings in the former overwrite settings from the latter?

¹ which AFAIK has proved problematic for Cargo, with some people wanting to move certain settings to Cargo.toml for better reproducability
² CARGO_MANIFEST_PATH
³ workspace_root in the cargo metadata --format-version 1 output

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.