switch to sorted usable lints

This commit is contained in:
Jane Lusby 2019-06-08 11:29:27 -07:00
parent 44b849521e
commit f6367c41dc
2 changed files with 1981 additions and 2108 deletions

View file

@ -88,10 +88,18 @@ fn print_lints() {
fn update_lints(update_mode: &UpdateMode) {
let lint_list: Vec<Lint> = gather_all().collect();
let usable_lints: Vec<Lint> = Lint::usable_lints(lint_list.clone().into_iter()).collect();
let lint_count = usable_lints.len();
let mut sorted_usable_lints = usable_lints.clone();
sorted_usable_lints.sort_by_key(|lint| lint.name.clone());
std::fs::write(
"../src/lintlist.rs",
&format!(
"\
//! This file is managed by util/dev update_lints. Do not edit.
/// Lint data parsed from the Clippy source code.
#[derive(Clone, PartialEq, Debug)]
pub struct Lint {{
@ -103,15 +111,12 @@ pub struct Lint {{
}}
pub const ALL_LINTS: [Lint; {}] = {:#?};\n",
lint_list.len(),
lint_list
sorted_usable_lints.len(),
sorted_usable_lints
),
)
.expect("can write to file");
let usable_lints: Vec<Lint> = Lint::usable_lints(lint_list.clone().into_iter()).collect();
let lint_count = usable_lints.len();
let mut file_change = replace_region_in_file(
"../README.md",
r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang.github.io/rust-clippy/master/index.html\)"#,

File diff suppressed because it is too large Load diff