Skip to content
Merged
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
4 changes: 3 additions & 1 deletion t4_devkit/cli/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import importlib
import importlib.metadata

import click
import typer
from rich.console import Console

Expand All @@ -11,6 +12,7 @@

def version_callback(value: bool) -> None:
if value:
ctx = click.get_current_context()
version = importlib.metadata.version("t4-devkit")
console.print(f"[bold green]t4viz[/bold green]: [cyan]{version}[/cyan]")
console.print(f"[bold green]{ctx.info_name}[/bold green]: [cyan]{version}[/cyan]")

Copilot AI Aug 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ctx.info_name attribute may be None in some contexts, which would result in displaying 'None' in the version output. Consider adding a fallback value or null check.

Suggested change
console.print(f"[bold green]{ctx.info_name}[/bold green]: [cyan]{version}[/cyan]")
info_name = ctx.info_name if ctx.info_name is not None else "t4-devkit"
console.print(f"[bold green]{info_name}[/bold green]: [cyan]{version}[/cyan]")

Copilot uses AI. Check for mistakes.
raise typer.Exit()
Loading