diff options
author | Mikhail Rakhmanov <[email protected]> | 2020-06-13 07:42:15 +0100 |
---|---|---|
committer | Mikhail Rakhmanov <[email protected]> | 2020-06-13 07:42:15 +0100 |
commit | 16bbf4ab7f132e6e5e5318dccdef9a5d71afdd7f (patch) | |
tree | 4b79fa8c046be56b02427ba843e70cdf3ac05767 /xtask/tests/tidy.rs | |
parent | eeb8b9e236796da8734ba81a49164864497f7226 (diff) | |
parent | b56ad148db0c69eb279c225f45d324b4e80e7367 (diff) |
Merge branch 'master' into keyword_completion
# Conflicts:
# docs/user/generated_features.adoc
Diffstat (limited to 'xtask/tests/tidy.rs')
-rw-r--r-- | xtask/tests/tidy.rs | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 4ac5d929f..d38ac7f17 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs | |||
@@ -25,19 +25,12 @@ fn generated_tests_are_fresh() { | |||
25 | 25 | ||
26 | #[test] | 26 | #[test] |
27 | fn generated_assists_are_fresh() { | 27 | fn generated_assists_are_fresh() { |
28 | if let Err(error) = codegen::generate_assists_docs(Mode::Verify) { | 28 | if let Err(error) = codegen::generate_assists_tests(Mode::Verify) { |
29 | panic!("{}. Please update assists by running `cargo xtask codegen`", error); | 29 | panic!("{}. Please update assists by running `cargo xtask codegen`", error); |
30 | } | 30 | } |
31 | } | 31 | } |
32 | 32 | ||
33 | #[test] | 33 | #[test] |
34 | fn generated_features_are_fresh() { | ||
35 | if let Err(error) = codegen::generate_feature_docs(Mode::Verify) { | ||
36 | panic!("{}. Please update features by running `cargo xtask codegen`", error); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | #[test] | ||
41 | fn check_code_formatting() { | 34 | fn check_code_formatting() { |
42 | if let Err(error) = run_rustfmt(Mode::Verify) { | 35 | if let Err(error) = run_rustfmt(Mode::Verify) { |
43 | panic!("{}. Please format the code by running `cargo format`", error); | 36 | panic!("{}. Please format the code by running `cargo format`", error); |
@@ -180,13 +173,11 @@ impl TidyDocs { | |||
180 | } | 173 | } |
181 | 174 | ||
182 | fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool { | 175 | fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool { |
183 | let mut cur_path = p; | 176 | p.strip_prefix(project_root()) |
184 | while let Some(path) = cur_path.parent() { | 177 | .unwrap() |
185 | if dirs_to_exclude.iter().any(|dir| path.ends_with(dir)) { | 178 | .components() |
186 | return true; | 179 | .rev() |
187 | } | 180 | .skip(1) |
188 | cur_path = path; | 181 | .filter_map(|it| it.as_os_str().to_str()) |
189 | } | 182 | .any(|it| dirs_to_exclude.contains(&it)) |
190 | |||
191 | false | ||
192 | } | 183 | } |