Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ suite**:
`close-checklist` document, valid against the published v0.1 schema;
- `configs/workspace.json` — a self-describing copy of the config.

The optional `workspace.folders` setting ensures additional folders exist under
the workspace root. It is not an allowlist: `init` still creates the suite
structural folders needed for the generated config, examples, fixtures, and
pipeline files listed above.

Re-running is safe (idempotent): existing paths are reported as `exists`.

### 2. Validate a workspace config
Expand Down
2 changes: 1 addition & 1 deletion src/maxed_cli/schemas/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"folders": {
"type": "array",
"description": "Sub-folders to create under the workspace root.",
"description": "Additional workspace folders to create under the workspace root. maxed init also creates suite structural folders needed for generated config, examples, fixtures, and pipeline files.",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true,
"default": ["workpapers", "configs", "fixtures", "exports"]
Expand Down
17 changes: 17 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,23 @@ def test_init_scaffolds(tmp_path: Path) -> None:
assert (ws / "workpapers" / "example.workpaper.json").is_file()


def test_init_custom_folders_are_not_structural_folder_allowlist(tmp_path: Path) -> None:
config = {
**VALID_CONFIG,
"workspace": {"root": "./ws", "folders": ["exports"]},
}
cfg = _yaml(tmp_path / "c.yaml", config)
result = runner.invoke(app, ["init", str(cfg), "--base-dir", str(tmp_path)])
assert result.exit_code == 0

ws = tmp_path / "ws"
assert (ws / "exports").is_dir()
assert (ws / "configs" / "workspace.json").is_file()
assert (ws / "fixtures" / "statement.csv").is_file()
assert (ws / "pipeline" / "import_transactions.py").is_file()
assert (ws / "workpapers" / "example.workpaper.json").is_file()


def test_init_is_idempotent(tmp_path: Path) -> None:
cfg = _yaml(tmp_path / "c.yaml", VALID_CONFIG)
first = runner.invoke(app, ["init", str(cfg), "--base-dir", str(tmp_path)])
Expand Down