mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-26 22:50:56 +00:00
README: Add subsection on running Clippy as a rustc wrapper
This is useful for projects that do not use cargo. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
parent
a5c5c8f3b0
commit
6b8b43c0d1
1 changed files with 17 additions and 0 deletions
17
README.md
17
README.md
|
@ -98,6 +98,23 @@ If you want to run Clippy **only** on the given crate, use the `--no-deps` optio
|
||||||
cargo clippy -p example -- --no-deps
|
cargo clippy -p example -- --no-deps
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### As a rustc replacement (`clippy-driver`)
|
||||||
|
|
||||||
|
Clippy can also be used in projects that do not use cargo. To do so, you will need to replace
|
||||||
|
your `rustc` compilation commands with `clippy-driver`. For example, if your project runs:
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
rustc --edition 2018 -Cpanic=abort foo.rs
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, to enable Clippy, you will need to call:
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
clippy-driver --edition 2018 -Cpanic=abort foo.rs
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that `rustc` will still run, i.e. it will still emit the output files it normally does.
|
||||||
|
|
||||||
### Travis CI
|
### Travis CI
|
||||||
|
|
||||||
You can add Clippy to Travis CI in the same way you use it locally:
|
You can add Clippy to Travis CI in the same way you use it locally:
|
||||||
|
|
Loading…
Reference in a new issue