Add a file allowing cross-crate configuration of lints #45832
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-dev-tools
Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Right now, if your project has a certain set of lints it wants to use, it needs to repeat the
#![deny(foo)]
entries in every single crate of the project.In the
clippy
project it has frequently been requested (rust-lang/rust-clippy#1313) that we add aclippy.toml
file which would have entries for allowing, warning and denying lints, instead of requiring-A
,-W
or-D
flags to the compiler.I think this is something that should be solved on the rustc side. As a minimal version I propose to add a
--lint-file=foo.toml
or--lint-settings=foo.toml
setting, which is default-filled bycargo
by crawling up the directory tree and looking for alints.toml
orrustc.toml
(or a green bikshed).To reduce repeating the lint modifiers, I propose to use the keys
allow
,deny
,warn
andforbid
ofVec<String>
type:Does this require an RFC?
The text was updated successfully, but these errors were encountered: