about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-07-29 11:14:25 +0200
committerflip1995 <philipp.krones@embecosm.com>2021-07-29 11:14:25 +0200
commit490beda6be3b45f419b2beb294f86e13754b91f9 (patch)
tree6488de5867abe18648b4418fccfb41b6fe080c2c /src
parent5331fea87543eee06da7eef9f9854e89e9b5c7f3 (diff)
parent92ca25b3ec8cef291f1d3b37bfd01d3cce8609e2 (diff)
downloadrust-490beda6be3b45f419b2beb294f86e13754b91f9.tar.gz
rust-490beda6be3b45f419b2beb294f86e13754b91f9.zip
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'src')
-rw-r--r--src/main.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 6bd4123ddeb..7589f42a7b4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -14,6 +14,8 @@ Usage:
     cargo clippy [options] [--] [<opts>...]
 
 Common options:
+    --no-deps                Run Clippy only on the given crate, without linting the dependencies 
+    --fix                    Automatically apply lint suggestions. This flag implies `--no-deps`
     -h, --help               Print this message
     -V, --version            Print version info and exit
 
@@ -71,6 +73,7 @@ impl ClippyCmd {
     {
         let mut cargo_subcommand = "check";
         let mut args = vec![];
+        let mut clippy_args: Vec<String> = vec![];
 
         for arg in old_args.by_ref() {
             match arg.as_str() {
@@ -78,6 +81,10 @@ impl ClippyCmd {
                     cargo_subcommand = "fix";
                     continue;
                 },
+                "--no-deps" => {
+                    clippy_args.push("--no-deps".into());
+                    continue;
+                },
                 "--" => break,
                 _ => {},
             }
@@ -85,7 +92,7 @@ impl ClippyCmd {
             args.push(arg);
         }
 
-        let mut clippy_args: Vec<String> = old_args.collect();
+        clippy_args.append(&mut (old_args.collect()));
         if cargo_subcommand == "fix" && !clippy_args.iter().any(|arg| arg == "--no-deps") {
             clippy_args.push("--no-deps".into());
         }