aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-03 08:15:18 +0100
committerGitHub <[email protected]>2020-06-03 08:15:18 +0100
commitc29175f1ff115bb21f5fec8d98f39930615dfcbf (patch)
treec7e31690810dfb4da80a9c83f7a0d063e1d202cc /xtask
parent68f26dc1bbdbe4f403e24a677c5b50fbe43292a9 (diff)
parentf2f3c554af2c4a698e0ceb087ceb4dfa6f95ee90 (diff)
Merge #4715
4715: Don't exclude dirs that appear in project root parent path r=matklad a=Veetaha Co-authored-by: veetaha <[email protected]>
Diffstat (limited to 'xtask')
-rw-r--r--xtask/tests/tidy.rs16
1 files changed, 7 insertions, 9 deletions
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 {
180} 180}
181 181
182fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool { 182fn is_exclude_dir(p: &Path, dirs_to_exclude: &[&str]) -> bool {
183 let mut cur_path = p; 183 p.strip_prefix(project_root())
184 while let Some(path) = cur_path.parent() { 184 .unwrap()
185 if dirs_to_exclude.iter().any(|dir| path.ends_with(dir)) { 185 .components()
186 return true; 186 .rev()
187 } 187 .skip(1)
188 cur_path = path; 188 .filter_map(|it| it.as_os_str().to_str())
189 } 189 .any(|it| dirs_to_exclude.contains(&it))
190
191 false
192} 190}