From c8f27a4a886413a15a2a6af4a87b39b901c873a8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 31 May 2020 01:54:54 +0200 Subject: Generate features docs from source --- xtask/tests/tidy.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xtask/tests') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 2e9fcf07c..06ff45d99 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -30,6 +30,13 @@ fn generated_assists_are_fresh() { } } +#[test] +fn generated_features_are_fresh() { + if let Err(error) = codegen::generate_feature_docs(Mode::Verify) { + panic!("{}. Please update features by running `cargo xtask codegen`", error); + } +} + #[test] fn check_code_formatting() { if let Err(error) = run_rustfmt(Mode::Verify) { -- cgit v1.2.3 From 8915183d7da07a4b295e5e93a889dea4c15024a0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 31 May 2020 09:59:38 +0200 Subject: Don't require module docs for Features and Assists --- xtask/tests/tidy.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xtask/tests') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 06ff45d99..4ac5d929f 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -102,7 +102,7 @@ impl TidyDocs { fn visit(&mut self, path: &Path, text: &str) { // Test hopefully don't really need comments, and for assists we already // have special comments which are source of doc tests and user docs. - if is_exclude_dir(path, &["tests", "test_data", "handlers"]) { + if is_exclude_dir(path, &["tests", "test_data"]) { return; } @@ -117,9 +117,12 @@ impl TidyDocs { if first_line.starts_with("//!") { if first_line.contains("FIXME") { - self.contains_fixme.push(path.to_path_buf()) + self.contains_fixme.push(path.to_path_buf()); } } else { + if text.contains("// Feature:") || text.contains("// Assist:") { + return; + } self.missing_docs.push(path.display().to_string()); } -- cgit v1.2.3