From e4b4600752d3c7102f01d074c25b4798b75c2bed Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 8 Jul 2020 22:47:50 +0200 Subject: better language --- xtask/tests/tidy.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'xtask') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index f99935170..fcfad609d 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -50,18 +50,19 @@ fn rust_files_are_tidy() { } fn check_todo(path: &Path, text: &str) { - let whitelist = &[ - // This file itself is whitelisted since this test itself contains matches. + let need_todo = &[ + // This file itself obviously needs to use todo (<- like this!). "tests/cli.rs", - // Some of our assists generate `todo!()` so those files are whitelisted. + // Some of our assists generate `todo!()`. "tests/generated.rs", "handlers/add_missing_impl_members.rs", "handlers/add_turbo_fish.rs", "handlers/generate_function.rs", - // To support generating `todo!()` in assists, we have `expr_todo()` in ast::make. + // To support generating `todo!()` in assists, we have `expr_todo()` in + // `ast::make`. "ast/make.rs", ]; - if whitelist.iter().any(|p| path.ends_with(p)) { + if need_todo.iter().any(|p| path.ends_with(p)) { return; } if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") { @@ -139,7 +140,7 @@ impl TidyDocs { ) } - let whitelist = [ + let poorly_documented = [ "ra_hir", "ra_hir_expand", "ra_ide", @@ -153,9 +154,9 @@ impl TidyDocs { ]; let mut has_fixmes = - whitelist.iter().map(|it| (*it, false)).collect::>(); + poorly_documented.iter().map(|it| (*it, false)).collect::>(); 'outer: for path in self.contains_fixme { - for krate in whitelist.iter() { + for krate in poorly_documented.iter() { if path.components().any(|it| it.as_os_str() == *krate) { has_fixmes.insert(krate, true); continue 'outer; @@ -166,7 +167,7 @@ impl TidyDocs { for (krate, has_fixme) in has_fixmes.iter() { if !has_fixme { - panic!("crate {} is fully documented, remove it from the white list", krate) + panic!("crate {} is fully documented :tada:, remove it from the list of poorly documented crates", krate) } } } -- cgit v1.2.3