From 83fcf95f52c6e4c9dbb840ce9e562f2d5c859cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 23 Jan 2021 00:25:29 +0100 Subject: [PATCH] rename cargo dev crater to cargo dev lintcheck --- .cargo/config | 2 +- clippy_dev/Cargo.toml | 2 +- ...ater_crates.toml => lintcheck_crates.toml} | 0 clippy_dev/src/lib.rs | 2 +- clippy_dev/src/{crater.rs => lintcheck.rs} | 20 +++++++++---------- clippy_dev/src/main.rs | 18 ++++++++--------- {mini-crater => lintcheck-logs}/logs.txt | 0 7 files changed, 22 insertions(+), 22 deletions(-) rename clippy_dev/{crater_crates.toml => lintcheck_crates.toml} (100%) rename clippy_dev/src/{crater.rs => lintcheck.rs} (94%) rename {mini-crater => lintcheck-logs}/logs.txt (100%) diff --git a/.cargo/config b/.cargo/config index 220e74f5d..1142cc470 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,7 +1,7 @@ [alias] uitest = "test --test compile-test" dev = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --" -dev-crater = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --features crater -- crater" +dev-lintcheck = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --features lintcheck -- lintcheck" [build] rustflags = ["-Zunstable-options"] diff --git a/clippy_dev/Cargo.toml b/clippy_dev/Cargo.toml index 4268ef802..f48c1ee5e 100644 --- a/clippy_dev/Cargo.toml +++ b/clippy_dev/Cargo.toml @@ -21,5 +21,5 @@ ureq = { version = "2.0.0-rc3", optional = true } walkdir = "2" [features] -crater = ["flate2", "serde_json", "tar", "toml", "ureq", "serde"] +lintcheck = ["flate2", "serde_json", "tar", "toml", "ureq", "serde"] deny-warnings = [] diff --git a/clippy_dev/crater_crates.toml b/clippy_dev/lintcheck_crates.toml similarity index 100% rename from clippy_dev/crater_crates.toml rename to clippy_dev/lintcheck_crates.toml diff --git a/clippy_dev/src/lib.rs b/clippy_dev/src/lib.rs index 4873769b3..24d70d433 100644 --- a/clippy_dev/src/lib.rs +++ b/clippy_dev/src/lib.rs @@ -11,8 +11,8 @@ use std::path::{Path, PathBuf}; use walkdir::WalkDir; pub mod bless; -pub mod crater; pub mod fmt; +pub mod lintcheck; pub mod new_lint; pub mod ra_setup; pub mod serve; diff --git a/clippy_dev/src/crater.rs b/clippy_dev/src/lintcheck.rs similarity index 94% rename from clippy_dev/src/crater.rs rename to clippy_dev/src/lintcheck.rs index 98a4af359..e2099ff98 100644 --- a/clippy_dev/src/crater.rs +++ b/clippy_dev/src/lintcheck.rs @@ -4,7 +4,7 @@ // When a new lint is introduced, we can search the results for new warnings and check for false // positives. -#![cfg(feature = "crater")] +#![cfg(feature = "lintcheck")] #![allow(clippy::filter_map)] use crate::clippy_project_root; @@ -69,8 +69,8 @@ impl std::fmt::Display for ClippyWarning { impl CrateSource { fn download_and_extract(&self) -> Crate { - let extract_dir = PathBuf::from("target/crater/crates"); - let krate_download_dir = PathBuf::from("target/crater/downloads"); + let extract_dir = PathBuf::from("target/lintcheck/crates"); + let krate_download_dir = PathBuf::from("target/lintcheck/downloads"); // url to download the crate from crates.io let url = format!( @@ -78,7 +78,7 @@ impl CrateSource { self.name, self.version ); println!("Downloading and extracting {} {} from {}", self.name, self.version, url); - let _ = std::fs::create_dir("target/crater/"); + let _ = std::fs::create_dir("target/lintcheck/"); let _ = std::fs::create_dir(&krate_download_dir); let _ = std::fs::create_dir(&extract_dir); @@ -112,7 +112,7 @@ impl Crate { println!("Linting {} {}...", &self.name, &self.version); let cargo_clippy_path = std::fs::canonicalize(cargo_clippy_path).unwrap(); - let shared_target_dir = clippy_project_root().join("target/crater/shared_target_dir/"); + let shared_target_dir = clippy_project_root().join("target/lintcheck/shared_target_dir/"); let all_output = std::process::Command::new(cargo_clippy_path) .env("CARGO_TARGET_DIR", shared_target_dir) @@ -149,9 +149,9 @@ fn build_clippy() { .expect("Failed to build clippy!"); } -// get a list of CrateSources we want to check from a "crater_crates.toml" file. +// get a list of CrateSources we want to check from a "lintcheck_crates.toml" file. fn read_crates() -> Vec { - let toml_path = PathBuf::from("clippy_dev/crater_crates.toml"); + let toml_path = PathBuf::from("clippy_dev/lintcheck_crates.toml"); let toml_content: String = std::fs::read_to_string(&toml_path).unwrap_or_else(|_| panic!("Failed to read {}", toml_path.display())); let crate_list: CrateList = @@ -231,7 +231,7 @@ pub fn run(clap_config: &ArgMatches) { // if we don't have the specified crated in the .toml, throw an error if !crates.iter().any(|krate| krate.name == only_one_crate) { eprintln!( - "ERROR: could not find crate '{}' in clippy_dev/crater_crates.toml", + "ERROR: could not find crate '{}' in clippy_dev/lintcheck_crates.toml", only_one_crate ); std::process::exit(1); @@ -279,8 +279,8 @@ pub fn run(clap_config: &ArgMatches) { all_msgs.push("\n\n\n\nStats\n\n".into()); all_msgs.push(stats_formatted); - // save the text into mini-crater/logs.txt + // save the text into lintcheck-logs/logs.txt let mut text = clippy_ver; // clippy version number on top text.push_str(&format!("\n{}", all_msgs.join(""))); - write("mini-crater/logs.txt", text).unwrap(); + write("lintcheck-logs/logs.txt", text).unwrap(); } diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index c47aabc2e..e7a298a37 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -3,8 +3,8 @@ use clap::{App, Arg, ArgMatches, SubCommand}; use clippy_dev::{bless, fmt, new_lint, ra_setup, serve, stderr_length_check, update_lints}; -#[cfg(feature = "crater")] -use clippy_dev::crater; +#[cfg(feature = "lintcheck")] +use clippy_dev::lintcheck; fn main() { let matches = get_clap_config(); @@ -13,9 +13,9 @@ fn main() { ("bless", Some(matches)) => { bless::bless(matches.is_present("ignore-timestamp")); }, - #[cfg(feature = "crater")] - ("crater", Some(matches)) => { - crater::run(&matches); + #[cfg(feature = "lintcheck")] + ("lintcheck", Some(matches)) => { + lintcheck::run(&matches); }, ("fmt", Some(matches)) => { fmt::run(matches.is_present("check"), matches.is_present("verbose")); @@ -53,8 +53,8 @@ fn main() { } fn get_clap_config<'a>() -> ArgMatches<'a> { - #[cfg(feature = "crater")] - let crater_sbcmd = SubCommand::with_name("crater") + #[cfg(feature = "lintcheck")] + let lintcheck_sbcmd = SubCommand::with_name("lintcheck") .about("run clippy on a set of crates and check output") .arg( Arg::with_name("only") @@ -183,8 +183,8 @@ fn get_clap_config<'a>() -> ArgMatches<'a> { .arg(Arg::with_name("lint").help("Which lint's page to load initially (optional)")), ); - #[cfg(feature = "crater")] - let app = app.subcommand(crater_sbcmd); + #[cfg(feature = "lintcheck")] + let app = app.subcommand(lintcheck_sbcmd); app.get_matches() } diff --git a/mini-crater/logs.txt b/lintcheck-logs/logs.txt similarity index 100% rename from mini-crater/logs.txt rename to lintcheck-logs/logs.txt