diff --git a/crates/ruff_dev/src/generate_all.rs b/crates/ruff_dev/src/generate_all.rs index 54280cb7af..5e548429af 100644 --- a/crates/ruff_dev/src/generate_all.rs +++ b/crates/ruff_dev/src/generate_all.rs @@ -14,11 +14,11 @@ pub struct Args { #[derive(Copy, Clone, PartialEq, Eq, clap::ValueEnum, Default)] pub enum Mode { - /// Update the content in the `configuration.md` + /// Update the content in the `configuration.md`. #[default] Write, - /// Don't write to the file, check if the file is up-to-date and error if not + /// Don't write to the file, check if the file is up-to-date and error if not. Check, /// Write the generated help to stdout (rather than to `docs/configuration.md`). @@ -26,21 +26,16 @@ pub enum Mode { } impl Mode { - const fn is_check(self) -> bool { - matches!(self, Mode::Check) - } - pub(crate) const fn is_dry_run(self) -> bool { matches!(self, Mode::DryRun) } } pub fn main(args: &Args) -> Result<()> { - // Not checked in - if !args.mode.is_check() { - generate_docs::main(&generate_docs::Args { dry_run: true })?; - } generate_json_schema::main(&generate_json_schema::Args { mode: args.mode })?; generate_cli_help::main(&generate_cli_help::Args { mode: args.mode })?; + generate_docs::main(&generate_docs::Args { + dry_run: args.mode.is_dry_run(), + })?; Ok(()) }