@@ -16,7 +16,7 @@ use std::{
16
16
path:: { Path , PathBuf } ,
17
17
} ;
18
18
19
- use clap:: { App , Arg , ArgMatches , SubCommand } ;
19
+ use clap:: { App , Arg , ArgMatches } ;
20
20
use rayon:: prelude:: * ;
21
21
use serde:: { Deserialize , Serialize } ;
22
22
use serde_json:: Value ;
@@ -337,12 +337,12 @@ impl LintcheckConfig {
337
337
fn from_clap ( clap_config : & ArgMatches ) -> Self {
338
338
// first, check if we got anything passed via the LINTCHECK_TOML env var,
339
339
// 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"
341
341
let sources_toml = env:: var ( "LINTCHECK_TOML" ) . unwrap_or_else ( |_| {
342
342
clap_config
343
343
. value_of ( "crates-toml" )
344
344
. clone ( )
345
- . unwrap_or ( "clippy_dev /lintcheck_crates.toml" )
345
+ . unwrap_or ( "lintcheck /lintcheck_crates.toml" )
346
346
. to_string ( )
347
347
} ) ;
348
348
@@ -576,7 +576,7 @@ fn is_in_clippy_root() -> bool {
576
576
pub fn main ( ) {
577
577
// assert that we launch lintcheck from the repo root (via cargo dev-lintcheck)
578
578
if !is_in_clippy_root ( ) {
579
- eprintln ! ( "lintcheck needs to be run from clippys repo root!\n Use `cargo dev- lintcheck` alternatively." ) ;
579
+ eprintln ! ( "lintcheck needs to be run from clippys repo root!\n Use `cargo lintcheck` alternatively." ) ;
580
580
std:: process:: exit ( 3 ) ;
581
581
}
582
582
@@ -638,7 +638,7 @@ pub fn main() {
638
638
name == only_one_crate
639
639
} ) {
640
640
eprintln ! (
641
- "ERROR: could not find crate '{}' in clippy_dev /lintcheck_crates.toml" ,
641
+ "ERROR: could not find crate '{}' in lintcheck /lintcheck_crates.toml" ,
642
642
only_one_crate
643
643
) ;
644
644
std:: process:: exit ( 1 ) ;
@@ -818,7 +818,7 @@ fn create_dirs(krate_download_dir: &Path, extract_dir: &Path) {
818
818
}
819
819
820
820
fn get_clap_config < ' a > ( ) -> ArgMatches < ' a > {
821
- let lintcheck_sbcmd = SubCommand :: with_name ( "lintcheck" )
821
+ App :: new ( "lintcheck" )
822
822
. about ( "run clippy on a set of crates and check output" )
823
823
. arg (
824
824
Arg :: with_name ( "only" )
@@ -842,13 +842,8 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
842
842
. long ( "jobs" )
843
843
. help ( "number of threads to use, 0 automatic choice" ) ,
844
844
)
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 ( )
852
847
}
853
848
854
849
/// Returns the path to the Clippy project directory
@@ -881,24 +876,18 @@ fn lintcheck_test() {
881
876
let args = [
882
877
"run" ,
883
878
"--target-dir" ,
884
- "clippy_dev/target" ,
885
- "--package" ,
886
- "clippy_dev" ,
887
- "--bin" ,
888
- "clippy_dev" ,
879
+ "lintcheck/target" ,
889
880
"--manifest-path" ,
890
- "clippy_dev/Cargo.toml" ,
891
- "--features" ,
892
- "lintcheck" ,
881
+ "./lintcheck/Cargo.toml" ,
893
882
"--" ,
894
- "lintcheck" ,
895
883
"--crates-toml" ,
896
- "clippy_dev /test_sources.toml" ,
884
+ "lintcheck /test_sources.toml" ,
897
885
] ;
898
886
let status = std:: process:: Command :: new ( "cargo" )
899
887
. args ( & args)
900
- . current_dir ( "../" /* repo root */ )
888
+ . current_dir ( ".." ) // repo root
901
889
. status ( ) ;
890
+ //.output();
902
891
903
892
assert ! ( status. unwrap( ) . success( ) ) ;
904
893
}
0 commit comments