From f2f3c554af2c4a698e0ceb087ceb4dfa6f95ee90 Mon Sep 17 00:00:00 2001 From: veetaha Date: Tue, 2 Jun 2020 23:15:23 +0300 Subject: Don't exclude dirs that appear in project root parent path --- xtask/tests/tidy.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'xtask/tests/tidy.rs') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 4ac5d929f..62626064e 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -180,13 +180,11 @@ impl TidyDocs { } fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool { - let mut cur_path = p; - while let Some(path) = cur_path.parent() { - if dirs_to_exclude.iter().any(|dir| path.ends_with(dir)) { - return true; - } - cur_path = path; - } - - false + p.strip_prefix(project_root()) + .unwrap() + .components() + .rev() + .skip(1) + .filter_map(|it| it.as_os_str().to_str()) + .any(|it| dirs_to_exclude.contains(&it)) } -- cgit v1.2.3 From 5315934d888797432d62ec4a55303aeacb8cd286 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 3 Jun 2020 18:22:05 +0200 Subject: Don't store generated docs in the repo --- xtask/tests/tidy.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'xtask/tests/tidy.rs') diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 62626064e..d38ac7f17 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs @@ -25,18 +25,11 @@ fn generated_tests_are_fresh() { #[test] fn generated_assists_are_fresh() { - if let Err(error) = codegen::generate_assists_docs(Mode::Verify) { + if let Err(error) = codegen::generate_assists_tests(Mode::Verify) { panic!("{}. Please update assists by running `cargo xtask codegen`", error); } } -#[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