1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
12 extern crate clippy_dev;
15 use clap::{App, Arg, SubCommand};
19 let matches = App::new("Clippy developer tooling")
21 SubCommand::with_name("update_lints")
22 .about("Update the lint list")
24 Arg::with_name("print-only")
27 .help("Print a table of lints to STDOUT. Does not modify any files."),
32 if let Some(matches) = matches.subcommand_matches("update_lints") {
33 if matches.is_present("print-only") {
40 let lint_list = gather_all().collect::<Vec<Lint>>();
41 let grouped_by_lint_group = Lint::by_lint_group(&lint_list);
43 for (lint_group, mut lints) in grouped_by_lint_group {
44 if lint_group == "Deprecated" { continue; }
45 println!("\n## {}", lint_group);
47 lints.sort_by(|a, b| a.name.cmp(&b.name));
50 println!("* [{}]({}#{}) ({})", lint.name, clippy_dev::DOCS_LINK.clone(), lint.name, lint.desc);
54 println!("there are {} lints", Lint::active_lints(&lint_list).count());