diff options
author | Aleksey Kladov <[email protected]> | 2019-11-03 21:11:37 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-03 21:23:14 +0000 |
commit | 8922a44395482896fec0c0a47a7fac4612112d45 (patch) | |
tree | c37d38f9313f54ea71580f6bd005f554388a57ab /xtask/tests | |
parent | f0eb9cc6e66a65d2df42c662499ebd77ea980de5 (diff) |
Add small module-level docs
Diffstat (limited to 'xtask/tests')
-rw-r--r-- | xtask/tests/tidy-tests/docs.rs | 15 |
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 { | |||
36 | fn no_docs_comments() { | 36 | fn 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 | } |