File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,8 @@ fn build_clippy() {
192
192
}
193
193
194
194
// 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" ) ) ;
197
197
let toml_content: String =
198
198
std:: fs:: read_to_string ( & toml_path) . unwrap_or_else ( |_| panic ! ( "Failed to read {}" , toml_path. display( ) ) ) ;
199
199
let crate_list: CrateList =
@@ -288,7 +288,7 @@ pub fn run(clap_config: &ArgMatches) {
288
288
// download and extract the crates, then run clippy on them and collect clippys warnings
289
289
// flatten into one big list of warnings
290
290
291
- let crates = read_crates ( ) ;
291
+ let crates = read_crates ( clap_config . value_of ( "crates-toml" ) ) ;
292
292
293
293
let clippy_warnings: Vec < ClippyWarning > = if let Some ( only_one_crate) = clap_config. value_of ( "only" ) {
294
294
// 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> {
62
62
. value_name ( "CRATE" )
63
63
. long ( "only" )
64
64
. 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" ) ,
65
72
) ;
66
73
67
74
let app = App :: new ( "Clippy developer tooling" )
You can’t perform that action at this time.
0 commit comments