Skip to content

Commit 6b790b8

Browse files
committed
Warn when preproc order references unknown preprocs
1 parent d8ad68c commit 6b790b8

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/book/mod.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,14 @@ fn determine_preprocessors(config: &Config) -> Result<Vec<Box<dyn Preprocessor>>
416416
))
417417
})?;
418418

419-
if exists(after) {
419+
if !exists(after) {
420+
// Only warn so that preprocessors can be toggled on and off (e.g. for
421+
// troubleshooting) without having to worry about order too much.
422+
warn!(
423+
"preprocessor.{}.after contains \"{}\", which was not found",
424+
name, after
425+
);
426+
} else {
420427
preprocessor_names.add_dependency(name, after);
421428
}
422429
}
@@ -437,7 +444,13 @@ fn determine_preprocessors(config: &Config) -> Result<Vec<Box<dyn Preprocessor>>
437444
))
438445
})?;
439446

440-
if exists(before) {
447+
if !exists(before) {
448+
// See equivalent warning above for rationale
449+
warn!(
450+
"preprocessor.{}.before contains \"{}\", which was not found",
451+
name, before
452+
);
453+
} else {
441454
preprocessor_names.add_dependency(before, name);
442455
}
443456
}

0 commit comments

Comments
 (0)