Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'xtask/src/codegen/diagnostics_docs.rs')
| -rw-r--r-- | xtask/src/codegen/diagnostics_docs.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xtask/src/codegen/diagnostics_docs.rs b/xtask/src/codegen/diagnostics_docs.rs index 7858e9ae1b..4a47a5f6aa 100644 --- a/xtask/src/codegen/diagnostics_docs.rs +++ b/xtask/src/codegen/diagnostics_docs.rs @@ -10,13 +10,15 @@ use crate::{ pub(crate) fn generate(check: bool) { let diagnostics = Diagnostic::collect().unwrap(); - if !check { - let contents = - diagnostics.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n"); - let contents = add_preamble(crate::flags::CodegenType::DiagnosticsDocs, contents); - let dst = project_root().join("docs/book/src/diagnostics_generated.md"); - fs::write(dst, contents).unwrap(); + // Do not generate docs when run with `--check` + if check { + return; } + let contents = + diagnostics.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n"); + let contents = add_preamble(crate::flags::CodegenType::DiagnosticsDocs, contents); + let dst = project_root().join("docs/book/src/diagnostics_generated.md"); + fs::write(dst, contents).unwrap(); } #[derive(Debug)] |