Skip to content

Commit 30d8594

Browse files
committed
crater: hook into main.rs
1 parent 5353591 commit 30d8594

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

clippy_dev/src/crater.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn build_clippy() {
6969
}
7070

7171
// the main fn
72-
pub(crate) fn run() {
72+
pub fn run() {
7373
let cargo_clippy_path: PathBuf = PathBuf::from("target/debug/cargo-clippy");
7474
let clippy_driver_path: PathBuf = PathBuf::from("target/debug/cargo-driver");
7575

@@ -88,7 +88,7 @@ pub(crate) fn run() {
8888
);
8989

9090
// download and extract the crates, then run clippy on them and collect clippys warnings
91-
let clippy_lint_results: Vec<String> = krates
91+
let _clippy_lint_results: Vec<String> = krates
9292
.into_iter()
9393
.map(|krate| krate.download_and_extract())
9494
.map(|krate| krate.run_clippy_lints())

clippy_dev/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
22

33
use clap::{App, Arg, ArgMatches, SubCommand};
4-
use clippy_dev::{bless, fmt, new_lint, ra_setup, serve, stderr_length_check, update_lints};
4+
use clippy_dev::{bless, crater, fmt, new_lint, ra_setup, serve, stderr_length_check, update_lints};
55

66
fn main() {
77
let matches = get_clap_config();
@@ -10,6 +10,9 @@ fn main() {
1010
("bless", Some(matches)) => {
1111
bless::bless(matches.is_present("ignore-timestamp"));
1212
},
13+
("crater", Some(_)) => {
14+
crater::run();
15+
},
1316
("fmt", Some(matches)) => {
1417
fmt::run(matches.is_present("check"), matches.is_present("verbose"));
1518
},
@@ -56,6 +59,7 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
5659
.help("Include files updated before clippy was built"),
5760
),
5861
)
62+
.subcommand(SubCommand::with_name("crater").about("run clippy on a set of crates and check output"))
5963
.subcommand(
6064
SubCommand::with_name("fmt")
6165
.about("Run rustfmt on all projects and tests")

0 commit comments

Comments
 (0)