Skip to content

Commit e295bf2

Browse files
committed
chore(ci): make md doctest checker a bit more versatile on user errors
1 parent 5d9af12 commit e295bf2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tasks/src/check_tfhe_docs_are_tested.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,18 @@ pub fn check_tfhe_docs_are_tested() -> Result<(), Error> {
126126
}
127127

128128
let difference = doc_files.difference(&tested_files);
129+
let files_that_may_not_exist = tested_files.difference(&doc_files);
130+
let files_that_dont_exist: Vec<_> = files_that_may_not_exist
131+
.into_iter()
132+
.filter(|p| !p.exists())
133+
.collect();
129134

130-
let debug_format = format!("missing file from user doc tests: {difference:#?}");
135+
let debug_format = format!(
136+
"missing file from user doc tests: {difference:#?}\n\
137+
files that are tested but don't exist: {files_that_dont_exist:#?}"
138+
);
131139

132-
if difference.count() != 0 {
140+
if difference.count() != 0 || !files_that_dont_exist.is_empty() {
133141
return Err(Error::new(ErrorKind::NotFound, debug_format));
134142
}
135143

0 commit comments

Comments
 (0)