From aa4a5e18d2d1725fc35d012d0cad2a092b4a5cdb Mon Sep 17 00:00:00 2001 From: Alan <41682961+alan-cooney@users.noreply.github.com> Date: Mon, 23 Oct 2023 08:41:22 +0800 Subject: [PATCH] Improve vscode defaults (#83) --- .devcontainer/devcontainer.json | 13 +++++++++---- .vscode/cspell.json | 13 +++++++++++++ .vscode/extensions.json | 30 ++++++++++++++++++++++++++++- .vscode/settings.json | 34 +++++++++++++++++++-------------- 4 files changed, 71 insertions(+), 19 deletions(-) create mode 100644 .vscode/cspell.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7a2d8e7..b6e78d1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,9 +20,7 @@ "vscode": { // Set *default* container specific settings.json values on container create. "settings": { - "python.defaultInterpreterPath": "/workspaces/CircuitsVis/python/.venv/bin/python", - "python.formatting.autopep8Path": "autopep8", - "python.linting.mypyPath": "mypy" + "mypy.dmypyExecutable": "dmypy" }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ @@ -35,8 +33,12 @@ "donjayamanne.python-extension-pack", "eg2.vscode-npm-script", "esbenp.prettier-vscode", + "github.copilot", "github.vscode-pull-request-github", "ionutvmi.path-autocomplete", + "mikoz.autoflake-extension", + "ms-python.isort", + "ms-python.pylint", "ms-python.python", "ms-python.vscode-pylance", "ms-toolsai.jupyter-keymap", @@ -48,9 +50,12 @@ "richie5um2.vscode-sort-json", "rvest.vs-code-prettier-eslint", "stkb.rewrap", + "streetsidesoftware.code-spell-checker-british-english", "streetsidesoftware.code-spell-checker", "tushortz.python-extended-snippets", - "yzhang.markdown-all-in-one" + "yzhang.markdown-all-in-one", + "matangover.mypy", + "github.vscode-github-actions" ] } }, diff --git a/.vscode/cspell.json b/.vscode/cspell.json new file mode 100644 index 0000000..f8771e6 --- /dev/null +++ b/.vscode/cspell.json @@ -0,0 +1,13 @@ +{ + "language": "en,en-GB", + "words": [ + "circuitsvis", + "Colab", + "Colord", + "crossorigin", + "devcontainer", + "Interpretability", + "ndarray", + "NPMJS" + ] +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index a9ec8e9..b080344 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,37 @@ { "recommendations": [ + "2gua.rainbow-brackets", + "christian-kohler.npm-intellisense", + "christian-kohler.path-intellisense", + "davidanson.vscode-markdownlint", "dbaeumer.vscode-eslint", + "donjayamanne.githistory", + "donjayamanne.python-extension-pack", + "eg2.vscode-npm-script", "esbenp.prettier-vscode", + "github.copilot", + "github.vscode-pull-request-github", + "ionutvmi.path-autocomplete", + "mikoz.autoflake-extension", + "ms-python.isort", + "ms-python.pylint", + "ms-python.python", + "ms-python.vscode-pylance", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.jupyter", + "ms-vsliveshare.vsliveshare-pack", + "njpwerner.autodocstring", + "redhat.vscode-yaml", + "richie5um2.vscode-sort-json", "rvest.vs-code-prettier-eslint", "stkb.rewrap", - "streetsidesoftware.code-spell-checker" + "streetsidesoftware.code-spell-checker-british-english", + "streetsidesoftware.code-spell-checker", + "tushortz.python-extended-snippets", + "yzhang.markdown-all-in-one", + "matangover.mypy", + "github.vscode-github-actions", + "mikoz.black-py" ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 95cb06e..84cc486 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,5 @@ { "rewrap.autoWrap.enabled": true, - "eslint.packageManager": "yarn", "eslint.workingDirectories": [ { "mode": "auto" @@ -10,26 +9,33 @@ "ignorePath": "../.gitignore" }, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": true, + "source.organizeImports": true }, "eslint.validate": [ "javascript", "typescript" ], - "cSpell.words": [ - "circuitsvis", - "Colab", - "Colord", - "crossorigin", - "devcontainer", - "Interpretability", - "ndarray", - "NPMJS" - ], "rewrap.reformat": false, "editor.formatOnSave": true, - "python.linting.pylintArgs": [ + "pylint.args": [ "--rcfile=./python/.pylintrc", "--generated-members=numpy.* ,torch.* ,cv2.* , cv.*" - ] + ], + "python.testing.pytestArgs": [ + "python/circuitsvis", + ], + "python.testing.pytestEnabled": true, + "rewrap.wrappingColumn": 100, + "pylint.importStrategy": "fromEnvironment", + "notebook.formatOnCellExecution": true, + "notebook.formatOnSave.enabled": true, + "mypy.configFile": "python/mypy.ini", + "mypy.targets": [ + "python/circuitsvis", + "python/circuitsvis/" + ], + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" + }, }