Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- run: uv sync --dev

- name: Lint
run: uv run ruff check src/ tests/

- name: Format
run: uv run ruff format --check src/ tests/

- name: Test
run: uv run pytest tests/ -v
44 changes: 44 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
set dotenv-load := false

# List available recipes
default:
@just --list

# Run all checks (lint + format + tests)
check: lint test

# Run ruff linter
lint:
uv run ruff check src/ tests/

# Auto-fix lint errors
fix:
uv run ruff check --fix src/ tests/

# Check formatting
fmt-check:
uv run ruff format --check src/ tests/

# Auto-format code
fmt:
uv run ruff format src/ tests/

# Run tests
test *args:
uv run pytest tests/ {{ args }}

# Run tests with verbose output
test-v *args:
uv run pytest tests/ -v {{ args }}

# Install gw as editable for development
dev:
uv pip install -e .

# Install gw as a uv tool (globally)
install:
uv tool install . --force --reinstall

# Reinstall and reload shell integration
reload: install
@echo 'Run: eval "$(gw shell-init)"'
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "grove"
version = "0.1.0"
version = "0.3.0"
description = "Git Worktree Workspace Orchestrator"
readme = "README.md"
authors = [
Expand Down
45 changes: 36 additions & 9 deletions shell/grove.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
#!/usr/bin/env bash
# Grove shell integration — wraps `gw go` with cd.
# Grove shell integration — wraps gw commands with cd support.
# Add to your shell config: eval "$(gw shell-init)"

gw() {
if [ "$1" = "go" ] && [ -n "$2" ]; then
local dir
dir="$(command gw go "$2" 2>/dev/null)"
if [ -n "$dir" ] && [ -d "$dir" ]; then
cd "$dir" || return 1
# Only capture output for commands that need cd interception.
# Everything else passes through directly (preserving prompts/colors).

if [ "$1" = "go" ]; then
local output
output="$(command gw "$@" 2>&1)"
local rc=$?
if [ $rc -eq 0 ] && [ -n "$output" ] && [ -d "$output" ]; then
cd "$output" || return 1
else
command gw go "$2"
echo "$output"
fi
return $rc
fi

# For create --go, use a temp file so stdout stays connected to the tty
local has_go=false
for arg in "$@"; do
[ "$arg" = "--go" ] && has_go=true
done

if [ "$has_go" = true ]; then
local tmpfile
tmpfile="$(mktemp)"
command gw "$@" | tee "$tmpfile"
local rc=${PIPESTATUS[0]}
local cd_line
cd_line="$(grep '^__grove_cd:' "$tmpfile")"
rm -f "$tmpfile"
if [ -n "$cd_line" ]; then
local dir="${cd_line#__grove_cd:}"
[ -d "$dir" ] && cd "$dir" || return 1
fi
else
command gw "$@"
return $rc
fi

# Default: pass through directly
command gw "$@"
}
2 changes: 1 addition & 1 deletion src/grove/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Grove — Git Worktree Workspace Orchestrator."""

__version__ = "0.1.0"
__version__ = "0.3.0"
Loading