Skip to content

Refactor CLI build handling into helper functions#82

Merged
leynos merged 6 commits intomainfrom
codex/refactor-run-function-in-cli-module
Aug 8, 2025
Merged

Refactor CLI build handling into helper functions#82
leynos merged 6 commits intomainfrom
codex/refactor-run-function-in-cli-module

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Aug 8, 2025

Summary

  • extract build orchestration into a dedicated handle_build helper
  • factor out manifest path resolution and Ninja file creation helpers
  • keep CLI run shallow for easier maintenance

Testing

  • cargo fmt --all
  • make lint
  • make test
  • make fmt (fails: docs/srgn.md:99 MD040/fenced-code-language Fenced code blocks should have a language specified)

closes #47


https://chatgpt.com/codex/tasks/task_e_6895d788cd8883229d612eac1cd7e13c

Summary by Sourcery

Refactor the CLI’s build handling by extracting the build orchestration and file operations into dedicated helper functions to simplify the run dispatcher and improve maintainability.

Enhancements:

  • Extract the Build command logic into a new handle_build helper.
  • Introduce write_ninja_file, create_temp_ninja_file, and resolve_manifest_path helpers to centralize file creation and manifest resolution.
  • Simplify the run function by delegating Build and Manifest actions to the new helpers.
  • Refactor generate_ninja to use resolve_manifest_path for manifest discovery.

Documentation:

  • Add documentation and examples for the new helper functions.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor run function to reduce complexity by extracting helper functions

1 participant