Skip to content

Commit 8bdefbd

Browse files
committed
switch to sorted usable lints
1 parent 73b842b commit 8bdefbd

File tree

2 files changed

+1121
-1248
lines changed

2 files changed

+1121
-1248
lines changed

clippy_dev/src/main.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,18 @@ fn print_lints() {
8888
fn update_lints(update_mode: &UpdateMode) {
8989
let lint_list: Vec<Lint> = gather_all().collect();
9090

91+
let usable_lints: Vec<Lint> = Lint::usable_lints(lint_list.clone().into_iter()).collect();
92+
let lint_count = usable_lints.len();
93+
94+
let mut sorted_usable_lints = usable_lints.clone();
95+
sorted_usable_lints.sort_by_key(|lint| lint.name.clone());
96+
9197
std::fs::write(
9298
"../src/lintlist.rs",
9399
&format!(
94100
"\
101+
//! This file is managed by util/dev update_lints. Do not edit.
102+
95103
/// Lint data parsed from the Clippy source code.
96104
#[derive(Clone, PartialEq, Debug)]
97105
pub struct Lint {{
@@ -103,15 +111,12 @@ pub struct Lint {{
103111
}}
104112
105113
pub const ALL_LINTS: [Lint; {}] = {:#?};\n",
106-
lint_list.len(),
107-
lint_list
114+
sorted_usable_lints.len(),
115+
sorted_usable_lints
108116
),
109117
)
110118
.expect("can write to file");
111119

112-
let usable_lints: Vec<Lint> = Lint::usable_lints(lint_list.clone().into_iter()).collect();
113-
let lint_count = usable_lints.len();
114-
115120
let mut file_change = replace_region_in_file(
116121
"../README.md",
117122
r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang.github.io/rust-clippy/master/index.html\)"#,

0 commit comments

Comments
 (0)