{ "version": "2.0.0", "tasks": [ { "label": "NebulaShell: 安装依赖", "type": "shell", "command": "pip install -r requirements.txt", "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": true, "clear": true }, "problemMatcher": [], "options": { "cwd": "${workspaceFolder}" } }, { "label": "NebulaShell: 启动开发服务器", "type": "shell", "command": "python -m oss.cli serve", "group": "none", "isBackground": true, "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "dedicated", "showReuseMessage": true, "clear": false }, "problemMatcher": [ { "pattern": [ { "regexp": ".", "file": 1, "location": 2, "message": 3 } ], "background": { "activeOnStart": true, "beginsPattern": ".*启动 NebulaShell 服务.*", "endsPattern": ".*服务已启动.*" } } ], "options": { "cwd": "${workspaceFolder}" } }, { "label": "NebulaShell: 运行测试", "type": "shell", "command": "pytest -v --tb=short", "group": "test", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated", "showReuseMessage": true, "clear": true }, "problemMatcher": [ { "owner": "python", "fileLocation": ["relative", "${workspaceFolder}"], "pattern": [ { "regexp": "^test_(.*)\\.py::(.*) (PASSED|FAILED|ERROR)$", "file": 1, "location": 2, "severity": 3 } ] } ], "options": { "cwd": "${workspaceFolder}" } }, { "label": "NebulaShell: 代码检查", "type": "shell", "command": "python -m pylint oss/ store/@{NebulaShell}/ --rcfile=${workspaceFolder}/.pylintrc || echo 'Pylint检查完成'", "group": "build", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated", "showReuseMessage": true, "clear": true }, "problemMatcher": [ { "owner": "python", "fileLocation": ["relative", "${workspaceFolder}"], "pattern": [ { "regexp": "^(.*):(\\d+):(\\d+): (\\w+): (.*)$", "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 } ] } ], "options": { "cwd": "${workspaceFolder}" } }, { "label": "NebulaShell: 格式化代码", "type": "shell", "command": "python -m black oss/ store/@{NebulaShell}/", "group": "build", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated", "showReuseMessage": true, "clear": true }, "problemMatcher": [], "options": { "cwd": "${workspaceFolder}" } }, { "label": "NebulaShell: 清理缓存文件", "type": "shell", "command": "find . -type f -name '*.pyc' -delete && find . -type d -name '__pycache__' -delete && find . -type f -name '.pid' -delete", "group": "build", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "dedicated", "showReuseMessage": true, "clear": true }, "problemMatcher": [], "options": { "cwd": "${workspaceFolder}" } }, { "label": "NebulaShell: 查看服务状态", "type": "shell", "command": "if [ -f .pid ]; then echo '服务正在运行,PID: ' && cat .pid; else echo '服务未运行'; fi", "group": "none", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "new", "showReuseMessage": true, "clear": true }, "problemMatcher": [], "options": { "cwd": "${workspaceFolder}" } }, { "label": "NebulaShell: 停止服务", "type": "shell", "command": "if [ -f .pid ]; then kill $(cat .pid) && rm -f .pid && echo '服务已停止'; else echo '服务未运行'; fi", "group": "none", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "new", "showReuseMessage": true, "clear": true }, "problemMatcher": [], "options": { "cwd": "${workspaceFolder}" } }, { "label": "NebulaShell: 重启服务", "type": "shell", "dependsOrder": "sequence", "dependsOn": [ "NebulaShell: 停止服务", "NebulaShell: 启动开发服务器" ], "group": "none", "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "dedicated", "showReuseMessage": true, "clear": true }, "problemMatcher": [], "options": { "cwd": "${workspaceFolder}" } } ] }