snippetbashTip
cargo clippy — A collection of lints to catch common mistakes and improve your Rust code. More information: <https:
Viewed 0 times
catchcommandmistakescollectionclicargo clippylintscommon
Problem
How to use the
cargo clippy command: A collection of lints to catch common mistakes and improve your Rust code. More information: <https://github.com/rust-lang/rust-clippy>.Solution
cargo clippy — A collection of lints to catch common mistakes and improve your Rust code. More information: <https://github.com/rust-lang/rust-clippy>.Run checks over the code in the current directory:
cargo clippyRequire that
Cargo.lock is up to date:cargo clippy --lockedRun checks on all packages in the workspace:
cargo clippy --workspaceRun checks for a package:
cargo clippy --package {{package}}Run checks for a lint group (see <https://rust-lang.github.io/rust-clippy/stable/index.html#?groups=cargo,complexity,correctness,deprecated,nursery,pedantic,perf,restriction,style,suspicious>):
cargo clippy -- {{[-W|--warn]}} clippy::{{lint_group}}Treat warnings as errors:
cargo clippy -- {{[-D|--deny]}} warningsRun checks and ignore warnings:
cargo clippy -- {{[-A|--allow]}} warningsApply Clippy suggestions automatically:
cargo clippy --fixCode Snippets
Run checks over the code in the current directory
cargo clippyRequire that `Cargo.lock` is up to date
cargo clippy --lockedRun checks on all packages in the workspace
cargo clippy --workspaceRun checks for a package
cargo clippy --package {{package}}Run checks for a lint group (see <https://rust-lang.github.io/rust-clippy/stable/index.html#?groups=cargo,complexity,correctness,deprecated,nursery,pedantic,perf,restriction,style,suspicious>)
cargo clippy -- {{[-W|--warn]}} clippy::{{lint_group}}Context
tldr-pages: common/cargo clippy
Revisions (0)
No revisions yet.