From 22b86b450a060061168d0c900106fa9ed8dff4d0 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Tue, 23 Feb 2021 15:54:40 +0100 Subject: [PATCH] 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 --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index a4928e17e6a9..9d7e17c2e5e6 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 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: