chore: 移除devcontainer轻量环境的部分非必要依赖 (#14499)

对 devcontainer 的改动如下:
1. 在轻量环境中,
   - 移除 `python` 及其相关格式化扩展 `black` 和 `isort`
   - 移除 `black` 和 `isort` 等 pip 包
2. 在所有环境中,
   - 将 VS Code 的默认主题设置为 `Default Dark Modern`

* chore: 移除devcontainer轻量环境的部分非必要依赖

* chore: 将编辑器默认颜色主题调整为暗色

* chore: 将空白环境的post-create脚本独立,与其它环境一致

* chore: 把maa扩展加回来
This commit is contained in:
Lucien Shaw
2025-10-28 11:58:09 +08:00
committed by GitHub
parent d59144c549
commit 7caca829a1
5 changed files with 24 additions and 21 deletions

View File

@@ -22,7 +22,7 @@ RUN eval "$(conda shell.bash hook)" \
&& conda install -y \
python=$PYTHON_VERSION \
conda-forge::nodejs=$NODEJS_VERSION \
&& pip install pre-commit black isort
&& pip install pre-commit
# Finalize conda setup
RUN conda init \

View File

@@ -21,9 +21,6 @@
"vscode": {
"extensions": [
"nekosu.maa-support",
"ms-python.python",
"ms-python.black-formatter",
"ms-python.isort",
"esbenp.prettier-vscode",
"DavidAnson.vscode-markdownlint",
"yzhang.markdown-all-in-one",
@@ -31,26 +28,13 @@
"mkxml.vscode-filesize"
],
"settings": {
// Color theme
"workbench.colorTheme": "Default Dark Modern",
// Editor formatting
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
// Language-specific formatting
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
// Python formatting and linting
"isort.args": ["--profile", "black"],
// Python runtime
"python.terminal.launchArgs": ["-u"],
"python.defaultInterpreterPath": "/home/vscode/miniconda/envs/maa/bin/python",
"python.terminal.activateEnvironment": false,
// Performance optimizations
"search.exclude": {
"**/node_modules": true,

View File

@@ -34,6 +34,9 @@
"mkxml.vscode-filesize"
],
"settings": {
// Color theme
"workbench.colorTheme": "Default Dark Modern",
// Editor formatting
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",

View File

@@ -1,5 +1,13 @@
{
"name": "Plain Env (Nothing Installed)",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"postCreateCommand": "git config --global --add safe.directory \"$(pwd)\" && git submodule foreach --recursive 'git config --global --add safe.directory \"$toplevel/$path\"'"
"postCreateCommand": "bash .devcontainer/post-create.sh",
"customizations": {
"vscode": {
"settings": {
// Color theme
"workbench.colorTheme": "Default Dark Modern"
}
}
}
}

View File

@@ -0,0 +1,8 @@
#!/bin/bash
WORKSPACE=$(pwd)
echo "===================="
cd "$WORKSPACE"
echo "Setting up git safe.directory for $WORKSPACE and its submodules..."
git config --global --add safe.directory "$WORKSPACE"
git submodule foreach --recursive 'git config --global --add safe.directory "$toplevel/$path"'