aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-08 21:47:50 +0100
committerAleksey Kladov <[email protected]>2020-07-08 21:47:50 +0100
commite4b4600752d3c7102f01d074c25b4798b75c2bed (patch)
tree22314d5486cc166bc6bb679c45ac78dd1064b340
parente8bb153b19ffa0ad815eb8934d40cd89ce550b99 (diff)
better language
-rw-r--r--crates/vfs-notify/src/include.rs4
-rw-r--r--xtask/tests/tidy.rs19
2 files changed, 12 insertions, 11 deletions
diff --git a/crates/vfs-notify/src/include.rs b/crates/vfs-notify/src/include.rs
index 7378766f5..72f928536 100644
--- a/crates/vfs-notify/src/include.rs
+++ b/crates/vfs-notify/src/include.rs
@@ -9,8 +9,8 @@ use paths::{RelPath, RelPathBuf};
9/// 9///
10/// It describes the set of files inside some directory. 10/// It describes the set of files inside some directory.
11/// 11///
12/// The current implementation is very limited, it allows white-listing file 12/// The current implementation is very limited, it allows including file globs
13/// globs and black-listing directories. 13/// and recursively excluding directories.
14#[derive(Debug, Clone)] 14#[derive(Debug, Clone)]
15pub(crate) struct Include { 15pub(crate) struct Include {
16 include_files: GlobSet, 16 include_files: GlobSet,
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
52fn check_todo(path: &Path, text: &str) { 52fn 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 }