From e43720cd626fee0529ef4e1f41f92d03b7d913eb Mon Sep 17 00:00:00 2001 From: Johan Lundberg Date: Wed, 18 Feb 2026 11:34:00 +0100 Subject: [PATCH] refactor: fix lint and type check issues in CLI module --- src/porchlight/cli.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/porchlight/cli.py b/src/porchlight/cli.py index da2165b..6bc5f7a 100644 --- a/src/porchlight/cli.py +++ b/src/porchlight/cli.py @@ -1,6 +1,6 @@ import asyncio from pathlib import Path -from typing import Annotated, Optional +from typing import Annotated import typer @@ -48,11 +48,11 @@ async def _initial_admin(settings: Settings, username: str, groups: list[str]) - @app.command() def create_invite( username: str, - ttl: Annotated[Optional[int], typer.Option(help="Link expiration in seconds")] = None, - note: Annotated[Optional[str], typer.Option(help="Optional note stored with the link")] = None, + ttl: Annotated[int | None, typer.Option(help="Link expiration in seconds")] = None, + note: Annotated[str | None, typer.Option(help="Optional note stored with the link")] = None, ) -> None: """Generate a magic link registration URL for a new user.""" - settings = Settings() + settings = Settings() # type: ignore[call-arg] effective_ttl = ttl if ttl is not None else settings.invite_ttl url = asyncio.run(_create_invite(settings, username, effective_ttl, note)) typer.echo(url) @@ -61,10 +61,10 @@ def create_invite( @app.command() def initial_admin( username: str, - group: Annotated[Optional[list[str]], typer.Option(help="Groups to assign (repeatable)")] = None, + group: Annotated[list[str] | None, typer.Option(help="Groups to assign (repeatable)")] = None, ) -> None: """Bootstrap the first admin user with a registration link.""" - settings = Settings() + settings = Settings() # type: ignore[call-arg] groups = group if group is not None else ["admin", "users"] url = asyncio.run(_initial_admin(settings, username, groups)) typer.echo(url)