mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-05 12:45:59 +02:00
cargo-clippy: add page (#4316)
This commit is contained in:
parent
7ff0a69be8
commit
35e14c57c5
1 changed files with 32 additions and 0 deletions
32
pages/common/cargo-clippy.md
Normal file
32
pages/common/cargo-clippy.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# 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:
|
||||
|
||||
`RUSTFLAGS="-Dwarnings" cargo clippy -- -D warnings`
|
||||
|
||||
- Run checks and ignore warnings:
|
||||
|
||||
`cargo clippy -- -A warnings`
|
||||
|
||||
- Apply Clippy suggestion automatically (experimental and only supported on the nightly channel):
|
||||
|
||||
`cargo clippy --fix -Z unstable-options`
|
Loading…
Add table
Reference in a new issue