2020-09-12 21:06:27 +01:00
# 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 clippy`
- Require that `Cargo.lock` is up to date:
`cargo clippy --locked`
- Run checks on all packages in the workspace:
`cargo clippy --workspace`
- Run checks for a package:
`cargo clippy --package {{package}}`
2024-07-19 12:52:56 +01:00
- 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 -- --warn clippy::{{lint_group}}`
2020-09-12 21:06:27 +01:00
- Treat warnings as errors:
2021-09-12 20:07:08 +01:00
`cargo clippy -- --deny warnings`
2020-09-12 21:06:27 +01:00
- Run checks and ignore warnings:
2021-09-12 20:07:08 +01:00
`cargo clippy -- --allow warnings`
2020-09-12 21:06:27 +01:00
2021-09-12 20:07:08 +01:00
- Apply Clippy suggestions automatically:
2020-09-12 21:06:27 +01:00
2021-09-12 20:07:08 +01:00
`cargo clippy --fix`