Note: I'm willing to write the PR for this feature, just posting an issue to get maintainer feedback first
Problem
The clippy aspect currently uses a single global clippy.toml for the entire workspace. There is no way for individual crates to provide their own clippy configuration file.
This matters for lints like disallowed-types, too-many-arguments-threshold, type-complexity-threshold, etc. that require clippy.toml for their configuration. A workspace with many crates often needs different thresholds or disallowed-type lists per crate, but today the only option is a single workspace-wide config.
Root cause
The clippy aspect hardcodes CLIPPY_CONF_DIR from a single private attribute:
rust/private/clippy.bzl L281-285:
"_config": attr.label(
doc = "The `clippy.toml` file used for configuration",
allow_single_file = True,
default = Label("//rust/settings:clippy.toml"),
),
Proposed solution
Extend the existing lint_config / LintsInfo mechanism to support a per-target clippy config file. This is the natural place since lint_config already provides per-target clippy flags.
Note: I'm willing to write the PR for this feature, just posting an issue to get maintainer feedback first
Problem
The clippy aspect currently uses a single global
clippy.tomlfor the entire workspace. There is no way for individual crates to provide their own clippy configuration file.This matters for lints like
disallowed-types,too-many-arguments-threshold,type-complexity-threshold, etc. that requireclippy.tomlfor their configuration. A workspace with many crates often needs different thresholds or disallowed-type lists per crate, but today the only option is a single workspace-wide config.Root cause
The clippy aspect hardcodes
CLIPPY_CONF_DIRfrom a single private attribute:rust/private/clippy.bzlL281-285:Proposed solution
Extend the existing
lint_config/LintsInfomechanism to support a per-target clippy config file. This is the natural place sincelint_configalready provides per-target clippy flags.