mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-19 23:07:33 +00:00
Add a generate-all
step and auto-generate settings.md
(#5080)
## Summary Ensures that `generate-all` generates both the JSON Schema and the `settings.md` API reference.
This commit is contained in:
parent
6275b54d51
commit
41cd4bee58
7 changed files with 287 additions and 25 deletions
30
crates/uv-dev/src/generate_all.rs
Normal file
30
crates/uv-dev/src/generate_all.rs
Normal file
|
@ -0,0 +1,30 @@
|
|||
//! Run all code and documentation generation steps.
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::{generate_json_schema, generate_options_reference};
|
||||
|
||||
#[derive(clap::Args)]
|
||||
pub(crate) struct Args {
|
||||
#[arg(long, default_value_t, value_enum)]
|
||||
mode: Mode,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, clap::ValueEnum, Default)]
|
||||
pub(crate) enum Mode {
|
||||
/// 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.
|
||||
Check,
|
||||
|
||||
/// Write the generated help to stdout.
|
||||
DryRun,
|
||||
}
|
||||
|
||||
pub(crate) fn main(args: &Args) -> Result<()> {
|
||||
generate_json_schema::main(&generate_json_schema::Args { mode: args.mode })?;
|
||||
generate_options_reference::main(&generate_options_reference::Args { mode: args.mode })?;
|
||||
Ok(())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue