@@ -19,9 +19,9 @@ fn main() {
19
19
if matches. is_present ( "print-only" ) {
20
20
update_lints:: print_lints ( ) ;
21
21
} else if matches. is_present ( "check" ) {
22
- update_lints:: run ( update_lints:: UpdateMode :: Check ) ;
22
+ update_lints:: update ( update_lints:: UpdateMode :: Check ) ;
23
23
} else {
24
- update_lints:: run ( update_lints:: UpdateMode :: Change ) ;
24
+ update_lints:: update ( update_lints:: UpdateMode :: Change ) ;
25
25
}
26
26
} ,
27
27
( "new_lint" , Some ( matches) ) => {
@@ -31,7 +31,7 @@ fn main() {
31
31
matches. value_of ( "category" ) ,
32
32
matches. is_present ( "msrv" ) ,
33
33
) {
34
- Ok ( _) => update_lints:: run ( update_lints:: UpdateMode :: Change ) ,
34
+ Ok ( _) => update_lints:: update ( update_lints:: UpdateMode :: Change ) ,
35
35
Err ( e) => eprintln ! ( "Unable to create lint: {}" , e) ,
36
36
}
37
37
} ,
@@ -78,6 +78,12 @@ fn main() {
78
78
let path = matches. value_of ( "path" ) . unwrap ( ) ;
79
79
lint:: run ( path) ;
80
80
} ,
81
+ ( "rename_lint" , Some ( matches) ) => {
82
+ let old_name = matches. value_of ( "old_name" ) . unwrap ( ) ;
83
+ let new_name = matches. value_of ( "new_name" ) . unwrap_or ( old_name) ;
84
+ let uplift = matches. is_present ( "uplift" ) ;
85
+ update_lints:: rename ( old_name, new_name, uplift) ;
86
+ } ,
81
87
_ => { } ,
82
88
}
83
89
}
@@ -279,5 +285,26 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
279
285
. help ( "The path to a file or package directory to lint" ) ,
280
286
) ,
281
287
)
288
+ . subcommand (
289
+ SubCommand :: with_name ( "rename_lint" )
290
+ . about ( "Renames the given lint" )
291
+ . arg (
292
+ Arg :: with_name ( "old_name" )
293
+ . index ( 1 )
294
+ . required ( true )
295
+ . help ( "The name of the lint to rename" ) ,
296
+ )
297
+ . arg (
298
+ Arg :: with_name ( "new_name" )
299
+ . index ( 2 )
300
+ . required_unless ( "uplift" )
301
+ . help ( "The new name of the lint" ) ,
302
+ )
303
+ . arg (
304
+ Arg :: with_name ( "uplift" )
305
+ . long ( "uplift" )
306
+ . help ( "This lint will be uplifted into rustc" ) ,
307
+ ) ,
308
+ )
282
309
. get_matches ( )
283
310
}
0 commit comments