1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/cargo-clippy.md

33 lines
639 B
Markdown
Raw Normal View History

2020-09-12 17:06:27 -03: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}}`
- Treat warnings as errors:
`cargo clippy -- --deny warnings`
2020-09-12 17:06:27 -03:00
- Run checks and ignore warnings:
`cargo clippy -- --allow warnings`
2020-09-12 17:06:27 -03:00
- Apply Clippy suggestions automatically:
2020-09-12 17:06:27 -03:00
`cargo clippy --fix`