Skip to content

Commit 045d3f3

Browse files
committed
Auto merge of rust-lang#6782 - ojeda:readme-as-wrapper, r=flip1995
README: Add subsection on running Clippy as a rustc wrapper This is useful for projects that do not use cargo. changelog: README: Add subsection on running Clippy as a rustc wrapper
2 parents a2c25fa + 6b8b43c commit 045d3f3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@ If you want to run Clippy **only** on the given crate, use the `--no-deps` optio
9898
cargo clippy -p example -- --no-deps
9999
```
100100

101+
### As a rustc replacement (`clippy-driver`)
102+
103+
Clippy can also be used in projects that do not use cargo. To do so, you will need to replace
104+
your `rustc` compilation commands with `clippy-driver`. For example, if your project runs:
105+
106+
```terminal
107+
rustc --edition 2018 -Cpanic=abort foo.rs
108+
```
109+
110+
Then, to enable Clippy, you will need to call:
111+
112+
```terminal
113+
clippy-driver --edition 2018 -Cpanic=abort foo.rs
114+
```
115+
116+
Note that `rustc` will still run, i.e. it will still emit the output files it normally does.
117+
101118
### Travis CI
102119

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

0 commit comments

Comments
 (0)