I am running clippy on some rust project, its gives me one error i.e. [deny(clippy::cast_ptr_alignment] and stop compiling other modules. Is it possible to convert that error from deny to allow and let the clippy to compiles other modules of my rust project. Please note that i don’t want to disable such deny errors, because if i do this, then i could not see whether this deny error is exist in other modules or not. Actually i want to convert all deny error to allow warnings, so that I would be able to see where these kind of errors exist in which modules of my project.
Actually, I need to change the deny errors to allow warnings, so that I could see all deny errors. Because , if there is any one deny error, then that module (which consist of deny error), could not be compiled. So, I have two options (but i am not sure, whether i can do it or not );
- modify the source of clippy , build it again, and then use it without install or
- change my source code (… #![allow(clippy::all)]) and then do (but i don’t know how to do !) …
Anyone here can help me… Thanks in advance
Some lints can be configured in a TOML file named
.clippy.toml. It contains a basic
variable = valuemapping eg.
blacklisted-names = ["toto", "tata", "titi"] cognitive-complexity-threshold = 30
See the list of lints for more information about which lints can be configured and the
meaning of the variables.
To deactivate the “for further information visit lint-link” message you can
You can add options to your code to
the whole set of
Warnlints using the
clippylint group (
all lints using both the
clippy::pedanticlint groups (
#![deny(clippy::pedantic)]). Note that
clippy::pedanticcontains some very aggressive
lints prone to false positives.
only some lints (
#![deny(clippy::single_match, clippy::box_vec)], etc)
denycan be limited to a single function or module using
denyproduces errors instead of warnings.
If you do not want to include your lint levels in your code, you can globally enable/disable lints by passing extra flags to Clippy during the run:
cargo clippy -- -A clippy::lint_namewill run Clippy with
cargo clippy -- -W clippy::lint_namewill run it with that enabled. This also works with lint groups. For example you can run Clippy with warnings for all lints enabled:
cargo clippy -- -W clippy::pedantic
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.