diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-12-18 14:28:59 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2021-01-23 02:18:11 +0100 |
| commit | 30d85942cf4fee5148a6b994c9ec8bd1190a5122 (patch) | |
| tree | bff799c6e65322f8af1a0cf976bb7ccc0277e099 | |
| parent | 5353591b1bc7e4fcb886afcd7944619607adb5cb (diff) | |
| download | rust-30d85942cf4fee5148a6b994c9ec8bd1190a5122.tar.gz rust-30d85942cf4fee5148a6b994c9ec8bd1190a5122.zip | |
crater: hook into main.rs
| -rw-r--r-- | clippy_dev/src/crater.rs | 4 | ||||
| -rw-r--r-- | clippy_dev/src/main.rs | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/clippy_dev/src/crater.rs b/clippy_dev/src/crater.rs index 22b04242885..1cf12941c35 100644 --- a/clippy_dev/src/crater.rs +++ b/clippy_dev/src/crater.rs @@ -69,7 +69,7 @@ fn build_clippy() { } // the main fn -pub(crate) fn run() { +pub fn run() { let cargo_clippy_path: PathBuf = PathBuf::from("target/debug/cargo-clippy"); let clippy_driver_path: PathBuf = PathBuf::from("target/debug/cargo-driver"); @@ -88,7 +88,7 @@ pub(crate) fn run() { ); // download and extract the crates, then run clippy on them and collect clippys warnings - let clippy_lint_results: Vec<String> = krates + let _clippy_lint_results: Vec<String> = krates .into_iter() .map(|krate| krate.download_and_extract()) .map(|krate| krate.run_clippy_lints()) diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index 2ea56c42faf..6fb8b6f2899 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -1,7 +1,7 @@ #![cfg_attr(feature = "deny-warnings", deny(warnings))] use clap::{App, Arg, ArgMatches, SubCommand}; -use clippy_dev::{bless, fmt, new_lint, ra_setup, serve, stderr_length_check, update_lints}; +use clippy_dev::{bless, crater, fmt, new_lint, ra_setup, serve, stderr_length_check, update_lints}; fn main() { let matches = get_clap_config(); @@ -10,6 +10,9 @@ fn main() { ("bless", Some(matches)) => { bless::bless(matches.is_present("ignore-timestamp")); }, + ("crater", Some(_)) => { + crater::run(); + }, ("fmt", Some(matches)) => { fmt::run(matches.is_present("check"), matches.is_present("verbose")); }, @@ -56,6 +59,7 @@ fn get_clap_config<'a>() -> ArgMatches<'a> { .help("Include files updated before clippy was built"), ), ) + .subcommand(SubCommand::with_name("crater").about("run clippy on a set of crates and check output")) .subcommand( SubCommand::with_name("fmt") .about("Run rustfmt on all projects and tests") |
