gh68 - xts create - #75
Conversation
|
I have read the CLA Document and I hereby sign the CLA zghp seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
There was a problem hiding this comment.
Pull request overview
Adds a new xts create built-in command to the XTS CLI, providing an interactive wizard to generate .xts YAML workflow files and accompanying tests to validate the behavior.
Changes:
- Introduces
src/xts_core/create.pywith an interactive.xtsfile creation wizard. - Wires the new
createsubcommand into the main CLI dispatcher (src/xts_core/xts.py). - Adds pytest coverage for wizard output, overwrite protection, extension validation, and CLI dispatch (
test/test_xts_all_cases.py).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/test_xts_all_cases.py | Adds tests covering the new xts create behavior and CLI dispatch. |
| src/xts_core/xts.py | Registers create as a built-in subcommand and dispatches to run_create(). |
| src/xts_core/create.py | Implements the interactive wizard that writes a YAML .xts file to disk. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| """Interactive creation of XTS configuration files.""" | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import yaml | ||
|
|
| def run_create(output_path: str | None = None) -> int: | ||
| """Run the interactive XTS file creation wizard.""" | ||
| print("Create an XTS configuration") | ||
| path = Path(output_path or _prompt("Output file", "example.xts")).expanduser() | ||
|
|
||
| if path.suffix.lower() != ".xts": | ||
| print(f"Output file must use the .xts extension: {path}") | ||
| return 1 | ||
|
|
||
| if path.exists() and not _prompt_yes_no(f"File already exists: {path}. Overwrite it?"): | ||
| print(f"Cancelled; existing file was not changed: {path}") | ||
| return 1 |
No description provided.