diff options
author | Aleksey Kladov <[email protected]> | 2020-07-08 21:47:50 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-08 21:47:50 +0100 |
commit | e4b4600752d3c7102f01d074c25b4798b75c2bed (patch) | |
tree | 22314d5486cc166bc6bb679c45ac78dd1064b340 /xtask | |
parent | e8bb153b19ffa0ad815eb8934d40cd89ce550b99 (diff) |
better language
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/tests/tidy.rs | 19 |
1 files changed, 10 insertions, 9 deletions
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() { | |||
50 | } | 50 | } |
51 | 51 | ||
52 | fn check_todo(path: &Path, text: &str) { | 52 | fn check_todo(path: &Path, text: &str) { |
53 | let whitelist = &[ | 53 | let need_todo = &[ |
54 | // This file itself is whitelisted since this test itself contains matches. | 54 | // This file itself obviously needs to use todo (<- like this!). |
55 | "tests/cli.rs", | 55 | "tests/cli.rs", |
56 | // Some of our assists generate `todo!()` so those files are whitelisted. | 56 | // Some of our assists generate `todo!()`. |
57 | "tests/generated.rs", | 57 | "tests/generated.rs", |
58 | "handlers/add_missing_impl_members.rs", | 58 | "handlers/add_missing_impl_members.rs", |
59 | "handlers/add_turbo_fish.rs", | 59 | "handlers/add_turbo_fish.rs", |
60 | "handlers/generate_function.rs", | 60 | "handlers/generate_function.rs", |
61 | // To support generating `todo!()` in assists, we have `expr_todo()` in ast::make. | 61 | // To support generating `todo!()` in assists, we have `expr_todo()` in |
62 | // `ast::make`. | ||
62 | "ast/make.rs", | 63 | "ast/make.rs", |
63 | ]; | 64 | ]; |
64 | if whitelist.iter().any(|p| path.ends_with(p)) { | 65 | if need_todo.iter().any(|p| path.ends_with(p)) { |
65 | return; | 66 | return; |
66 | } | 67 | } |
67 | if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") { | 68 | if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") { |
@@ -139,7 +140,7 @@ impl TidyDocs { | |||
139 | ) | 140 | ) |
140 | } | 141 | } |
141 | 142 | ||
142 | let whitelist = [ | 143 | let poorly_documented = [ |
143 | "ra_hir", | 144 | "ra_hir", |
144 | "ra_hir_expand", | 145 | "ra_hir_expand", |
145 | "ra_ide", | 146 | "ra_ide", |
@@ -153,9 +154,9 @@ impl TidyDocs { | |||
153 | ]; | 154 | ]; |
154 | 155 | ||
155 | let mut has_fixmes = | 156 | let mut has_fixmes = |
156 | whitelist.iter().map(|it| (*it, false)).collect::<HashMap<&str, bool>>(); | 157 | poorly_documented.iter().map(|it| (*it, false)).collect::<HashMap<&str, bool>>(); |
157 | 'outer: for path in self.contains_fixme { | 158 | 'outer: for path in self.contains_fixme { |
158 | for krate in whitelist.iter() { | 159 | for krate in poorly_documented.iter() { |
159 | if path.components().any(|it| it.as_os_str() == *krate) { | 160 | if path.components().any(|it| it.as_os_str() == *krate) { |
160 | has_fixmes.insert(krate, true); | 161 | has_fixmes.insert(krate, true); |
161 | continue 'outer; | 162 | continue 'outer; |
@@ -166,7 +167,7 @@ impl TidyDocs { | |||
166 | 167 | ||
167 | for (krate, has_fixme) in has_fixmes.iter() { | 168 | for (krate, has_fixme) in has_fixmes.iter() { |
168 | if !has_fixme { | 169 | if !has_fixme { |
169 | panic!("crate {} is fully documented, remove it from the white list", krate) | 170 | panic!("crate {} is fully documented :tada:, remove it from the list of poorly documented crates", krate) |
170 | } | 171 | } |
171 | } | 172 | } |
172 | } | 173 | } |