@@ -91,6 +91,10 @@ pub enum Subcommand {
91
91
Clippy {
92
92
fix : bool ,
93
93
paths : Vec < PathBuf > ,
94
+ clippy_lint_allow : Vec < String > ,
95
+ clippy_lint_deny : Vec < String > ,
96
+ clippy_lint_warn : Vec < String > ,
97
+ clippy_lint_forbid : Vec < String > ,
94
98
} ,
95
99
Fix {
96
100
paths : Vec < PathBuf > ,
@@ -240,6 +244,10 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
240
244
opts. optopt ( "" , "rust-profile-use" , "use PGO profile for rustc build" , "PROFILE" ) ;
241
245
opts. optflag ( "" , "llvm-profile-generate" , "generate PGO profile with llvm built for rustc" ) ;
242
246
opts. optopt ( "" , "llvm-profile-use" , "use PGO profile for llvm build" , "PROFILE" ) ;
247
+ opts. optmulti ( "A" , "" , "allow certain clippy lints" , "OPT" ) ;
248
+ opts. optmulti ( "D" , "" , "deny certain clippy lints" , "OPT" ) ;
249
+ opts. optmulti ( "W" , "" , "warn about certain clippy lints" , "OPT" ) ;
250
+ opts. optmulti ( "F" , "" , "forbid certain clippy lints" , "OPT" ) ;
243
251
244
252
// We can't use getopt to parse the options until we have completed specifying which
245
253
// options are valid, but under the current implementation, some options are conditional on
@@ -538,7 +546,14 @@ Arguments:
538
546
}
539
547
Subcommand :: Check { paths }
540
548
}
541
- Kind :: Clippy => Subcommand :: Clippy { paths, fix : matches. opt_present ( "fix" ) } ,
549
+ Kind :: Clippy => Subcommand :: Clippy {
550
+ paths,
551
+ fix : matches. opt_present ( "fix" ) ,
552
+ clippy_lint_allow : matches. opt_strs ( "A" ) ,
553
+ clippy_lint_warn : matches. opt_strs ( "W" ) ,
554
+ clippy_lint_deny : matches. opt_strs ( "D" ) ,
555
+ clippy_lint_forbid : matches. opt_strs ( "F" ) ,
556
+ } ,
542
557
Kind :: Fix => Subcommand :: Fix { paths } ,
543
558
Kind :: Test => Subcommand :: Test {
544
559
paths,
0 commit comments