Skip to content

Commit

Permalink
README: Add subsection on running Clippy as a rustc wrapper
Browse files Browse the repository at this point in the history
This is useful for projects that do not use cargo.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
  • Loading branch information
ojeda committed Feb 23, 2021
1 parent a5c5c8f commit 22b86b4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

### As a rustc wrapper (`clippy-driver rustc`)

Clippy can also be used in projects that do not use cargo. To do so, you will need to wrap
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 rustc --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

You can add Clippy to Travis CI in the same way you use it locally:
Expand Down

0 comments on commit 22b86b4

Please sign in to comment.