Skip to content
Merged
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
35 changes: 30 additions & 5 deletions src/navi_bootstrap/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ def cli() -> None:


@cli.command()
@click.option("--spec", required=True, type=click.Path(exists=True, path_type=Path), help="Path to the project spec YAML file")
@click.option(
"--spec",
required=True,
type=click.Path(exists=True, path_type=Path),
help="Path to the project spec YAML file",
)
@click.option("--pack", type=str, default=None, help="Name of the template pack to validate")
def validate(spec: Path, pack: str | None) -> None:
"""Validate a spec (and optionally a pack manifest)."""
Expand All @@ -72,9 +77,19 @@ def validate(spec: Path, pack: str | None) -> None:


@cli.command("render")
@click.option("--spec", required=True, type=click.Path(exists=True, path_type=Path), help="Path to the project spec YAML file")
@click.option(
"--spec",
required=True,
type=click.Path(exists=True, path_type=Path),
help="Path to the project spec YAML file",
)
@click.option("--pack", required=True, type=str, help="Name of the template pack to render")
@click.option("--out", type=click.Path(path_type=Path), default=None, help="Output directory (defaults to spec name)")
@click.option(
"--out",
type=click.Path(path_type=Path),
default=None,
help="Output directory (defaults to spec name)",
)
@click.option("--dry-run", is_flag=True, default=False, help="Preview output without writing files")
@click.option("--skip-resolve", is_flag=True, default=False, help="Skip SHA resolution (offline)")
@click.option("--trust", is_flag=True, default=False, help="Execute hooks from manifest (unsafe)")
Expand Down Expand Up @@ -167,7 +182,12 @@ def render_cmd(


@cli.command()
@click.option("--spec", required=True, type=click.Path(exists=True, path_type=Path), help="Path to the project spec YAML file")
@click.option(
"--spec",
required=True,
type=click.Path(exists=True, path_type=Path),
help="Path to the project spec YAML file",
)
@click.option("--pack", required=True, type=str, help="Name of the template pack to apply")
@click.option(
"--target", required=True, type=click.Path(exists=True, file_okay=False, path_type=Path)
Expand Down Expand Up @@ -271,7 +291,12 @@ def apply(


@cli.command("diff")
@click.option("--spec", required=True, type=click.Path(exists=True, path_type=Path), help="Path to the project spec YAML file")
@click.option(
"--spec",
required=True,
type=click.Path(exists=True, path_type=Path),
help="Path to the project spec YAML file",
)
@click.option("--pack", required=True, type=str, help="Name of the template pack to diff")
@click.option(
"--target", required=True, type=click.Path(exists=True, file_okay=False, path_type=Path)
Expand Down
7 changes: 3 additions & 4 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,11 @@ def test_detects_async_test_functions(self, tmp_path: Path) -> None:
tests = tmp_path / "tests"
tests.mkdir()
test_file = tests / "test_example.py"
test_file.write_text(
"def test_sync(): pass\n"
"async def test_async(): pass\n"
)
test_file.write_text("def test_sync(): pass\nasync def test_async(): pass\n")
result = detect_test_info(tmp_path)
assert result["test_count"] == 2


# ---------------------------------------------------------------------------
# TestInspectProject
# ---------------------------------------------------------------------------
Expand Down
Loading