From 52e2b5dd565153f1a55b40bb5c118f7622ca1d9b Mon Sep 17 00:00:00 2001 From: Noorhteen Raja NJ Date: Wed, 21 Jun 2023 22:23:46 +0530 Subject: [PATCH] Codespaces and devcontainer.json (#5158) * chore: add devcontainer.json * chore: setup pre-commit and black * chore: using 3.10 version as to support pre-commit plugins --- .devcontainer/devcontainer.json | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..4c08e5657 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,39 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:0-3.10", + // "features": { + // "ghcr.io/devcontainers-contrib/features/pre-commit:2": {} + // }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip install --user -e '.[full,test,dev,doc]'; pre-commit install", + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python", + "editor.inlineSuggest.enabled": true, + "python.linting.mypyEnabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" + }, + "python.formatting.provider": "none" + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.black-formatter", + "GitHub.copilot" + ] + } + } +} \ No newline at end of file