From c7377647fa153fa89892625591d8e620879d0b1a Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Mon, 14 Nov 2022 19:05:34 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Feature:=20=E5=8D=87=E7=BA=A7=20de?= =?UTF-8?q?vcontainer=20=E9=85=8D=E7=BD=AE=20(#1392)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 15 --------- .devcontainer/devcontainer.json | 57 ++++----------------------------- .pre-commit-config.yaml | 2 +- CONTRIBUTING.md | 2 +- website/static/adapters.json | 2 +- website/static/bots.json | 2 +- website/static/plugins.json | 2 +- website/versions.json | 4 +-- 8 files changed, 12 insertions(+), 74 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 628f3ff8..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/codespaces-linux/.devcontainer/base.Dockerfile - -FROM mcr.microsoft.com/vscode/devcontainers/universal:2-focal - -# ** [Optional] Uncomment this section to install additional packages. ** -# USER root -# -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - -USER codespace - -# [Required] Poetry -RUN curl -sSL https://install.python-poetry.org | python - -y -RUN poetry config virtualenvs.in-project true diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ec63cce1..aca5d823 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,32 +1,13 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/codespaces-linux { - "name": "GitHub Codespaces (Default)", - - "build": { - "dockerfile": "Dockerfile" + "name": "Default Linux Universal", + "image": "mcr.microsoft.com/devcontainers/universal:2-linux", + "features": { + "ghcr.io/devcontainers-contrib/features/poetry:1": {} }, - - // Configure tool-specific properties. + "postCreateCommand": "poetry install && poetry run pre-commit install && yarn install", "customizations": { - // Configure properties specific to VS Code. "vscode": { - // Set *default* container specific settings.json values on container create. "settings": { - "go.toolsManagement.checkForUpdates": "local", - "go.useLanguageServer": true, - "go.gopath": "/go", - "python.defaultInterpreterPath": "/opt/python/latest/bin/python", - "python.linting.enabled": true, - "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", - "python.formatting.blackPath": "/usr/local/py-utils/bin/black", - "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", - "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", - "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", - "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", - "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", - "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", - "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", "python.analysis.diagnosticMode": "workspace", "python.analysis.typeCheckingMode": "basic", "[python]": { @@ -50,7 +31,6 @@ "[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "lldb.executable": "/usr/bin/lldb", "files.exclude": { "**/__pycache__": true }, @@ -59,10 +39,7 @@ "**/__pycache__": true } }, - - // Add the IDs of extensions you want installed when the container is created. "extensions": [ - "GitHub.vscode-pull-request-github", "ms-python.python", "ms-python.vscode-pylance", "ms-python.isort", @@ -72,27 +49,5 @@ "bradlc.vscode-tailwindcss" ] } - }, - - "remoteUser": "codespace", - - "overrideCommand": false, - - "mounts": [ - "source=codespaces-linux-var-lib-docker,target=/var/lib/docker,type=volume" - ], - - "runArgs": [ - "--cap-add=SYS_PTRACE", - "--security-opt", - "seccomp=unconfined", - "--privileged", - "--init" - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // "oryx build" will automatically install your dependencies and attempt to build your project - "postCreateCommand": "poetry install && poetry run pre-commit install && yarn install" + } } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c791cdd..9834f53b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: rev: v3.0.0-alpha.4 hooks: - id: prettier - types_or: [javascript, jsx, ts, tsx, markdown, yaml] + types_or: [javascript, jsx, ts, tsx, markdown, yaml, json] stages: [commit] - repo: https://github.com/nonebot/nonemoji diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8c79ccb..194faf02 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ pre-commit install ### 使用 GitHub Codespaces(Dev Container) -使用 GitHub Codespaces 选择 `NoneBot2` 项目,然后选择 `.devcontainer/devcontainer.json` 配置即可。 +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=master&repo=289605524) ### Commit 规范 diff --git a/website/static/adapters.json b/website/static/adapters.json index baa02bdd..720260aa 100644 --- a/website/static/adapters.json +++ b/website/static/adapters.json @@ -114,4 +114,4 @@ ], "is_official": false } -] \ No newline at end of file +] diff --git a/website/static/bots.json b/website/static/bots.json index 9fc23c03..43a4ebb6 100644 --- a/website/static/bots.json +++ b/website/static/bots.json @@ -311,4 +311,4 @@ ], "is_official": false } -] \ No newline at end of file +] diff --git a/website/static/plugins.json b/website/static/plugins.json index e239b73e..d18bbd53 100644 --- a/website/static/plugins.json +++ b/website/static/plugins.json @@ -3348,4 +3348,4 @@ ], "is_official": false } -] \ No newline at end of file +] diff --git a/website/versions.json b/website/versions.json index c68bf8d8..099c4014 100644 --- a/website/versions.json +++ b/website/versions.json @@ -1,3 +1 @@ -[ - "2.0.0-rc.1" -] +["2.0.0-rc.1"]