File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,8 @@ fn build_clippy() {
192192}
193193
194194// get a list of CrateSources we want to check from a "lintcheck_crates.toml" file.
195- fn read_crates ( ) -> Vec < CrateSource > {
196- let toml_path = PathBuf :: from ( "clippy_dev/lintcheck_crates.toml" ) ;
195+ fn read_crates ( toml_path : Option < & str > ) -> Vec < CrateSource > {
196+ let toml_path = PathBuf :: from ( toml_path . unwrap_or ( "clippy_dev/lintcheck_crates.toml" ) ) ;
197197 let toml_content: String =
198198 std:: fs:: read_to_string ( & toml_path) . unwrap_or_else ( |_| panic ! ( "Failed to read {}" , toml_path. display( ) ) ) ;
199199 let crate_list: CrateList =
@@ -288,7 +288,7 @@ pub fn run(clap_config: &ArgMatches) {
288288 // download and extract the crates, then run clippy on them and collect clippys warnings
289289 // flatten into one big list of warnings
290290
291- let crates = read_crates ( ) ;
291+ let crates = read_crates ( clap_config . value_of ( "crates-toml" ) ) ;
292292
293293 let clippy_warnings: Vec < ClippyWarning > = if let Some ( only_one_crate) = clap_config. value_of ( "only" ) {
294294 // if we don't have the specified crate in the .toml, throw an error
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
6262 . value_name ( "CRATE" )
6363 . long ( "only" )
6464 . help ( "only process a single crate of the list" ) ,
65+ )
66+ . arg (
67+ Arg :: with_name ( "crates-toml" )
68+ . takes_value ( true )
69+ . value_name ( "CRATES-SOURCES-TOML-PATH" )
70+ . long ( "crates-toml" )
71+ . help ( "set the path for a crates.toml where lintcheck should read the sources from" ) ,
6572 ) ;
6673
6774 let app = App :: new ( "Clippy developer tooling" )
You can’t perform that action at this time.
0 commit comments