3
3
#![ warn( rust_2018_idioms, unused_lifetimes) ]
4
4
5
5
use 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} ;
7
7
use indoc:: indoc;
8
8
9
9
fn main ( ) {
@@ -13,6 +13,13 @@ fn main() {
13
13
Some ( ( "bless" , matches) ) => {
14
14
bless:: bless ( matches. contains_id ( "ignore-timestamp" ) ) ;
15
15
} ,
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
+ } ,
16
23
Some ( ( "fmt" , matches) ) => {
17
24
fmt:: run ( matches. contains_id ( "check" ) , matches. contains_id ( "verbose" ) ) ;
18
25
} ,
@@ -104,6 +111,17 @@ fn get_clap_config() -> ArgMatches {
104
111
. long ( "ignore-timestamp" )
105
112
. help ( "Include files updated before clippy was built" ) ,
106
113
) ,
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
+ ] ) ,
107
125
Command :: new ( "fmt" )
108
126
. about ( "Run rustfmt on all projects and tests" )
109
127
. args ( [
0 commit comments