Skip to content

Commit fac6da1

Browse files
committed
move testfiles to "lintcheck" and fix more paths
1 parent c760150 commit fac6da1

File tree

4 files changed

+14
-60
lines changed

4 files changed

+14
-60
lines changed

.cargo/config

Lines changed: 1 addition & 1 deletion
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-lintcheck = "run --target-dir lintcheck/target --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
4+
lintcheck = "run --target-dir lintcheck/target --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
55

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

clippy_dev/lintcheck_crates.toml

Lines changed: 0 additions & 35 deletions
This file was deleted.

lintcheck/src/main.rs

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::{
1616
path::{Path, PathBuf},
1717
};
1818

19-
use clap::{App, Arg, ArgMatches, SubCommand};
19+
use clap::{App, Arg, ArgMatches};
2020
use rayon::prelude::*;
2121
use serde::{Deserialize, Serialize};
2222
use serde_json::Value;
@@ -337,12 +337,12 @@ impl LintcheckConfig {
337337
fn from_clap(clap_config: &ArgMatches) -> Self {
338338
// first, check if we got anything passed via the LINTCHECK_TOML env var,
339339
// if not, ask clap if we got any value for --crates-toml <foo>
340-
// if not, use the default "clippy_dev/lintcheck_crates.toml"
340+
// if not, use the default "lintcheck/lintcheck_crates.toml"
341341
let sources_toml = env::var("LINTCHECK_TOML").unwrap_or_else(|_| {
342342
clap_config
343343
.value_of("crates-toml")
344344
.clone()
345-
.unwrap_or("clippy_dev/lintcheck_crates.toml")
345+
.unwrap_or("lintcheck/lintcheck_crates.toml")
346346
.to_string()
347347
});
348348

@@ -576,7 +576,7 @@ fn is_in_clippy_root() -> bool {
576576
pub fn main() {
577577
// assert that we launch lintcheck from the repo root (via cargo dev-lintcheck)
578578
if !is_in_clippy_root() {
579-
eprintln!("lintcheck needs to be run from clippys repo root!\nUse `cargo dev-lintcheck` alternatively.");
579+
eprintln!("lintcheck needs to be run from clippys repo root!\nUse `cargo lintcheck` alternatively.");
580580
std::process::exit(3);
581581
}
582582

@@ -638,7 +638,7 @@ pub fn main() {
638638
name == only_one_crate
639639
}) {
640640
eprintln!(
641-
"ERROR: could not find crate '{}' in clippy_dev/lintcheck_crates.toml",
641+
"ERROR: could not find crate '{}' in lintcheck/lintcheck_crates.toml",
642642
only_one_crate
643643
);
644644
std::process::exit(1);
@@ -818,7 +818,7 @@ fn create_dirs(krate_download_dir: &Path, extract_dir: &Path) {
818818
}
819819

820820
fn get_clap_config<'a>() -> ArgMatches<'a> {
821-
let lintcheck_sbcmd = SubCommand::with_name("lintcheck")
821+
App::new("lintcheck")
822822
.about("run clippy on a set of crates and check output")
823823
.arg(
824824
Arg::with_name("only")
@@ -842,13 +842,8 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
842842
.long("jobs")
843843
.help("number of threads to use, 0 automatic choice"),
844844
)
845-
.arg(Arg::with_name("fix").help("runs cargo clippy --fix and checks if all suggestions apply"));
846-
847-
let app = App::new("Clippy developer tooling");
848-
849-
let app = app.subcommand(lintcheck_sbcmd);
850-
851-
app.get_matches()
845+
.arg(Arg::with_name("fix").help("runs cargo clippy --fix and checks if all suggestions apply"))
846+
.get_matches()
852847
}
853848

854849
/// Returns the path to the Clippy project directory
@@ -881,24 +876,18 @@ fn lintcheck_test() {
881876
let args = [
882877
"run",
883878
"--target-dir",
884-
"clippy_dev/target",
885-
"--package",
886-
"clippy_dev",
887-
"--bin",
888-
"clippy_dev",
879+
"lintcheck/target",
889880
"--manifest-path",
890-
"clippy_dev/Cargo.toml",
891-
"--features",
892-
"lintcheck",
881+
"./lintcheck/Cargo.toml",
893882
"--",
894-
"lintcheck",
895883
"--crates-toml",
896-
"clippy_dev/test_sources.toml",
884+
"lintcheck/test_sources.toml",
897885
];
898886
let status = std::process::Command::new("cargo")
899887
.args(&args)
900-
.current_dir("../" /* repo root */)
888+
.current_dir("..") // repo root
901889
.status();
890+
//.output();
902891

903892
assert!(status.unwrap().success());
904893
}
File renamed without changes.

0 commit comments

Comments
 (0)