initial commit for help improvements on clippy-driver

This commit is contained in:
Jane Lusby
2019-06-04 17:32:03 -07:00
parent a1eb60f8ea
commit cf88c8487a
3 changed files with 2332 additions and 0 deletions

View File

@@ -87,6 +87,28 @@ fn print_lints() {
fn update_lints(update_mode: &UpdateMode) {
let lint_list: Vec<Lint> = gather_all().collect();
std::fs::write(
"../src/lintlist.rs",
&format!(
"\
/// Lint data parsed from the Clippy source code.
#[derive(Clone, PartialEq, Debug)]
pub struct Lint {{
pub name: &'static str,
pub group: &'static str,
pub desc: &'static str,
pub deprecation: Option<&'static str>,
pub module: &'static str,
}}
pub const ALL_LINTS: [Lint; {}] = {:#?};",
lint_list.len(),
lint_list
),
)
.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();