wip: feat: workspace tmux remove

This commit is contained in:
Waylon Walker 2025-11-26 10:54:17 -06:00
parent 7ec81ffdc7
commit 0bdfb253ef
2 changed files with 6 additions and 12 deletions

View file

@ -81,16 +81,16 @@ select = [
# "INT", # flake8-gettext # "INT", # flake8-gettext
# "ARG", # flake8-unused-arguments # "ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib "PTH", # flake8-use-pathlib
# "ERA", # eradicate "ERA", # eradicate
"PD", # pandas-vet "PD", # pandas-vet
"PGH", # pygrep-hooks "PGH", # pygrep-hooks
# "PL", # Pylint # "PL", # Pylint
# "PLC", # Convention "PLC", # Convention
"PLE", # Error "PLE", # Error
# "PLR", # Refactor # "PLR", # Refactor
"PLW", # Warning "PLW", # Warning
# "TRY", # tryceratops "TRY", # tryceratops
"NPY", # NumPy-specific rules "NPY", # NumPy-specific rules
# "RUF", # Ruff-specific rules "RUF", # Ruff-specific rules
] ]

View file

@ -158,7 +158,8 @@ def get_git_status(repo_path: Path) -> GitStatus:
for line in out.splitlines(): for line in out.splitlines():
if line.startswith("# branch.ab"): if line.startswith("# branch.ab"):
# Example: "# branch.ab +1 -2" # Example:
# branch.ab +1 -2
m = re.search(r"\+(\d+)\s+-(\d+)", line) m = re.search(r"\+(\d+)\s+-(\d+)", line)
if m: if m:
ahead = int(m.group(1)) ahead = int(m.group(1))
@ -920,7 +921,6 @@ def git_status_porcelain(repo_path: Path) -> List[Tuple[str, str]]:
for line in out.splitlines(): for line in out.splitlines():
if not line.strip(): if not line.strip():
continue continue
# Format: 'XY path'
status = line[:2] status = line[:2]
path = line[3:] path = line[3:]
changes.append((status, path)) changes.append((status, path))
@ -1047,7 +1047,6 @@ def commit_workspace(
f"[red]Workspace '{ws_dir.name}' does not exist at {ws_dir}[/red]" f"[red]Workspace '{ws_dir.name}' does not exist at {ws_dir}[/red]"
) )
raise typer.Exit(1) raise typer.Exit(1)
title, _desc = read_workspace_readme(ws_dir)
worktrees: List[Path] = [] worktrees: List[Path] = []
for child in sorted(p for p in ws_dir.iterdir() if p.is_dir()): for child in sorted(p for p in ws_dir.iterdir() if p.is_dir()):
@ -1199,8 +1198,6 @@ def status_workspace(
title, desc = read_workspace_readme(ws_dir) title, desc = read_workspace_readme(ws_dir)
# if desc:
# console.print(Panel(desc, title=title))
table = Table( table = Table(
title=f"Status for workspace:'{title}'\n(dir: {ws_dir.name})\n\n{desc}", title=f"Status for workspace:'{title}'\n(dir: {ws_dir.name})\n\n{desc}",
@ -1549,7 +1546,6 @@ def tmux_cli_attach(
""" """
Attach or create a session for a repo in a workspace. Attach or create a session for a repo in a workspace.
""" """
# ws_dir = get_workspace_dir(workspace)
_settings, _repos_dir, workspaces_dir = get_ctx_paths(ctx) _settings, _repos_dir, workspaces_dir = get_ctx_paths(ctx)
ws_dir = find_workspace_dir(workspaces_dir, workspace) ws_dir = find_workspace_dir(workspaces_dir, workspace)
if not ws_dir: if not ws_dir:
@ -1638,8 +1634,6 @@ def tmux_cli_remove(
for session_name in tmux_sessions: for session_name in tmux_sessions:
remove_session(session_name) remove_session(session_name)
#
# remove_session_if_exists(session_name)
app.add_typer(tmux_app) app.add_typer(tmux_app)