Skip to content

Index

ruff_sync.tui

TUI package for ruff-sync.

get_tui_app

get_tui_app()

Lazy-load the TUI and return the RuffSyncApp class.

Returns:

Type Description
type[RuffSyncApp]

The RuffSyncApp class.

Raises:

Type Description
DependencyError

If 'textual' is not installed or the TUI cannot be loaded.

Source code in src/ruff_sync/tui/__init__.py
def get_tui_app() -> type[RuffSyncApp]:
    """Lazy-load the TUI and return the RuffSyncApp class.

    Returns:
        The RuffSyncApp class.

    Raises:
        DependencyError: If 'textual' is not installed or the TUI cannot be loaded.
    """
    from ruff_sync.dependencies import require_dependency  # noqa: PLC0415

    require_dependency("textual", extra_name="tui")

    from ruff_sync.tui.app import RuffSyncApp  # noqa: PLC0415

    return RuffSyncApp