From 810047a074acc0fd94fb14cd8c3f0363301e0956 Mon Sep 17 00:00:00 2001 From: hermes-bot Date: Wed, 5 Aug 2026 10:46:52 -0300 Subject: [PATCH] fix: shellcheck warnings for Nix writeShellApplication - Remove unused SCRIPT_DIR (SC2034) - Split local var= declaration from assignment (SC2155) - Replace &&/|| with if/else in cmd_clean (SC2015) - Add shellcheck disable for .venv source (SC1091) --- tooling/dev-orchestrator | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tooling/dev-orchestrator b/tooling/dev-orchestrator index d53b45c..50c65f0 100755 --- a/tooling/dev-orchestrator +++ b/tooling/dev-orchestrator @@ -3,7 +3,6 @@ # Zero dependencies beyond git, opencode, openspec. No heavy binaries. set -euo pipefail -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" REPO="${DEV_FLOW_REPO:-$(pwd)}" WORKTREE_ROOT="$REPO/../.worktrees" @@ -57,8 +56,8 @@ cmd_spec() { } # ── create worktree ── - local branch="$(_wt_branch "$name")" - local wt="$(_wt_path "$name")" + local branch; branch="$(_wt_branch "$name")" + local wt; wt="$(_wt_path "$name")" echo "── Creating worktree: $wt [$branch] ──" git worktree add -b "$branch" "$wt" HEAD @@ -68,6 +67,7 @@ cmd_spec() { (cd "$wt" && npm install --silent 2>&1 | tail -1) || true fi if [ -f "$wt/pyproject.toml" ] || [ -f "$wt/setup.py" ]; then + # shellcheck disable=SC1091 (cd "$wt" && [ -d .venv ] || python3 -m venv .venv && . .venv/bin/activate && pip install -e . -q 2>&1 | tail -1) || true fi @@ -88,7 +88,7 @@ cmd_fill() { local name="$1" _guard - local wt="$(_wt_path "$name")" + local wt; wt="$(_wt_path "$name")" [ -d "openspec/changes/$name" ] || _die "spec not found: openspec/changes/$name. Run: dev-orchestrator spec $name" echo "── AI filling spec from conversation context ──" @@ -118,10 +118,10 @@ cmd_build() { local name="$1" _guard - local wt="$(_wt_path "$name")" + local wt; wt="$(_wt_path "$name")" [ -d "$wt" ] || _die "worktree not found: $wt. Run: dev-orchestrator spec $name" - local branch="$(_wt_branch "$name")" + local branch; branch="$(_wt_branch "$name")" local max_retries=3 for attempt in $(seq 1 $max_retries); do @@ -221,7 +221,7 @@ cmd_status() { for wt in "$WORKTREE_ROOT"/*/; do [ -d "$wt" ] || continue local name=$(basename "$wt") - local branch="$(_wt_branch "$name")" + local branch; branch="$(_wt_branch "$name")" local commits="?" [ -d "$wt/.git" ] && commits=$(cd "$wt" && git rev-list --count "$branch" -- 2>/dev/null || echo "?") commits="${commits:-0}" @@ -247,12 +247,16 @@ cmd_status() { cmd_clean() { local name="$1" cd "$REPO" - local wt="$(_wt_path "$name")" - local branch="$(_wt_branch "$name")" + local wt; wt="$(_wt_path "$name")" + local branch; branch="$(_wt_branch "$name")" git worktree remove "$wt" 2>/dev/null || true git branch -D "$branch" 2>/dev/null || true - [ ! -d "$wt" ] && _ok "cleaned $name" || _die "could not remove $wt" + if [ ! -d "$wt" ]; then + _ok "cleaned $name" + else + _die "could not remove $wt" + fi } # ── dispatch ─────────────────────────────────────────────────────