Skip to content

Commit ccfaa33

Browse files
committed
cargo dev crater: share target dir between clippy runs, enable pedantic and cargo lints, ignore tokei for now.
1 parent 1e5ac1d commit ccfaa33

File tree

2 files changed

+2892
-28
lines changed

2 files changed

+2892
-28
lines changed

clippy_dev/src/crater.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use crate::clippy_project_root;
12
use std::path::PathBuf;
23
use std::process::Command;
3-
44
// represents an archive we download from crates.io
55
#[derive(Debug)]
66
struct KrateSource {
@@ -75,18 +75,19 @@ impl Krate {
7575
println!("Linting {} {}...", &self.name, &self.version);
7676
let cargo_clippy_path = std::fs::canonicalize(cargo_clippy_path).unwrap();
7777

78+
let shared_target_dir = clippy_project_root().join("target/crater/shared_target_dir/");
79+
7880
let all_output = std::process::Command::new(cargo_clippy_path)
81+
.env("CARGO_TARGET_DIR", shared_target_dir)
7982
// lint warnings will look like this:
8083
// src/cargo/ops/cargo_compile.rs:127:35: warning: usage of `FromIterator::from_iter`
8184
.args(&[
8285
"--",
8386
"--message-format=short",
8487
"--",
8588
"--cap-lints=warn",
86-
/* "--",
8789
"-Wclippy::pedantic",
88-
"--",
89-
"-Wclippy::cargo", */
90+
"-Wclippy::cargo",
9091
])
9192
.current_dir(&self.path)
9293
.output()
@@ -135,7 +136,7 @@ pub fn run() {
135136
KrateSource::new("cargo", "0.49.0"),
136137
KrateSource::new("iron", "0.6.1"),
137138
KrateSource::new("ripgrep", "12.1.1"),
138-
KrateSource::new("tokei", "12.0.4"),
139+
//KrateSource::new("tokei", "12.0.4"),
139140
KrateSource::new("xsv", "0.13.0"),
140141
KrateSource::new("serde", "1.0.118"),
141142
KrateSource::new("rayon", "1.5.0"),
@@ -149,8 +150,7 @@ pub fn run() {
149150
KrateSource::new("proc-macro2", "1.0.24"),
150151
KrateSource::new("bitflags", "1.2.1"),
151152
KrateSource::new("log", "0.4.11"),
152-
KrateSource::new("regex", "1.4.2")
153-
//
153+
KrateSource::new("regex", "1.4.2"),
154154
];
155155

156156
println!("Compiling clippy...");

0 commit comments

Comments
 (0)