about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-07-29 12:16:06 +0200
committerflip1995 <philipp.krones@embecosm.com>2021-07-29 12:16:06 +0200
commit2b20f49841dbfb773d47c008b4278885435483ac (patch)
treed0799017c6caa0d09cced4ef5e3726abb81b93ae /src
parent5331fea87543eee06da7eef9f9854e89e9b5c7f3 (diff)
downloadrust-2b20f49841dbfb773d47c008b4278885435483ac.tar.gz
rust-2b20f49841dbfb773d47c008b4278885435483ac.zip
Merge commit '0cce3f643bfcbb92d5a1bb71858c9cbaff749d6b' into clippyup
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());
         }