aboutsummaryrefslogtreecommitdiff
path: root/xtask/tests/tidy-tests
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/tests/tidy-tests')
-rw-r--r--xtask/tests/tidy-tests/docs.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/xtask/tests/tidy-tests/docs.rs b/xtask/tests/tidy-tests/docs.rs
index 6a629ce63..227937f46 100644
--- a/xtask/tests/tidy-tests/docs.rs
+++ b/xtask/tests/tidy-tests/docs.rs
@@ -36,6 +36,7 @@ fn is_hidden(entry: &DirEntry) -> bool {
36fn no_docs_comments() { 36fn no_docs_comments() {
37 let crates = project_root().join("crates"); 37 let crates = project_root().join("crates");
38 let iter = WalkDir::new(crates); 38 let iter = WalkDir::new(crates);
39 let mut missing_docs = Vec::new();
39 for f in iter.into_iter().filter_entry(|e| !is_hidden(e)) { 40 for f in iter.into_iter().filter_entry(|e| !is_hidden(e)) {
40 let f = f.unwrap(); 41 let f = f.unwrap();
41 if f.file_type().is_dir() { 42 if f.file_type().is_dir() {
@@ -54,12 +55,14 @@ fn no_docs_comments() {
54 let mut line = String::new(); 55 let mut line = String::new();
55 reader.read_line(&mut line).unwrap(); 56 reader.read_line(&mut line).unwrap();
56 if !line.starts_with("//!") { 57 if !line.starts_with("//!") {
57 panic!( 58 missing_docs.push(f.path().display().to_string());
58 "\nMissing docs strings\n\
59 module: {}\n\
60 Need add doc for module\n",
61 f.path().display()
62 )
63 } 59 }
64 } 60 }
61 if !missing_docs.is_empty() {
62 panic!(
63 "\nMissing docs strings\n\n\
64 modules:\n{}\n\n",
65 missing_docs.join("\n")
66 )
67 }
65} 68}