fix: resolve CI linting and type errors
Some checks failed
CI / test (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / type-check (push) Has been cancelled

This commit is contained in:
2026-02-04 12:58:06 +00:00
parent 508e1e8261
commit 48edd1a9e0

View File

@@ -1,4 +1,7 @@
"""Registry commands for sharing prompts."""
import click import click
from promptforge.registry import LocalRegistry, RemoteRegistry, RegistryEntry from promptforge.registry import LocalRegistry, RemoteRegistry, RegistryEntry
from promptforge.core.prompt import Prompt from promptforge.core.prompt import Prompt
@@ -51,8 +54,9 @@ def registry_add(ctx, prompt_name: str, author: str):
@registry.command("search") @registry.command("search")
@click.argument("query") @click.argument("query")
@click.option("--limit", default=20, help="Maximum results")
@click.pass_obj @click.pass_obj
def registry_search(ctx, query: str): def registry_search(ctx, query: str, limit: int):
"""Search local registry.""" """Search local registry."""
registry = LocalRegistry() registry = LocalRegistry()
results = registry.search(query) results = registry.search(query)
@@ -61,7 +65,7 @@ def registry_search(ctx, query: str):
click.echo("No results found") click.echo("No results found")
return return
for result in results: for result in results[:limit]:
entry = result.entry entry = result.entry
click.echo(f"{entry.name} (score: {result.relevance_score})") click.echo(f"{entry.name} (score: {result.relevance_score})")
if entry.description: if entry.description:
@@ -79,7 +83,7 @@ def registry_pull(ctx, entry_id: str):
if remote.pull(entry_id, local): if remote.pull(entry_id, local):
click.echo(f"Pulled entry {entry_id}") click.echo(f"Pulled entry {entry_id}")
else: else:
click.echo(f"Entry not found", err=True) click.echo("Entry not found", err=True)
raise click.Abort() raise click.Abort()
@@ -104,4 +108,4 @@ def registry_publish(ctx, prompt_name: str):
click.echo(f"Published '{prompt_name}' as {published.id}") click.echo(f"Published '{prompt_name}' as {published.id}")
except Exception as e: except Exception as e:
click.echo(f"Publish error: {e}", err=True) click.echo(f"Publish error: {e}", err=True)
raise click.Abort() raise click.Abort()