about summary refs log tree commit diff
path: root/clippy_dev/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'clippy_dev/src/main.rs')
-rw-r--r--clippy_dev/src/main.rs38
1 files changed, 36 insertions, 2 deletions
diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs
index ebf8f38d490..8dd2b7f9534 100644
--- a/clippy_dev/src/main.rs
+++ b/clippy_dev/src/main.rs
@@ -76,7 +76,8 @@ fn main() {
         },
         ("lint", Some(matches)) => {
             let path = matches.value_of("path").unwrap();
-            lint::run(path);
+            let args = matches.values_of("args").into_iter().flatten();
+            lint::run(path, args);
         },
         ("rename_lint", Some(matches)) => {
             let old_name = matches.value_of("old_name").unwrap();
@@ -123,7 +124,7 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                  * the lint count in README.md is correct\n \
                  * the changelog contains markdown link references at the bottom\n \
                  * all lint groups include the correct lints\n \
-                 * lint modules in `clippy_lints/*` are visible in `src/lifb.rs` via `pub mod`\n \
+                 * lint modules in `clippy_lints/*` are visible in `src/lib.rs` via `pub mod`\n \
                  * all lints are registered in the lint store",
                 )
                 .arg(Arg::with_name("print-only").long("print-only").help(
@@ -278,11 +279,44 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                         Lint a package directory:
                             cargo dev lint tests/ui-cargo/wildcard_dependencies/fail
                             cargo dev lint ~/my-project
+
+                        Run rustfix:
+                            cargo dev lint ~/my-project -- --fix
+
+                        Set lint levels:
+                            cargo dev lint file.rs -- -W clippy::pedantic
+                            cargo dev lint ~/my-project -- -- -W clippy::pedantic
                 "})
                 .arg(
                     Arg::with_name("path")
                         .required(true)
                         .help("The path to a file or package directory to lint"),
+                )
+                .arg(
+                    Arg::with_name("args")
+                        .multiple(true)
+                        .help("Pass extra arguments to cargo/clippy-driver"),
+                ),
+        )
+        .subcommand(
+            SubCommand::with_name("rename_lint")
+                .about("Renames the given lint")
+                .arg(
+                    Arg::with_name("old_name")
+                        .index(1)
+                        .required(true)
+                        .help("The name of the lint to rename"),
+                )
+                .arg(
+                    Arg::with_name("new_name")
+                        .index(2)
+                        .required_unless("uplift")
+                        .help("The new name of the lint"),
+                )
+                .arg(
+                    Arg::with_name("uplift")
+                        .long("uplift")
+                        .help("This lint will be uplifted into rustc"),
                 ),
         )
         .subcommand(