Closed crumblingstatue closed 8 years ago
Another option would be to pass a --cfg argument to the compiler, so the user can then conditionally set lint levels with .e.g. #[cfg_attr(clippy, allow(cyclomatic_complexity))]
. Apparently, clippy itself cannot do this.
I'd like to set allow / warn / deny on a file per file basis.
@W4RH4WK
This tool is deprecated. Now rust-clippy provides its own cargo-clippy tool.
I'm closing this issue in light of that.
As for allow/warn/deny on a per file basis, you can add a clippy
feature to your Cargo.toml
, and run cargo-clippy
(the one provided by rust-clippy) with --features=clippy
. Then you can use the cfg_attr(clippy, allow(cyclomatic_complexity))
syntax I mentioned above.
This would allow projects to enable/disable specific lints without users having to pass command line arguments every time they want to run clippy.
See https://github.com/Manishearth/rust-clippy/issues/574 for more information.
The configuration file could be something as simple as this.
cargo-clippy.conf
cargo-clippy would read this file, and pass the appropriate flags (
-A cyclomatic_complexity -D bad_bit_mask -W string_add
).