mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-11 12:17:45 +02:00
[hAIk]: add lint preflight step in run.sh that runs print_errors.sh before the dev loop starts (skips gracefully if venv missing), replace python.terminal.activateEnvironment with a custom terminal-init.sh profile that sources .bash_profile then activates the backend venv, and set it as the default macOS terminal in VS Code settings
This commit is contained in:
Vendored
+7
-1
@@ -1,5 +1,11 @@
|
||||
{
|
||||
"python.defaultInterpreterPath": "${workspaceFolder}/backend/.venv/bin/python",
|
||||
"python.terminal.activateEnvironment": true,
|
||||
"terminal.integrated.profiles.osx": {
|
||||
"bash + venv": {
|
||||
"path": "/opt/homebrew/bin/bash",
|
||||
"args": ["--rcfile", "${workspaceFolder}/.vscode/terminal-init.sh"]
|
||||
}
|
||||
},
|
||||
"terminal.integrated.defaultProfile.osx": "bash + venv",
|
||||
"terminal.integrated.enablePersistentSessions": false
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
# 1. Load your normal shell setup first (brew, nvm, bun, etc.)
|
||||
[ -f "$HOME/.bash_profile" ] && source "$HOME/.bash_profile"
|
||||
|
||||
# 2. Restore the standard macOS prompt (normally set by /etc/bashrc for login shells)
|
||||
PS1='\h:\W \u\$ '
|
||||
|
||||
# 3. Activate the project venv LAST, so it wins the PATH ordering
|
||||
VENV="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/backend/.venv/bin/activate"
|
||||
[ -f "$VENV" ] && source "$VENV"
|
||||
@@ -158,6 +158,18 @@ fi
|
||||
# directly), so the env stays unset in production and uvicorn boots in
|
||||
# its leaner non-reload mode.
|
||||
export OPENSWARM_DEV=1
|
||||
|
||||
# --- Lint preflight: surface violations before the dev loop starts ---
|
||||
# print_errors.sh -> linter/lint.py needs watchfiles + vulture, which live in
|
||||
# the backend venv (installed by backend/run.sh when OPENSWARM_DEV=1). Prepend
|
||||
# the venv's bin to PATH so the script's bare `python3` resolves there. Skip
|
||||
# silently on a fresh checkout where the venv isn't built yet.
|
||||
VENV_BIN="$PROJECT_ROOT/backend/.venv/bin"
|
||||
if [ -x "$VENV_BIN/python3" ]; then
|
||||
echo -e "${YELLOW}${BOLD}[lint]${RESET} Checking for linter violations..."
|
||||
PATH="$VENV_BIN:$PATH" bash "$PROJECT_ROOT/linter/print_errors.sh" "$PROJECT_ROOT"
|
||||
fi
|
||||
|
||||
echo -e "${BLUE}${BOLD}[backend]${RESET} Starting backend server..."
|
||||
bash "$PROJECT_ROOT/backend/run.sh" > >(
|
||||
while IFS= read -r line; do
|
||||
|
||||
Reference in New Issue
Block a user