@@ -91,6 +91,10 @@ pub enum Subcommand {
9191 Clippy {
9292 fix : bool ,
9393 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 > ,
9498 } ,
9599 Fix {
96100 paths : Vec < PathBuf > ,
@@ -240,6 +244,10 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
240244 opts. optopt ( "" , "rust-profile-use" , "use PGO profile for rustc build" , "PROFILE" ) ;
241245 opts. optflag ( "" , "llvm-profile-generate" , "generate PGO profile with llvm built for rustc" ) ;
242246 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" ) ;
243251
244252 // We can't use getopt to parse the options until we have completed specifying which
245253 // options are valid, but under the current implementation, some options are conditional on
@@ -538,7 +546,14 @@ Arguments:
538546 }
539547 Subcommand :: Check { paths }
540548 }
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+ } ,
542557 Kind :: Fix => Subcommand :: Fix { paths } ,
543558 Kind :: Test => Subcommand :: Test {
544559 paths,
0 commit comments