33#![ warn( rust_2018_idioms, unused_lifetimes) ]
44
55use clap:: { Arg , ArgAction , ArgMatches , Command , PossibleValue } ;
6- use clippy_dev:: { bless, fmt, lint, new_lint, serve, setup, update_lints} ;
6+ use clippy_dev:: { bless, dogfood , fmt, lint, new_lint, serve, setup, update_lints} ;
77use indoc:: indoc;
88
99fn main ( ) {
@@ -13,6 +13,13 @@ fn main() {
1313 Some ( ( "bless" , matches) ) => {
1414 bless:: bless ( matches. contains_id ( "ignore-timestamp" ) ) ;
1515 } ,
16+ Some ( ( "dogfood" , matches) ) => {
17+ dogfood:: dogfood (
18+ matches. contains_id ( "fix" ) ,
19+ matches. contains_id ( "allow-dirty" ) ,
20+ matches. contains_id ( "allow-staged" ) ,
21+ ) ;
22+ } ,
1623 Some ( ( "fmt" , matches) ) => {
1724 fmt:: run ( matches. contains_id ( "check" ) , matches. contains_id ( "verbose" ) ) ;
1825 } ,
@@ -104,6 +111,17 @@ fn get_clap_config() -> ArgMatches {
104111 . long ( "ignore-timestamp" )
105112 . help ( "Include files updated before clippy was built" ) ,
106113 ) ,
114+ Command :: new ( "dogfood" ) . about ( "Runs the dogfood test" ) . args ( [
115+ Arg :: new ( "fix" ) . long ( "fix" ) . help ( "Apply the suggestions when possible" ) ,
116+ Arg :: new ( "allow-dirty" )
117+ . long ( "allow-dirty" )
118+ . help ( "Fix code even if the working directory has changes" )
119+ . requires ( "fix" ) ,
120+ Arg :: new ( "allow-staged" )
121+ . long ( "allow-staged" )
122+ . help ( "Fix code even if the working directory has staged changes" )
123+ . requires ( "fix" ) ,
124+ ] ) ,
107125 Command :: new ( "fmt" )
108126 . about ( "Run rustfmt on all projects and tests" )
109127 . args ( [
0 commit comments