Skip to content

Commit 62f2a73

Browse files
authored
fail when an example doesn't set doc-scrape-examples (#12964)
# Objective - Ensure that all examples are scrapped for doc ## Solution - Panic in the example tool when an example doesn't specify `doc-scrape-examples` - If an example must not be scrapped, it can set the value to false
1 parent 0256dac commit 62f2a73

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/build-templated-pages/src/examples.rs

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ fn parse_examples(panic_on_missing: bool) -> Vec<Example> {
5858
if panic_on_missing && metadatas.get(&technical_name).is_none() {
5959
panic!("Missing metadata for example {technical_name}");
6060
}
61+
if panic_on_missing && val.get("doc-scrape-examples").is_none() {
62+
panic!("Example {technical_name} is missing doc-scrape-examples");
63+
}
6164

6265
if metadatas
6366
.get(&technical_name)

0 commit comments

Comments
 (0)