Initialize corpus from a plugin directory.
(
corpus_source: Path = typer.Argument(..., help="Path to plugins directory to index as corpus"), # noqa: B008
corpus_dir: Path = typer.Option( # noqa: B008
Path.home() / ".plugineval" / "corpus", # noqa: B008
help="Where to store corpus index", # noqa: B008
),
)
| 131 | |
| 132 | @app.command() |
| 133 | def init( |
| 134 | corpus_source: Path = typer.Argument(..., help="Path to plugins directory to index as corpus"), # noqa: B008 |
| 135 | corpus_dir: Path = typer.Option( # noqa: B008 |
| 136 | Path.home() / ".plugineval" / "corpus", # noqa: B008 |
| 137 | help="Where to store corpus index", # noqa: B008 |
| 138 | ), |
| 139 | ) -> None: |
| 140 | """Initialize corpus from a plugin directory.""" |
| 141 | if not corpus_source.exists(): |
| 142 | console.print(f"[red]Error: Source path does not exist: {corpus_source}[/red]") |
| 143 | raise typer.Exit(code=2) |
| 144 | from plugin_eval.corpus import Corpus # lazy import — Task 10 |
| 145 | |
| 146 | corpus = Corpus.init_from_source(corpus_source, corpus_dir) |
| 147 | console.print(f"[green]Corpus initialized with {corpus.size} skills at {corpus_dir}[/green]") |
| 148 | |
| 149 | |
| 150 | @app.command() |
nothing calls this directly
no test coverage detected