You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some lints that are configured via clippy.toml may need to react to conditional compilation.
For instance, for disallowed_macros, a project may want to warn only about a particular macro in some configurations (e.g. CI vs. development).
It could also be useful if Clippy were to identify unexpected paths to prevent mistakes (#11432), since it would allow the user to e.g. remove a given macro from the list if the macro is compiled out.
A workaround could be users generating Clippy's config file on the fly.
Perhaps Clippy could instead allow to be configured within the Rust source code (step-by-step), so that the #[cfg] syntax/machinery is reused, but I imagine there is a reason it was not done there (e.g. workspaces sharing config easily?), e.g.
// `m1` always disallowed.#[clippy_config(disallowed_macros,"m1")]// `m2` only disallowed if `X`.#[cfg(X)]#[clippy_config(disallowed_macros,"m2")]
The text was updated successfully, but these errors were encountered:
Some lints that are configured via
clippy.toml
may need to react to conditional compilation.For instance, for
disallowed_macros
, a project may want to warn only about a particular macro in some configurations (e.g. CI vs. development).It could also be useful if Clippy were to identify unexpected paths to prevent mistakes (#11432), since it would allow the user to e.g. remove a given macro from the list if the macro is compiled out.
A workaround could be users generating Clippy's config file on the fly.
Perhaps Clippy could instead allow to be configured within the Rust source code (step-by-step), so that the
#[cfg]
syntax/machinery is reused, but I imagine there is a reason it was not done there (e.g. workspaces sharing config easily?), e.g.The text was updated successfully, but these errors were encountered: