mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
switch to sorted usable lints
This commit is contained in:
parent
44b849521e
commit
f6367c41dc
2 changed files with 1981 additions and 2108 deletions
|
@ -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\)"#,
|
||||
|
|
4074
src/lintlist.rs
4074
src/lintlist.rs
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue