Skip to content

Commit 83fcf95

Browse files
committed
rename cargo dev crater to cargo dev lintcheck
1 parent 48fc948 commit 83fcf95

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

.cargo/config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[alias]
22
uitest = "test --test compile-test"
33
dev = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
4-
dev-crater = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --features crater -- crater"
4+
dev-lintcheck = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --features lintcheck -- lintcheck"
55

66
[build]
77
rustflags = ["-Zunstable-options"]

clippy_dev/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ ureq = { version = "2.0.0-rc3", optional = true }
2121
walkdir = "2"
2222

2323
[features]
24-
crater = ["flate2", "serde_json", "tar", "toml", "ureq", "serde"]
24+
lintcheck = ["flate2", "serde_json", "tar", "toml", "ureq", "serde"]
2525
deny-warnings = []
File renamed without changes.

clippy_dev/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use std::path::{Path, PathBuf};
1111
use walkdir::WalkDir;
1212

1313
pub mod bless;
14-
pub mod crater;
1514
pub mod fmt;
15+
pub mod lintcheck;
1616
pub mod new_lint;
1717
pub mod ra_setup;
1818
pub mod serve;

clippy_dev/src/crater.rs clippy_dev/src/lintcheck.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// When a new lint is introduced, we can search the results for new warnings and check for false
55
// positives.
66

7-
#![cfg(feature = "crater")]
7+
#![cfg(feature = "lintcheck")]
88
#![allow(clippy::filter_map)]
99

1010
use crate::clippy_project_root;
@@ -69,16 +69,16 @@ impl std::fmt::Display for ClippyWarning {
6969

7070
impl CrateSource {
7171
fn download_and_extract(&self) -> Crate {
72-
let extract_dir = PathBuf::from("target/crater/crates");
73-
let krate_download_dir = PathBuf::from("target/crater/downloads");
72+
let extract_dir = PathBuf::from("target/lintcheck/crates");
73+
let krate_download_dir = PathBuf::from("target/lintcheck/downloads");
7474

7575
// url to download the crate from crates.io
7676
let url = format!(
7777
"https://crates.io/api/v1/crates/{}/{}/download",
7878
self.name, self.version
7979
);
8080
println!("Downloading and extracting {} {} from {}", self.name, self.version, url);
81-
let _ = std::fs::create_dir("target/crater/");
81+
let _ = std::fs::create_dir("target/lintcheck/");
8282
let _ = std::fs::create_dir(&krate_download_dir);
8383
let _ = std::fs::create_dir(&extract_dir);
8484

@@ -112,7 +112,7 @@ impl Crate {
112112
println!("Linting {} {}...", &self.name, &self.version);
113113
let cargo_clippy_path = std::fs::canonicalize(cargo_clippy_path).unwrap();
114114

115-
let shared_target_dir = clippy_project_root().join("target/crater/shared_target_dir/");
115+
let shared_target_dir = clippy_project_root().join("target/lintcheck/shared_target_dir/");
116116

117117
let all_output = std::process::Command::new(cargo_clippy_path)
118118
.env("CARGO_TARGET_DIR", shared_target_dir)
@@ -149,9 +149,9 @@ fn build_clippy() {
149149
.expect("Failed to build clippy!");
150150
}
151151

152-
// get a list of CrateSources we want to check from a "crater_crates.toml" file.
152+
// get a list of CrateSources we want to check from a "lintcheck_crates.toml" file.
153153
fn read_crates() -> Vec<CrateSource> {
154-
let toml_path = PathBuf::from("clippy_dev/crater_crates.toml");
154+
let toml_path = PathBuf::from("clippy_dev/lintcheck_crates.toml");
155155
let toml_content: String =
156156
std::fs::read_to_string(&toml_path).unwrap_or_else(|_| panic!("Failed to read {}", toml_path.display()));
157157
let crate_list: CrateList =
@@ -231,7 +231,7 @@ pub fn run(clap_config: &ArgMatches) {
231231
// if we don't have the specified crated in the .toml, throw an error
232232
if !crates.iter().any(|krate| krate.name == only_one_crate) {
233233
eprintln!(
234-
"ERROR: could not find crate '{}' in clippy_dev/crater_crates.toml",
234+
"ERROR: could not find crate '{}' in clippy_dev/lintcheck_crates.toml",
235235
only_one_crate
236236
);
237237
std::process::exit(1);
@@ -279,8 +279,8 @@ pub fn run(clap_config: &ArgMatches) {
279279
all_msgs.push("\n\n\n\nStats\n\n".into());
280280
all_msgs.push(stats_formatted);
281281

282-
// save the text into mini-crater/logs.txt
282+
// save the text into lintcheck-logs/logs.txt
283283
let mut text = clippy_ver; // clippy version number on top
284284
text.push_str(&format!("\n{}", all_msgs.join("")));
285-
write("mini-crater/logs.txt", text).unwrap();
285+
write("lintcheck-logs/logs.txt", text).unwrap();
286286
}

clippy_dev/src/main.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use clap::{App, Arg, ArgMatches, SubCommand};
44
use clippy_dev::{bless, fmt, new_lint, ra_setup, serve, stderr_length_check, update_lints};
55

6-
#[cfg(feature = "crater")]
7-
use clippy_dev::crater;
6+
#[cfg(feature = "lintcheck")]
7+
use clippy_dev::lintcheck;
88

99
fn main() {
1010
let matches = get_clap_config();
@@ -13,9 +13,9 @@ fn main() {
1313
("bless", Some(matches)) => {
1414
bless::bless(matches.is_present("ignore-timestamp"));
1515
},
16-
#[cfg(feature = "crater")]
17-
("crater", Some(matches)) => {
18-
crater::run(&matches);
16+
#[cfg(feature = "lintcheck")]
17+
("lintcheck", Some(matches)) => {
18+
lintcheck::run(&matches);
1919
},
2020
("fmt", Some(matches)) => {
2121
fmt::run(matches.is_present("check"), matches.is_present("verbose"));
@@ -53,8 +53,8 @@ fn main() {
5353
}
5454

5555
fn get_clap_config<'a>() -> ArgMatches<'a> {
56-
#[cfg(feature = "crater")]
57-
let crater_sbcmd = SubCommand::with_name("crater")
56+
#[cfg(feature = "lintcheck")]
57+
let lintcheck_sbcmd = SubCommand::with_name("lintcheck")
5858
.about("run clippy on a set of crates and check output")
5959
.arg(
6060
Arg::with_name("only")
@@ -183,8 +183,8 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
183183
.arg(Arg::with_name("lint").help("Which lint's page to load initially (optional)")),
184184
);
185185

186-
#[cfg(feature = "crater")]
187-
let app = app.subcommand(crater_sbcmd);
186+
#[cfg(feature = "lintcheck")]
187+
let app = app.subcommand(lintcheck_sbcmd);
188188

189189
app.get_matches()
190190
}
File renamed without changes.

0 commit comments

Comments
 (0)