diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 0638568..6cd600f 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -15,7 +15,7 @@ permissions: jobs: rust-ci: - uses: hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@d135b05bfc647d0c0fbfedc7e80f37ea50f49236 + uses: hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@81dbf2dd854b1444fd6236fa2352474383b2c2b9 permissions: actions: read contents: read diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 2990dfb..ee494bd 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -71,6 +71,16 @@ pub fn generate_all(manifest: &Manifest, output_dir: &str) -> Result//`, where `iser_name` is derived from +/// `manifest.language.name`. Existing generated files are overwritten. +/// Returns [`ScaffoldResult::Success`] containing the repository's root path +/// and generated file contents. +/// +/// # Errors +/// +/// Returns an error if semantic validation fails or output directories cannot +/// be created or files written. A write failure may leave partial output. pub fn generate_repo_only(manifest: &Manifest, output_dir: &str) -> Result { // Step 1: Deep validation let report = parser::validate_or_bail(manifest)?; @@ -93,10 +103,7 @@ pub fn generate_repo_only(manifest: &Manifest, output_dir: &str) -> Result { - anyhow::bail!( - "{}", - result.error_message().unwrap_or("unknown error") - ); + anyhow::bail!("{}", result.error_message().unwrap_or("unknown error")); } } @@ -110,7 +117,17 @@ pub fn generate_repo_only(manifest: &Manifest, output_dir: &str) -> Result/`; the cartridge vendors the ADR-0006 /// invoke-shim at `ffi/cartridge_shim.zig` and so builds wherever it sits. /// +/// Here, `iser_name` is derived from `manifest.language.name`. Existing +/// generated files are overwritten. Returns +/// [`cartridge::CartridgeScaffoldResult::Success`] containing the cartridge's +/// root path and generated file contents. +/// /// See `cartridge` module docs and standards#89 Phase 2b for context. +/// +/// # Errors +/// +/// Returns an error if semantic validation fails or output directories cannot +/// be created or files written. A write failure may leave partial output. pub fn generate_cartridge( manifest: &Manifest, output_dir: &str, @@ -132,10 +149,7 @@ pub fn generate_cartridge( ); } _ => { - anyhow::bail!( - "{}", - result.error_message().unwrap_or("unknown error") - ); + anyhow::bail!("{}", result.error_message().unwrap_or("unknown error")); } }