@@ -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 } ;
2020use rayon:: prelude:: * ;
2121use serde:: { Deserialize , Serialize } ;
2222use 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 {
576576pub 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!\n Use `cargo dev- lintcheck` alternatively." ) ;
579+ eprintln ! ( "lintcheck needs to be run from clippys repo root!\n Use `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
820820fn 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}
0 commit comments