diff options
| author | bors <bors@rust-lang.org> | 2021-02-24 09:31:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-24 09:31:26 +0000 |
| commit | 045d3f34f87a620df0c9c96f5356662a5752faff (patch) | |
| tree | c1944ad9b2e15f463b851fa7930b8f8cbfa2eb83 | |
| parent | a2c25fa9f0a35d38506918a41f893231f67c5b24 (diff) | |
| parent | 6b8b43c0d1ed7a46c6e93366eebb8d6ef501cdae (diff) | |
| download | rust-045d3f34f87a620df0c9c96f5356662a5752faff.tar.gz rust-045d3f34f87a620df0c9c96f5356662a5752faff.zip | |
Auto merge of #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
| -rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md index a4928e17e6a..3cc03cf3603 100644 --- a/README.md +++ b/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 ``` +### 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 You can add Clippy to Travis CI in the same way you use it locally: |
